From patchwork Fri Mar 18 03:21:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Congyang X-Patchwork-Id: 8615971 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D87A9F6E1 for ; Fri, 18 Mar 2016 03:20:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E90662038F for ; Fri, 18 Mar 2016 03:20:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41E232038E for ; Fri, 18 Mar 2016 03:20:57 +0000 (UTC) Received: from localhost ([::1]:41245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agky8-00020d-Lb for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Mar 2016 23:20:56 -0400 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 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="4714886" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Mar 2016 11:20:05 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id EDD9442B55F6; Fri, 18 Mar 2016 11:20:04 +0800 (CST) Received: from [10.167.226.52] (10.167.226.52) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.279.2; Fri, 18 Mar 2016 11:20:04 +0800 To: Alberto Garcia , "Dr. David Alan Gilbert" , Kevin Wolf , qemu-devl From: Wen Congyang Message-ID: <56EB743E.8060500@cn.fujitsu.com> Date: Fri, 18 Mar 2016 11:21:34 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.52] X-yoursite-MailScanner-ID: EDD9442B55F6.A79E3 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: wency@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: Changlong Xie , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] quorum: add child name into filename X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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();