On Fri, Aug 9, 2019 at 12:11 PM Kevin Wolf <kw...@redhat.com> wrote: > bdrv_create options specified with -o have no effect when skipping image > creation with -n, so this doesn't make sense. Warn against the misuse > and deprecate the combination so we can make it a hard error later. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > qemu-img.c | 5 +++++ > qemu-deprecated.texi | 7 +++++++ > 2 files changed, 12 insertions(+) > > diff --git a/qemu-img.c b/qemu-img.c > index 79983772de..d9321f6418 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -2231,6 +2231,11 @@ static int img_convert(int argc, char **argv) > goto fail_getopt; > } > > + if (skip_create && options) { > + warn_report("-o has no effect when skipping image creation"); > + warn_report("This will become an error in future QEMU versions."); > + } > + > s.src_num = argc - optind - 1; > out_filename = s.src_num >= 1 ? argv[argc - 1] : NULL; > > diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi > index fff07bb2a3..7673d079c5 100644 > --- a/qemu-deprecated.texi > +++ b/qemu-deprecated.texi > @@ -305,6 +305,13 @@ to just export the entire image and then mount only > /dev/nbd0p1 than > it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a > subset of the image. > > +@subsection qemu-img convert -n -o (since 4.2.0) > + > +All options specified in @option{-o} are image creation options, so they > +have no effect when used with @option{-n} to skip image creation. This > +combination never made sense and shows that the user misunderstood the > +effect of the options, so this will be made an error in future versions. >
The user misunderstood by not reading qemu code? Both the online help and the manual page do not mention anything about that, so I think they should be fixed to explain the behavior, and this text should mention that the behavior was never documented. Nir > + > @section Build system > > @subsection Python 2 support (since 4.1.0) > -- > 2.20.1 > > >