aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-02-23 17:50:37 +0100
committerKevin Wolf <kwolf@redhat.com>2016-03-14 16:46:43 +0100
commit2073d410ce3f2b1507bccd6aba68e8808647f9a9 (patch)
tree781c3ab45c5cd27f735cb47317511db52b49404a /blockdev.c
parentabb21ac3e602430bd7a35e88ecc2eb62c91c7b42 (diff)
hmp: Extend drive_del to delete nodes without BB
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 <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 1297c90512..322ca03908 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);