qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] quorum: add child name into filename
@ 2016-03-18  3:21 Wen Congyang
  2016-03-23 20:45 ` Max Reitz
  0 siblings, 1 reply; 2+ messages in thread
From: Wen Congyang @ 2016-03-18  3:21 UTC (permalink / raw)
  To: Alberto Garcia, Dr. David Alan Gilbert, Kevin Wolf, qemu-devl
  Cc: Changlong Xie, Stefan Hajnoczi

The monitor command 'query-block' or 'info block' will output the filename.
So we can get each children's child-name after this patch. This useful for
dynamic reconfiguration.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 block/quorum.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/block/quorum.c b/block/quorum.c
index da15465..182766a 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1036,9 +1036,13 @@ static void quorum_refresh_filename(BlockDriverState *bs, QDict *options)
 
     children = qlist_new();
     for (i = 0; i < s->num_children; i++) {
-        QINCREF(s->children[i]->bs->full_open_options);
-        qlist_append_obj(children,
-                         QOBJECT(s->children[i]->bs->full_open_options));
+        QDict *child_opts;
+        const char *child_name = s->children[i]->name;
+
+        child_opts = qdict_clone_shallow(s->children[i]->bs->full_open_options);
+        qdict_put_obj(child_opts, "child-name",
+                      QOBJECT(qstring_from_str(child_name)));
+        qlist_append_obj(children, QOBJECT(child_opts));
     }
 
     opts = qdict_new();
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-23 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18  3:21 [Qemu-devel] [PATCH] quorum: add child name into filename Wen Congyang
2016-03-23 20:45 ` Max Reitz

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).