From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agkxX-0001Wf-OU for qemu-devel@nongnu.org; Thu, 17 Mar 2016 23:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agkxU-0006QS-HN for qemu-devel@nongnu.org; Thu, 17 Mar 2016 23:20:19 -0400 Received: from [59.151.112.132] (port=62222 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agkxU-0006Mu-5e for qemu-devel@nongnu.org; Thu, 17 Mar 2016 23:20:16 -0400 From: Wen Congyang Message-ID: <56EB743E.8060500@cn.fujitsu.com> Date: Fri, 18 Mar 2016 11:21:34 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] quorum: add child name into filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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