All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: mreitz@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 04/10] block: Accept device model name for blockdev-open/close-tray
Date: Wed, 14 Sep 2016 15:49:08 -0500	[thread overview]
Message-ID: <e7380b80-3bc7-9924-cfda-396f622ea1d8@redhat.com> (raw)
In-Reply-To: <1471625435-6190-5-git-send-email-kwolf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

On 08/19/2016 11:50 AM, Kevin Wolf wrote:
> In order to remove the necessity to use BlockBackend names in the
> external API, we want to allow qdev device names in all device related
> commands.
> 
> This converts blockdev-open/close-tray to accept a qdev device name.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c           | 60 +++++++++++++++++++++++++++++++++++++++-------------
>  qapi/block-core.json | 14 ++++++++----
>  qmp-commands.hx      | 12 +++++++----
>  3 files changed, 63 insertions(+), 23 deletions(-)
> 

> +++ b/qapi/block-core.json
> @@ -2316,7 +2316,9 @@
>  #   to it
>  # - if the guest device does not have an actual tray
>  #
> -# @device: block device name
> +# @device:  block device name (deprecated, use @id instead)
> +#
> +# @id:      the name or QOM path of the guest device (since: 2.8)

Wish there were an easier way to write mutually-exclusive pairs in JSON,
but without that, your approach is fine.

> +++ b/qmp-commands.hx
> @@ -4277,7 +4277,7 @@ EQMP
>  
>      {
>          .name       = "blockdev-open-tray",
> -        .args_type  = "device:s,force:b?",
> +        .args_type  = "device:s?,id:s?,force:b?",
>          .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
>      },

Will conflict with Marc-Andre's work to remove qmp-commands.hx; but we
can figure it out based on what merges first.

>  
> @@ -4302,7 +4302,9 @@ which no such event will be generated, these include:
>  
>  Arguments:
>  
> -- "device": block device name (json-string)
> +- "device": block device name (deprecated, use @id instead)
> +            (json-string, optional)
> +- "id": the name or QOM path of the guest device (json-string, optional)
>  - "force": if false (the default), an eject request will be sent to the guest if
>             it has locked the tray (and the tray will not be opened immediately);
>             if true, the tray will be opened regardless of whether it is locked

Are there any example code snippets that should be updated alongside
this? If not, should we be thinking of adding an example?

But I can live with this patch as an incremental improvement, even if we
decide we want more as a followup based on my question above, so:

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 --]

  reply	other threads:[~2016-09-14 20:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 16:50 [Qemu-devel] [PATCH 00/10] block: Accept qdev IDs in device level QMP commands Kevin Wolf
2016-08-19 16:50 ` [Qemu-devel] [PATCH 01/10] block: Add blk_by_dev() Kevin Wolf
2016-08-19 16:50 ` [Qemu-devel] [PATCH 02/10] qdev-monitor: Factor out find_device_state() Kevin Wolf
2016-08-19 16:50 ` [Qemu-devel] [PATCH 03/10] qdev-monitor: Add blk_by_qdev_id() Kevin Wolf
2016-08-19 16:50 ` [Qemu-devel] [PATCH 04/10] block: Accept device model name for blockdev-open/close-tray Kevin Wolf
2016-09-14 20:49   ` Eric Blake [this message]
2016-09-15  8:35     ` Kevin Wolf
2016-09-15 15:51       ` Eric Blake
2016-09-19 15:10         ` Kevin Wolf
2016-08-19 16:50 ` [Qemu-devel] [PATCH 05/10] block: Accept device model name for x-blockdev-insert-medium Kevin Wolf
2016-09-14 20:57   ` Eric Blake
2016-09-15  8:37     ` Kevin Wolf
2016-09-15 15:53       ` Eric Blake
2016-08-19 16:50 ` [Qemu-devel] [PATCH 06/10] block: Accept device model name for x-blockdev-remove-medium Kevin Wolf
2016-09-14 21:01   ` Eric Blake
2016-08-19 16:50 ` [Qemu-devel] [PATCH 07/10] block: Accept device model name for eject Kevin Wolf
2016-09-14 21:09   ` Eric Blake
2016-08-19 16:50 ` [Qemu-devel] [PATCH 08/10] block: Accept device model name for blockdev-change-medium Kevin Wolf
2016-09-14 22:06   ` Eric Blake
2016-08-19 16:50 ` [Qemu-devel] [PATCH 09/10] block: Accept device model name for block_set_io_throttle Kevin Wolf
2016-09-14 22:07   ` Eric Blake
2016-08-19 16:50 ` [Qemu-devel] [PATCH 10/10] qemu-iotests/118: Test media change with qdev name Kevin Wolf
2016-09-14 22:13   ` Eric Blake
2016-09-15  8:47     ` Kevin Wolf
2016-09-15 16:16     ` Sascha Silbe
2016-09-15 16:23       ` Eric Blake
2016-09-15 16:28       ` Sascha Silbe
2016-09-15 16:33         ` Eric Blake
2016-09-15 17:57           ` Sascha Silbe
2016-09-05 15:55 ` [Qemu-devel] [PATCH 00/10] block: Accept qdev IDs in device level QMP commands Kevin Wolf
2016-09-14 13:03   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-09-14 21:52     ` John Snow

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=e7380b80-3bc7-9924-cfda-396f622ea1d8@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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 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.