Eric Blake <ebl...@redhat.com> writes: > On 02/14/2017 04:26 AM, Markus Armbruster wrote: >> Cc: Kevin Wolf <kw...@redhat.com> >> Cc: Max Reitz <mre...@redhat.com> >> Cc: qemu-bl...@nongnu.org >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- >> qemu-img.c | 58 +++++++++++++++++++++++++++++++--------------------------- >> 1 file changed, 31 insertions(+), 27 deletions(-) > > >> @@ -3858,11 +3866,9 @@ static int img_dd_count(const char *arg, >> struct DdIo *in, struct DdIo *out, >> struct DdInfo *dd) >> { >> - char *end; >> + dd->count = cvtnum(arg); > > Hmm. cvtnum() accepts "1.5G", GNU dd does not. POSIX requires dd to > accept '1kx10k' to mean 10 mebibytes, and GNU dd accepts '10xM' as a > synonym, but cvtnum() does not accept all those corner cases. POSIX > requires dd to treat '1b' as '512', while cvdnum() treats it as '1'. I > sometimes wonder if our 'qemu-img dd' subcommand should be reusing the > numeric parsing that we use everywhere else, in spite of it meaning that > we are different than the POSIX quirks on what numbers are required to > be supported by dd.
qemu-img dd falls short of its stated goal to be like /usr/bin/dd. Whether that's good or bad I decline to judge ;) > But that's not the concern of this patch. Yes. > Reviewed-by: Eric Blake <ebl...@redhat.com> Thanks!