From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnq03-00032i-WB for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:27:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnpzx-0005IN-Vq for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:26:51 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:43050 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnpzx-0005Hp-Ij for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:26:45 -0500 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Tue, 3 Dec 2013 14:26:01 +0100 Message-Id: <1386077165-19577-4-git-send-email-benoit@irqsave.net> In-Reply-To: <1386077165-19577-1-git-send-email-benoit@irqsave.net> References: <1386077165-19577-1-git-send-email-benoit@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [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: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , jcody@redhat.com, armbru@redhat.com, stefanha@redhat.com --- 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 ch= ar *target, } } =20 +BlockGraphNode * qmp_query_drive_graph(const char *device, Error **errp) +{ + /* the implementation of this function would recurse through the + * BlockDriverState graph to build it's result + */ + return NULL; +} + #define DEFAULT_MIRROR_BUF_SIZE (10 << 20) =20 void qmp_drive_mirror(const char *device, const char *target, diff --git a/qapi-schema.json b/qapi-schema.json index 8630eb5..938f8b9 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2008,6 +2008,38 @@ { 'command': 'drive-backup', 'data': 'DriveBackup' } =20 ## +# @BlockGraphNode +# +#=C2=A0Information 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 +## +{ 'type': 'BlockGraphNode', + 'data': { 'node-name': 'str', 'drv': 'str', 'children': ['BlockGraphNo= de'] } } + +## +# @query-drive-graph +# +# Get the block driver states graph for a given drive +# +#=C2=A0@device: the name of the device to get the graph from +# +# Returns: the root @BlockGraphNode +# +# Since 1.8 +## +{ 'command': 'query-drive-graph', + 'data': { 'device': 'str' }, + 'returns': 'BlockGraphNode' } + +## # @drive-mirror # # Start mirroring a block device's writes to a new destination. --=20 1.8.3.2