[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: Catch simultaneous usage of options and
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block: Catch simultaneous usage of options and their aliases |
Date: |
Thu, 18 Sep 2014 06:30:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 |
On 09/18/2014 03:57 AM, Kevin Wolf wrote:
> While thinking about precedence of conflicting block device options from
> different sources, I noticed that you can specify both an option and its
> legacy alias at the same time (e.g. readonly=on,read-only=off). Rather
> than specifying the order of precedence, we should simply forbid such
> combinations.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> blockdev.c | 46
> +++++++++++++++++++++++++++++++---------------
> tests/qemu-iotests/051 | 23 +++++++++++++++++++++++
> tests/qemu-iotests/051.out | 45 +++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 99 insertions(+), 15 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
>
> -static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to)
> +static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
> + Error **errp)
> {
> const char *value;
>
> + if (*errp) {
> + return;
> + }
Not the most typical usage, so it might be worth a comment that this
function can be called with errp already set. But since it's static,
it's not too hard to figure out as-is.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature