qemu-patch-raspberry4/qapi
Kevin Wolf a0ddbcfb68 block: Skip implicit nodes in query-block/blockstats
Commits 0db832f and 6cdbceb introduced the automatic insertion of filter
nodes above the top layer of mirror and commit block jobs. The
assumption made there was that since libvirt doesn't do node-level
management of the block layer yet, it shouldn't be affected by added
nodes.

This is true as far as commands issued by libvirt are concerned. It only
uses BlockBackend names to address nodes, so any operations it performs
still operate on the root of the tree as intended.

However, the assumption breaks down when you consider query commands,
which return data for the wrong node now. These commands also return
information on some child nodes (bs->file and/or bs->backing), which
libvirt does make use of, and which refer to the wrong nodes, too.

One of the consequences is that oVirt gets wrong information about the
image size and stops the VM in response as long as a mirror or commit
job is running:

https://bugzilla.redhat.com/show_bug.cgi?id=1470634

This patch fixes the problem by hiding the implicit nodes created
automatically by the mirror and commit block jobs in the output of
query-block and BlockBackend-based query-blockstats as long as the user
doesn't indicate that they are aware of those nodes by providing a node
name for them in the QMP command to start the block job.

The node-based commands query-named-block-nodes and query-blockstats
with query-nodes=true still show all nodes, including implicit ones.
This ensures that users that are capable of node-level management can
still access the full information; users that only know BlockBackends
won't use these commands.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit d3c8c67469)
 Conflicts:
	block/qapi.c
	include/block/block_int.h
* fix context deps on 46eade7b and 5a9347c6
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2017-08-24 18:21:56 -05:00
..
Makefile.objs qapi: rename *qmp-*-visitor* to *qobject-*-visitor* 2016-10-25 16:25:48 +02:00
block-core.json block: Skip implicit nodes in query-block/blockstats 2017-08-24 18:21:56 -05:00
block.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
common.json qmp-commands: move 'query-commands' doc to schema 2017-01-16 09:19:47 +01:00
crypto.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
event.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
introspect.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
opts-visitor.c qapi: Fix QemuOpts visitor regression on unvisited input 2017-03-22 19:24:34 +01:00
qapi-clone-visitor.c qapi: rename *qmp-*-visitor* to *qobject-*-visitor* 2016-10-25 16:25:48 +02:00
qapi-dealloc-visitor.c qapi: Add new visit_free() function 2016-07-06 10:52:04 +02:00
qapi-util.c qapi: New parse_qapi_name() 2017-03-07 16:07:47 +01:00
qapi-visit-core.c qapi: Make input visitors detect unvisited list tails 2017-03-05 09:14:20 +01:00
qmp-dispatch.c qmp: Eliminate silly QERR_QMP_* macros 2017-03-05 09:14:19 +01:00
qmp-event.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
qmp-registry.c qapi: Support multiple command registries per program 2017-03-05 09:12:25 +01:00
qobject-input-visitor.c keyval: Support lists 2017-03-07 16:07:48 +01:00
qobject-output-visitor.c qapi: rename QmpOutputVisitor to QObjectOutputVisitor 2016-10-25 16:25:54 +02:00
rocker.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
string-input-visitor.c qapi: Fix string input visitor regression for empty lists 2017-03-21 10:43:01 +01:00
string-output-visitor.c qapi: Add new visit_complete() function 2016-07-06 10:52:04 +02:00
trace-events qapi: Make input visitors detect unvisited list tails 2017-03-05 09:14:20 +01:00
trace.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00