aboutsummaryrefslogtreecommitdiff
path: root/block/qapi.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2015-12-14 14:55:16 -0500
committerMax Reitz <mreitz@redhat.com>2015-12-18 14:36:17 +0100
commita5002d53029df4d7ebaf87c821b3dc07b65e5e52 (patch)
tree4d187ad9aab5ad2528baeecc7c28ee21d0a62274 /block/qapi.c
parent92d617abc53180cbfa88482382e8f0c13853cc1d (diff)
block/qapi: allow best-effort query
For more complex BDS trees that can be created under normal circumstances, we lose the ability to issue query commands because of our inability to re-construct the absolute filename. Instead, omit this field when it is a problem and present as much information as we can. This will change the expected output in iotest 110, where we will now see a json filename and the lack of an absolute filename instead of an error. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1450122916-4706-6-git-send-email-jsnow@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qapi.c')
-rw-r--r--block/qapi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/qapi.c b/block/qapi.c
index 5587c6471c..fecac253de 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -245,10 +245,11 @@ void bdrv_query_image_info(BlockDriverState *bs,
info->has_backing_filename = true;
bdrv_get_full_backing_filename(bs, backing_filename2, PATH_MAX, &err);
if (err) {
- error_propagate(errp, err);
- qapi_free_ImageInfo(info);
+ /* Can't reconstruct the full backing filename, so we must omit
+ * this field and apply a Best Effort to this query. */
g_free(backing_filename2);
- return;
+ backing_filename2 = NULL;
+ error_free(err);
}
/* Always report the full_backing_filename if present, even if it's the