On Wed, Aug 10, 2016 at 04:43:12AM +0200, Reda Sallahi wrote: > This patch adds a basic dd subcommand analogous to dd(1) to qemu-img. > > For the start, this implements the bs, if, of and count options and requires > both if and of to be specified (no stdin/stdout if not specified) and doesn't > support tty, pipes, etc. > > The image format must be specified with -O for the output if the raw format > is not the intended one. > > Two tests are added to test qemu-img dd. > > Signed-off-by: Reda Sallahi <fullma...@gmail.com> > --- > Changes from v8: > * Add an overflow check. > Changes from v7: > * Remove a C99-style for loop. > Changes from v6: > * Remove get_size() to use qemu_strtosz_suffix() instead. > * Type changes for some fields in DdIo and DdInfo. > Changes from v5: > * Add dd sections on qemu-img.texi. > Changes from v4: > * Fix the exit status. > Changes from v3: > * Delete an unused (so far) field in DdIo. > Changes from v2: > * Add copyright headers to new files. > Changes from v1: > * Removal of dead code. > * Fix a memory leak. > * Complete the cleanup function in the test cases. > > qemu-img-cmds.hx | 6 + > qemu-img.c | 303 > ++++++++++++++++++++++++++++++++++++++- > qemu-img.texi | 25 ++++ > tests/qemu-iotests/158 | 67 +++++++++ > tests/qemu-iotests/158.out | 15 ++ > tests/qemu-iotests/159 | 70 +++++++++ > tests/qemu-iotests/159.out | 87 +++++++++++ > tests/qemu-iotests/common.filter | 9 ++ > tests/qemu-iotests/common.rc | 5 +- > tests/qemu-iotests/group | 2 + > 10 files changed, 584 insertions(+), 5 deletions(-) > create mode 100755 tests/qemu-iotests/158 > create mode 100644 tests/qemu-iotests/158.out > create mode 100755 tests/qemu-iotests/159 > create mode 100644 tests/qemu-iotests/159.out
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature