block: Report data child for query-blockstats
commit3f26191c7350c28d9c17b5eba253bff367b6cb2e
authorMax Reitz <mreitz@redhat.com>
Thu, 28 Nov 2019 08:49:22 +0000 (28 09:49 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Sep 2020 10:31:31 +0000 (7 12:31 +0200)
treeba8f1c9c8834e0927ffff85d1db3713966fa84ef
parent7cc734a9ea1c57afe3b3fdeaba33b6a7da73bca2
block: Report data child for query-blockstats

It makes no sense to report the block stats of a purely metadata-storing
child in query-blockstats.  So if the primary child does not have any
data, try to find a unique data-storing child.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
block/qapi.c