block: Use bdrv_get_backing_file_depth()

Use the dedicated counting function in qmp_query_block in order to
propagate the backing file depth to HMP and add backing_file_depth
to qmp-commands.hx

Signed-off-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Benoît Canet 2012-08-02 10:22:48 +02:00 committed by Luiz Capitulino
parent f198fd1c9a
commit 2e3e331710
3 changed files with 11 additions and 3 deletions

View file

@ -2450,6 +2450,9 @@ BlockInfoList *qmp_query_block(Error **errp)
info->value->inserted->backing_file = g_strdup(bs->backing_file);
}
info->value->inserted->backing_file_depth =
bdrv_get_backing_file_depth(bs);
if (bs->io_limits_enabled) {
info->value->inserted->bps =
bs->io_limits.bps[BLOCK_IO_LIMIT_TOTAL];