qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: qemu devel <qemu-devel@nongnu.org>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Alberto Garcia <berto@igalia.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu block <qemu-block@nongnu.org>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	Dong Eddie <eddie.dong@intel.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Gonglei <arei.gonglei@huawei.com>,
	Yang Hongyang <yanghy@cn.fujitsu.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: [Qemu-devel] [PATCH v4 4/4] hmp: add monitor command to add/remove a child
Date: Fri, 18 Sep 2015 18:13:15 +0800	[thread overview]
Message-ID: <1442571195-27116-5-git-send-email-wency@cn.fujitsu.com> (raw)
In-Reply-To: <1442571195-27116-1-git-send-email-wency@cn.fujitsu.com>

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
---
 hmp-commands.hx | 28 ++++++++++++++++++++++++++++
 hmp.c           | 20 ++++++++++++++++++++
 hmp.h           |  2 ++
 3 files changed, 50 insertions(+)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index a511004..6c5fe82 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -193,6 +193,34 @@ actions (drive options rerror, werror).
 ETEXI
 
     {
+        .name       = "blockdev_child_add",
+        .args_type  = "id:B,child:B",
+        .params     = "parent child",
+        .help       = "add a child to a BDS",
+        .mhandler.cmd = hmp_blockdev_child_add,
+    },
+
+STEXI
+@item blockdev_child_add @var{parent device} @var{child device}
+@findex blockdev_child_add
+Add a child to the block device.
+ETEXI
+
+    {
+        .name       = "blockdev_child_del",
+        .args_type  = "id:B,child:B",
+        .params     = "parent child",
+        .help       = "remove a child from a BDS",
+        .mhandler.cmd = hmp_blockdev_child_del,
+    },
+
+STEXI
+@item blockdev_child_del @var{parent device} @var{child device}
+@findex blockdev_child_del
+Remove a child from the parent device.
+ETEXI
+
+    {
         .name       = "change",
         .args_type  = "device:B,target:F,arg:s?",
         .params     = "device filename [format]",
diff --git a/hmp.c b/hmp.c
index 3f807b7..1dc1bed 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2325,3 +2325,23 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
 
     qapi_free_RockerOfDpaGroupList(list);
 }
+
+void hmp_blockdev_child_add(Monitor *mon, const QDict *qdict)
+{
+    const char *id = qdict_get_str(qdict, "id");
+    const char *child_id = qdict_get_str(qdict, "child");
+    Error *local_err = NULL;
+
+    qmp_x_blockdev_child_add(id, child_id, &local_err);
+    hmp_handle_error(mon, &local_err);
+}
+
+void hmp_blockdev_child_del(Monitor *mon, const QDict *qdict)
+{
+    const char *id = qdict_get_str(qdict, "id");
+    const char *child_id = qdict_get_str(qdict, "child");
+    Error *local_err = NULL;
+
+    qmp_x_blockdev_child_del(id, child_id, &local_err);
+    hmp_handle_error(mon, &local_err);
+}
diff --git a/hmp.h b/hmp.h
index 81656c3..3033648 100644
--- a/hmp.h
+++ b/hmp.h
@@ -130,5 +130,7 @@ void hmp_rocker(Monitor *mon, const QDict *qdict);
 void hmp_rocker_ports(Monitor *mon, const QDict *qdict);
 void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict);
 void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict);
+void hmp_blockdev_child_add(Monitor *mon, const QDict *qdict);
+void hmp_blockdev_child_del(Monitor *mon, const QDict *qdict);
 
 #endif
-- 
2.4.3

  parent reply	other threads:[~2015-09-18 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 10:13 [Qemu-devel] [PATCH v4 0/4] qapi: child add/delete support Wen Congyang
2015-09-18 10:13 ` [Qemu-devel] [PATCH v4 1/4] Add new block driver interface to add/delete a BDS's child Wen Congyang
2015-09-18 14:52   ` Eric Blake
2015-09-18 10:13 ` [Qemu-devel] [PATCH v4 2/4] quorum: implement bdrv_add_child() and bdrv_del_child() Wen Congyang
2015-09-18 10:13 ` [Qemu-devel] [PATCH v4 3/4] qmp: add monitor command to add/remove a child Wen Congyang
2015-09-18 14:58   ` Eric Blake
2015-09-18 10:13 ` Wen Congyang [this message]
2015-09-18 15:00   ` [Qemu-devel] [PATCH v4 4/4] hmp: " Eric Blake

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=1442571195-27116-5-git-send-email-wency@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=yanghy@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).