From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo2rh-0005Jm-FA for qemu-devel@nongnu.org; Tue, 03 Dec 2013 22:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vo2rb-0002u3-Fa for qemu-devel@nongnu.org; Tue, 03 Dec 2013 22:11:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo2rb-0002ty-7L for qemu-devel@nongnu.org; Tue, 03 Dec 2013 22:10:59 -0500 Message-ID: <529E9D2E.3070205@redhat.com> Date: Wed, 04 Dec 2013 11:10:38 +0800 From: Fam Zheng MIME-Version: 1.0 References: <1386077165-19577-1-git-send-email-benoit@irqsave.net> <1386077165-19577-4-git-send-email-benoit@irqsave.net> In-Reply-To: <1386077165-19577-4-git-send-email-benoit@irqsave.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC V3 3/7] qapi: Add skeletton of command to query a drive bs graph. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, armbru@redhat.com, stefanha@redhat.com On 2013=E5=B9=B412=E6=9C=8803=E6=97=A5 21:26, Beno=C3=AEt Canet wrote: > --- > blockdev.c | 8 ++++++++ > qapi-schema.json | 32 ++++++++++++++++++++++++++++++++ > 2 files changed, 40 insertions(+) > > diff --git a/blockdev.c b/blockdev.c > index a474bb5..824e718 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -1940,6 +1940,14 @@ void qmp_drive_backup(const char *device, const = char *target, > } > } > > +BlockGraphNode * qmp_query_drive_graph(const char *device, Error **err= p) > +{ > + /* the implementation of this function would recurse through the > + * BlockDriverState graph to build it's result s/it's/its/ > > ## > +# @BlockGraphNode > +# > +# Information about a node of the block driver state graph > +# > +# @node-name: the name of the node in the graph > +# > +# @drv: the name of the block format used by this node as described in > +# @BlockDeviceInfo. > +# > +# @children: a list of @BlockGraphNode being the children of this node > +# > +# Since 1.8 Since 2.0 > +## > +{ 'type': 'BlockGraphNode', > + 'data': { 'node-name': 'str', 'drv': 'str', 'children': ['BlockGraph= Node'] } } > + > +## > +# @query-drive-graph > +# > +# Get the block driver states graph for a given drive > +# > +# @device: the name of the device to get the graph from > +# > +# Returns: the root @BlockGraphNode > +# > +# Since 1.8 Same as above. Fam