From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, vsementsov@virtuozzo.com
Subject: Re: [Qemu-devel] [PATCH v2 2.5/6] hmp: Add name parameter to nbd_server_add
Date: Thu, 11 Jan 2018 17:59:34 +0000 [thread overview]
Message-ID: <20180111175934.GB13384@work-vm> (raw)
In-Reply-To: <20180109192802.17167-1-eblake@redhat.com>
* Eric Blake (eblake@redhat.com) wrote:
> Extend the flexibility of the previous QMP patch to also work
> in HMP.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Thanks, that looks good to me from the HMP side; let me
know which way you want to take it; I can take it via
HMP once the code that uses it is in; whichever is easiest.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>
> In response to Dave's request.
> I could also squash this into Vladimir's 2/6 if desired.
>
> hmp.c | 3 ++-
> hmp-commands.hx | 9 +++++----
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/hmp.c b/hmp.c
> index 80c5b01540..c9fcdc8593 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2221,10 +2221,11 @@ exit:
> void hmp_nbd_server_add(Monitor *mon, const QDict *qdict)
> {
> const char *device = qdict_get_str(qdict, "device");
> + const char *name = qdict_get_try_str(qdict, "name");
> bool writable = qdict_get_try_bool(qdict, "writable", false);
> Error *local_err = NULL;
>
> - qmp_nbd_server_add(device, false, NULL, true, writable, &local_err);
> + qmp_nbd_server_add(device, !!name, name, true, writable, &local_err);
>
> if (local_err != NULL) {
> hmp_handle_error(mon, &local_err);
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 6d5ebdf6ab..b8b6fb9184 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1553,17 +1553,18 @@ ETEXI
>
> {
> .name = "nbd_server_add",
> - .args_type = "writable:-w,device:B",
> - .params = "nbd_server_add [-w] device",
> + .args_type = "writable:-w,device:B,name:s?",
> + .params = "nbd_server_add [-w] device [name]",
> .help = "export a block device via NBD",
> .cmd = hmp_nbd_server_add,
> },
> STEXI
> -@item nbd_server_add @var{device}
> +@item nbd_server_add @var{device} [ @var{name} ]
> @findex nbd_server_add
> Export a block device through QEMU's NBD server, which must be started
> beforehand with @command{nbd_server_start}. The @option{-w} option makes the
> -exported device writable too.
> +exported device writable too. The export name is controlled by @var{name},
> +defaulting to @var{device}.
> ETEXI
>
> {
> --
> 2.14.3
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2018-01-11 17:59 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 15:50 [Qemu-devel] [PATCH v2 0/6] nbd export qmp interface Vladimir Sementsov-Ogievskiy
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 1/6] nbd/server: add additional assert to nbd_export_put Vladimir Sementsov-Ogievskiy
2018-01-10 16:33 ` Eric Blake
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 2/6] qapi: add name parameter to nbd-server-add Vladimir Sementsov-Ogievskiy
2017-12-08 17:33 ` Dr. David Alan Gilbert
2017-12-09 9:28 ` Vladimir Sementsov-Ogievskiy
2018-01-09 19:06 ` Eric Blake
2018-01-10 16:01 ` Dr. David Alan Gilbert
2018-01-09 19:28 ` [Qemu-devel] [PATCH v2 2.5/6] hmp: Add name parameter to nbd_server_add Eric Blake
2018-01-11 17:59 ` Dr. David Alan Gilbert [this message]
2018-01-11 19:50 ` Eric Blake
2018-01-11 20:11 ` Dr. David Alan Gilbert
2018-01-09 19:05 ` [Qemu-devel] [PATCH v2 2/6] qapi: add name parameter to nbd-server-add Eric Blake
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 3/6] qapi: add nbd-server-remove Vladimir Sementsov-Ogievskiy
2018-01-09 19:52 ` Eric Blake
2018-01-12 9:47 ` Vladimir Sementsov-Ogievskiy
2018-01-15 15:09 ` Eric Blake
2018-01-15 17:47 ` Vladimir Sementsov-Ogievskiy
2018-01-17 13:36 ` Vladimir Sementsov-Ogievskiy
2018-01-17 15:23 ` Eric Blake
2018-01-17 15:51 ` Vladimir Sementsov-Ogievskiy
2018-01-17 16:03 ` Eric Blake
2018-01-17 16:39 ` Vladimir Sementsov-Ogievskiy
2018-01-26 15:05 ` Dr. David Alan Gilbert
2018-02-06 15:29 ` Vladimir Sementsov-Ogievskiy
2018-02-06 16:06 ` Eric Blake
2018-02-06 17:54 ` Vladimir Sementsov-Ogievskiy
2018-02-06 18:38 ` Dr. David Alan Gilbert
2018-02-07 7:14 ` Markus Armbruster
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 4/6] iotest 147: add cases to test new @name parameter of nbd-server-add Vladimir Sementsov-Ogievskiy
2018-01-09 20:21 ` Eric Blake
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 5/6] iotests: implement QemuIoInteractive class Vladimir Sementsov-Ogievskiy
2018-01-09 20:34 ` Eric Blake
2018-01-12 11:56 ` Vladimir Sementsov-Ogievskiy
2018-01-12 16:48 ` Eric Blake
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 6/6] iotest 201: new test for qmp nbd-server-remove Vladimir Sementsov-Ogievskiy
2018-01-09 20:49 ` Eric Blake
2018-01-12 11:43 ` Vladimir Sementsov-Ogievskiy
2018-01-12 16:54 ` Eric Blake
2018-01-15 14:40 ` Vladimir Sementsov-Ogievskiy
2018-01-15 15:05 ` Eric Blake
2018-01-15 18:28 ` Vladimir Sementsov-Ogievskiy
2017-12-21 11:52 ` [Qemu-devel] ping Re: [PATCH v2 0/6] nbd export qmp interface Vladimir Sementsov-Ogievskiy
2017-12-21 15:28 ` [Qemu-devel] " Markus Armbruster
2017-12-21 18:32 ` Eric Blake
2017-12-22 8:53 ` Vladimir Sementsov-Ogievskiy
2017-12-22 15:47 ` Eric Blake
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=20180111175934.GB13384@work-vm \
--to=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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.