[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change |
Date: |
Thu, 17 Dec 2015 09:43:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 12/17/2015 03:47 AM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> x-blockdev-change has no HMP equivalent, so add x_block_change.
>
> Example useages are:
s/useages/usages/
> x_block_change foo -a bah
> to add the node bah to the parent foo
>
> x_block_change foo -d bah
> to delete the node bah from the parent foo
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> +void hmp_block_change(Monitor *mon, const QDict *qdict)
> +{
> + const char *parent = qdict_get_str(qdict, "parent");
> + const char *child = qdict_get_str(qdict, "child");
> + bool add = qdict_get_try_bool(qdict, "add", false);
> + bool del = qdict_get_try_bool(qdict, "del", false);
> + Error *err = NULL;
> +
> + if (add == del) {
> + error_setg(&err, "One of -a or -d must be set");
Maybe s/One/Exactly one/ ?
Limited in that we may eventually want to allow both add and delete at
the same time; but HMP does not have hard-and-fast back-compat rules.
So I'm fine with fixing the minor issues mentioned above, and adding:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature