qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/4] qmp: Introduce blockdev-change-medium


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 1/4] qmp: Introduce blockdev-change-medium
Date: Fri, 05 Dec 2014 14:18:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2014-12-05 at 14:10, Eric Blake wrote:
On 12/05/2014 03:08 AM, Max Reitz wrote:
Introduce a new QMP command 'blockdev-change-medium' which is intended
to replace the 'change' command for block devices. The existing function
qmp_change_blockdev() is accordingly renamed to
qmp_blockdev_change_medium().

Signed-off-by: Max Reitz <address@hidden>
---
  blockdev.c                |  7 ++++---
  include/sysemu/blockdev.h |  2 --
  qapi/block-core.json      | 21 +++++++++++++++++++++
  qmp-commands.hx           | 31 +++++++++++++++++++++++++++++++
  qmp.c                     |  2 +-
  5 files changed, 57 insertions(+), 6 deletions(-)
I like it!

Good :-)

##
+# @blockdev-change-medium:
+#
+# Changes the medium inserted into a block device by ejecting the current 
medium
+# and loading a new image file which is inserted as the new medium.
+#
+# @device:      block device name
+#
+# @filename:    filename of the new image to be loaded
+#
+# @format:      #optional, format to open the new image with (defaults to the
+#               probed format)
+#
+# Since: 2.3
+##
+{ 'command': 'blockdev-change-medium',
+  'data': { 'device': 'str',
+            'filename': 'str',
+            '*format': 'str' } }
Someday, we should quit open-coding format as 'str' and instead make it
an enum; but that is a separate patch series, and can get this location
as part of that series.

Should there be a way to empty a cdrom drive?  That is, how do I change
a drive from visiting a file to being empty?

Doesn't 'eject' work?

Does passing the empty
string for mandatory 'filename' do that, or should we be strict and
state that filename is optional (omit to empty the drive) and that an
empty string as filename is forbidden?

Please also improve the documentation in qapi-schema.json to have the
'change' command mention that it is kept for backwards compatibility,
but that it is no longer the preferred command and point users to
'blockdev-change-medium'.

And to 'change-vnc-password'. Will do.

Max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]