qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 19/40] hmp: Extend drive_del to delete nodes without


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 19/40] hmp: Extend drive_del to delete nodes without BB
Date: Mon, 14 Mar 2016 18:37:20 +0100

Now that we can use drive_add to create new nodes without a BB, we also
want to be able to delete such nodes again.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
 blockdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index 1297c90..322ca03 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2824,6 +2824,15 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict)
     AioContext *aio_context;
     Error *local_err = NULL;
 
+    bs = bdrv_find_node(id);
+    if (bs) {
+        qmp_x_blockdev_del(false, NULL, true, id, &local_err);
+        if (local_err) {
+            error_report_err(local_err);
+        }
+        return;
+    }
+
     blk = blk_by_name(id);
     if (!blk) {
         error_report("Device '%s' not found", id);
-- 
1.8.3.1




reply via email to

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