From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>,
wency@cn.fujitsu.com, zhang.zhanghailiang@huawei.com,
qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change
Date: Thu, 17 Dec 2015 09:43:40 -0700 [thread overview]
Message-ID: <5672E63C.80303@redhat.com> (raw)
In-Reply-To: <1450349251-10326-1-git-send-email-dgilbert@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]
On 12/17/2015 03:47 AM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> 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 <dgilbert@redhat.com>
> ---
> +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 <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-12-17 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 10:47 [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change Dr. David Alan Gilbert (git)
2015-12-17 16:43 ` Eric Blake [this message]
2015-12-17 16:48 ` Dr. David Alan Gilbert
2016-01-18 13:06 ` Markus Armbruster
2016-01-18 13:11 ` Dr. David Alan Gilbert
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=5672E63C.80303@redhat.com \
--to=eblake@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wency@cn.fujitsu.com \
--cc=zhang.zhanghailiang@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.