On 10.08.2016 17:03, Reda Sallahi wrote: > This patch adds the seek option which allows qemu-img dd to skip a number of > blocks on the output before copying the input. > > A test case was added to test the seek option. > > Signed-off-by: Reda Sallahi <fullma...@gmail.com> > --- > Depends on: > [PATCH v5] qemu-img: add skip option to dd > > qemu-img-cmds.hx | 4 +- > qemu-img.c | 116 > ++++++++++++++++++++++++++++++++++++++------- > qemu-img.texi | 4 +- > tests/qemu-iotests/161 | 72 ++++++++++++++++++++++++++++ > tests/qemu-iotests/161.out | 51 ++++++++++++++++++++ > tests/qemu-iotests/group | 1 + > 6 files changed, 228 insertions(+), 20 deletions(-) > create mode 100755 tests/qemu-iotests/161 > create mode 100644 tests/qemu-iotests/161.out
On IRC, Kevin has raised concern that qemu-img dd should never truncate the output image, or at least not until told to do so. While I do not share his opinion, I do share his concern that people may fall into this trap. Therefore, I propose doing two things: First, we should merge a patch which implements conv=notrunc. Without qemu-img dd actually truncating anything yet, that will be rather trivial. However, I think that until we have come to a conclusion on how to handle the case where conv=notrunc has not been passed, we should actually make conv=notrunc mandatory. That is, the patch implementing conv=notrunc should also make qemu-img dd error out if it has not been specified. I admit this is a rather stupid idea but I think it will do the trick for now. Second, this patch should be separated into two parts: The first of which make qemu-img dd no longer create the output image if it exists already, and the second of which then implements the seek option. Those are two different things so I think they should be done in two different patches. Max
signature.asc
Description: OpenPGP digital signature