All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 08/29] blockdev: Drop BD-{remove, insert}-medium's @device
Date: Tue, 23 Jan 2018 15:01:40 +0100	[thread overview]
Message-ID: <20180123140201.31163-9-kwolf@redhat.com> (raw)
In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com>

From: Max Reitz <mreitz@redhat.com>

This is an incompatible change, which is fine as the commands are
experimental.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20171110224302.14424-4-mreitz@redhat.com
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qapi/block-core.json | 10 ++--------
 blockdev.c           | 30 +++++++++++++++++++++++-------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index e94a6881b2..d1df47de26 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3411,8 +3411,6 @@
 #
 # If the tray is open and there is no medium inserted, this will be a no-op.
 #
-# @device: Block device name (deprecated, use @id instead)
-#
 # @id:     The name or QOM path of the guest device (since: 2.8)
 #
 # Note: This command is still a work in progress and is considered experimental.
@@ -3447,8 +3445,7 @@
 #
 ##
 { 'command': 'x-blockdev-remove-medium',
-  'data': { '*device': 'str',
-            '*id': 'str' } }
+  'data': { 'id': 'str' } }
 
 ##
 # @x-blockdev-insert-medium:
@@ -3457,8 +3454,6 @@
 # device's tray must currently be open (unless there is no attached guest
 # device) and there must be no medium inserted already.
 #
-# @device:    Block device name (deprecated, use @id instead)
-#
 # @id:        The name or QOM path of the guest device (since: 2.8)
 #
 # @node-name: name of a node in the block driver state graph
@@ -3486,8 +3481,7 @@
 #
 ##
 { 'command': 'x-blockdev-insert-medium',
-  'data': { '*device': 'str',
-            '*id': 'str',
+  'data': { 'id': 'str',
             'node-name': 'str'} }
 
 
diff --git a/blockdev.c b/blockdev.c
index 29d569a24e..2f9aef4167 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -60,6 +60,11 @@ static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =
 
 static int do_open_tray(const char *blk_name, const char *qdev_id,
                         bool force, Error **errp);
+static void blockdev_remove_medium(bool has_device, const char *device,
+                                   bool has_id, const char *id, Error **errp);
+static void blockdev_insert_medium(bool has_device, const char *device,
+                                   bool has_id, const char *id,
+                                   const char *node_name, Error **errp);
 
 static const char *const if_name[IF_COUNT] = {
     [IF_NONE] = "none",
@@ -2323,7 +2328,7 @@ void qmp_eject(bool has_device, const char *device,
     }
     error_free(local_err);
 
-    qmp_x_blockdev_remove_medium(has_device, device, has_id, id, errp);
+    blockdev_remove_medium(has_device, device, has_id, id, errp);
 }
 
 void qmp_block_passwd(bool has_device, const char *device,
@@ -2446,8 +2451,8 @@ void qmp_blockdev_close_tray(bool has_device, const char *device,
     }
 }
 
-void qmp_x_blockdev_remove_medium(bool has_device, const char *device,
-                                  bool has_id, const char *id, Error **errp)
+static void blockdev_remove_medium(bool has_device, const char *device,
+                                   bool has_id, const char *id, Error **errp)
 {
     BlockBackend *blk;
     BlockDriverState *bs;
@@ -2503,6 +2508,11 @@ out:
     aio_context_release(aio_context);
 }
 
+void qmp_x_blockdev_remove_medium(const char *id, Error **errp)
+{
+    blockdev_remove_medium(false, NULL, true, id, errp);
+}
+
 static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
                                             BlockDriverState *bs, Error **errp)
 {
@@ -2548,9 +2558,9 @@ static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
     }
 }
 
-void qmp_x_blockdev_insert_medium(bool has_device, const char *device,
-                                  bool has_id, const char *id,
-                                  const char *node_name, Error **errp)
+static void blockdev_insert_medium(bool has_device, const char *device,
+                                   bool has_id, const char *id,
+                                   const char *node_name, Error **errp)
 {
     BlockBackend *blk;
     BlockDriverState *bs;
@@ -2576,6 +2586,12 @@ void qmp_x_blockdev_insert_medium(bool has_device, const char *device,
     qmp_blockdev_insert_anon_medium(blk, bs, errp);
 }
 
+void qmp_x_blockdev_insert_medium(const char *id, const char *node_name,
+                                  Error **errp)
+{
+    blockdev_insert_medium(false, NULL, true, id, node_name, errp);
+}
+
 void qmp_blockdev_change_medium(bool has_device, const char *device,
                                 bool has_id, const char *id,
                                 const char *filename,
@@ -2650,7 +2666,7 @@ void qmp_blockdev_change_medium(bool has_device, const char *device,
     error_free(err);
     err = NULL;
 
-    qmp_x_blockdev_remove_medium(has_device, device, has_id, id, &err);
+    blockdev_remove_medium(has_device, device, has_id, id, &err);
     if (err) {
         error_propagate(errp, err);
         goto fail;
-- 
2.13.6

  parent reply	other threads:[~2018-01-23 14:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 14:01 [Qemu-devel] [PULL 00/29] Block layer patches Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 01/29] osdep: Retry SETLK upon EINTR Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 02/29] hw/block: Fix pin-based interrupt behaviour of NVMe Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 03/29] tests/.gitignore: Add test-bdrv-drain Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 04/29] tests/qemu-iotests: adding savevm/loadvm with postcopy flag test Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 05/29] qcow2: Repair unaligned preallocated zero clusters Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id Kevin Wolf
2018-02-12 11:16   ` Christian Borntraeger
2018-02-12 11:33     ` Christian Borntraeger
2018-02-12 12:34       ` Max Reitz
2018-01-23 14:01 ` [Qemu-devel] [PULL 07/29] tests/ahci: Switch tray and medium commands to @id Kevin Wolf
2018-01-23 14:01 ` Kevin Wolf [this message]
2018-01-23 14:01 ` [Qemu-devel] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 10/29] qemu-iotests: Fix locking issue in 102 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 11/29] block/vmdk: Fix , instead of ; at end of line Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 13/29] block/qcow: Add blkdebug events Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 14/29] block/vmdk: " Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 15/29] iotests: Fix _img_info for backslashes Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 16/29] iotests: Drop format-specific in _filter_img_info Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 17/29] iotests: Forbid 020 for non-file protocols Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 18/29] iotests: Skip 103 for refcount_bits=1 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 19/29] iotests: Fix 020 for vmdk Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 20/29] iotests: Fix 051 for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 21/29] iotests: Fix 059's reference output Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 22/29] iotests: Fix 067 for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 23/29] iotests: Make 089 compatible with compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 24/29] iotests: Make 184 image-less Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 25/29] iotests: Make 191 work with qcow2 options Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 26/29] iotests: Filter compat-dependent info in 198 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 27/29] iotests: Make 059 pass on machines with little RAM Kevin Wolf
2018-01-23 14:02 ` [Qemu-devel] [PULL 28/29] iotests: Split 177 into two parts for compat=0.10 Kevin Wolf
2018-01-23 14:02 ` [Qemu-devel] [PULL 29/29] iotests: Disable some tests " Kevin Wolf
2018-01-25  9:53 ` [Qemu-devel] [PULL 00/29] Block layer patches Peter Maydell

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=20180123140201.31163-9-kwolf@redhat.com \
    --to=kwolf@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.