From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@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 10:39:14 -0600 [thread overview]
Message-ID: <a42f2815-479c-e74a-3199-8a96c7a145f1@redhat.com> (raw)
In-Reply-To: <20191126162640.GC5889@linux.fritz.box>
On 11/26/19 10:26 AM, Kevin Wolf wrote:
>> 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?
QemuOpts is horrible. It allows duplication, and leaves it up to the
client what to do about it. Some clients use the duplication to collect
multiple arguments (such as specifying more than one cpu), some callers
treat duplication by honoring only the FIRST option specified (and
ignoring later uses - I find this ugly), and yet other callers treat
duplication by honoring only the LAST option specified.
>
> Somehow I'm almost sure that Markus will know an example...
Probably of all three (ab)uses of QemuOpt duplication.
>
> But anyway, I figure the same problem exists for almost all options.
>
> Kevin
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2019-11-26 16:40 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
2019-11-26 16:39 ` Eric Blake [this message]
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=a42f2815-479c-e74a-3199-8a96c7a145f1@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@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).