Patchwork [2/2] Add qmp version of drive_del

login
register
mail settings
Submitter Ryan Harper
Date Nov. 9, 2010, 2:25 a.m.
Message ID <1289269554-6766-3-git-send-email-ryanh@us.ibm.com>
Download mbox | patch
Permalink /patch/70487/
State New
Headers show

Comments

Ryan Harper - Nov. 9, 2010, 2:25 a.m.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
 qmp-commands.hx |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

Patch

diff --git a/qmp-commands.hx b/qmp-commands.hx
index 793cf1c..1e0d4e9 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -338,6 +338,35 @@  Example:
 EQMP
 
     {
+        .name       = "drive_del",
+        .args_type  = "id:s",
+        .params     = "device",
+        .help       = "remove host block device",
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_drive_del,
+    },
+
+SQMP
+drive del
+----------
+
+Remove host block device.  The result is that guest generated IO is no longer
+submitted against the host device underlying the disk.  Once a drive has
+been deleted, the QEMU Block layer returns -EIO which results in IO 
+errors in the guest for applications that are reading/writing to the device.
+
+Arguments:
+
+- "id": the device's ID (json-string)
+
+Example:
+
+-> { "execute": "drive_del", "arguments": { "id": "drive-virtio-blk1" } }
+<- { "return": {} }
+
+EQMP
+
+    {
         .name       = "cpu",
         .args_type  = "index:i",
         .params     = "index",