qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, armbru@redhat.com
Subject: Re: [PATCH] block: Error out on image creation with conflicting size options
Date: Tue, 26 Nov 2019 17:26:40 +0100	[thread overview]
Message-ID: <20191126162640.GC5889@linux.fritz.box> (raw)
In-Reply-To: <2e913e12-4819-a729-2179-2b664601087a@redhat.com>

Am 26.11.2019 um 16:56 hat Eric Blake geschrieben:
> On 11/26/19 9:54 AM, Eric Blake wrote:
> > On 11/26/19 9:48 AM, Kevin Wolf wrote:
> > > If both the create options (qemu-img create -o ...) and the size
> > > parameter were given, the size parameter was silently ignored. Instead,
> > > make specifying two sizes an error.
> > > 
> > > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > > ---
> > >   block.c                    | 10 ++++++++--
> > >   tests/qemu-iotests/049     |  5 +++++
> > >   tests/qemu-iotests/049.out |  5 +++++
> > >   3 files changed, 18 insertions(+), 2 deletions(-)
> > 
> > Longtime bug, so not essential for 4.2-rc3.  But small enough that you
> > could sneak it in if you have other patches to queue and don't want to
> > wait for 5.0.
> > 
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> Actually, your patch fails to diagnose:
> 
> $ qemu-img create -o size=1m,size=2m -f qcow2 x.qcow2
> Formatting 'x.qcow2', fmt=qcow2 size=2097152 cluster_size=65536
> lazy_refcounts=off refcount_bits=16
> 
> so you may want to enhance this patch to also catch the case of -o size used
> more than once.

Hm... Isn't this something that QemuOpts should already catch? Or do we
have callers that actually expect the same option specified multiple
times?

Somehow I'm almost sure that Markus will know an example...

But anyway, I figure the same problem exists for almost all options.

Kevin



  reply	other threads:[~2019-11-26 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 15:48 [PATCH] block: Error out on image creation with conflicting size options Kevin Wolf
2019-11-26 15:54 ` Eric Blake
2019-11-26 15:56   ` Eric Blake
2019-11-26 16:26     ` Kevin Wolf [this message]
2019-11-26 16:39       ` Eric Blake
2019-11-26 19:58         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126162640.GC5889@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).