[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 45/48] block/qapi: always report full_backing_filenam
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 45/48] block/qapi: always report full_backing_filename |
Date: |
Fri, 18 Dec 2015 16:07:51 +0100 |
From: John Snow <address@hidden>
Always report full_backing_filename, even if it's the same as
backing_filename. In the next patch, full_backing_filename may be
omitted if it cannot be generated instead of allowing e.g. drive_query
to abort if it runs into this scenario.
The presence or absence of the "full" field becomes useful information.
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/qapi.c | 7 ++++---
tests/qemu-iotests/043.out | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/block/qapi.c b/block/qapi.c
index 563dd31..3d8e434 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -251,9 +251,10 @@ void bdrv_query_image_info(BlockDriverState *bs,
return;
}
- if (strcmp(backing_filename, backing_filename2) != 0) {
- info->full_backing_filename =
- g_strdup(backing_filename2);
+ /* Always report the full_backing_filename if present, even if it's the
+ * same as backing_filename. That they are same is useful info. */
+ if (backing_filename2) {
+ info->full_backing_filename = g_strdup(backing_filename2);
info->has_full_backing_filename = true;
}
diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
index 33f8cc3..b37d2a3 100644
--- a/tests/qemu-iotests/043.out
+++ b/tests/qemu-iotests/043.out
@@ -44,6 +44,7 @@ cluster_size: 65536
"filename": "TEST_DIR/t.IMGFMT",
"cluster-size": 65536,
"format": "IMGFMT",
+ "full-backing-filename": "TEST_DIR/t.IMGFMT.2.base",
"backing-filename": "TEST_DIR/t.IMGFMT.2.base",
"dirty-flag": false
},
@@ -52,6 +53,7 @@ cluster_size: 65536
"filename": "TEST_DIR/t.IMGFMT.2.base",
"cluster-size": 65536,
"format": "IMGFMT",
+ "full-backing-filename": "TEST_DIR/t.IMGFMT.1.base",
"backing-filename": "TEST_DIR/t.IMGFMT.1.base",
"dirty-flag": false
},
--
1.8.3.1
- [Qemu-block] [PULL 05/48] block: Fix reopen with semantically overlapping options, (continued)
- [Qemu-block] [PULL 05/48] block: Fix reopen with semantically overlapping options, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 15/48] block: Split out parse_json_protocol(), Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 14/48] block: Add infrastructure for option inheritance, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 17/48] blockdev: Set 'format' indicates non-empty drive, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 19/48] block: reopen: Extract QemuOpts for generic block layer options, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 20/48] block: Move cache options into options QDict, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 21/48] blkdebug: Enable reopen, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 42/48] qemu-iotests: s390x: fix test 051, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 23/48] qemu-iotests: Test cache mode option inheritance, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 02/48] iotests: 124: move incremental failure test, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 45/48] block/qapi: always report full_backing_filename,
Kevin Wolf <=
- [Qemu-block] [PULL 43/48] qemu-iotests: s390x: fix test 068, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 44/48] block/qapi: do not redundantly print "actual path", Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 36/48] raw-posix: Make aio=native option binding, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 41/48] qemu-iotests: refine common.config, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 34/48] iotests: Extend test 112 for qemu-img amend, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 24/48] qemu-iotests: Test reopen with node-name/driver options, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 03/48] iotests: 124: don't reopen qcow2, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 33/48] qcow2: Point to amend function in check, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 40/48] block: fix bdrv_ioctl called from coroutine, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 39/48] block: use drained section around bdrv_snapshot_delete, Kevin Wolf, 2015/12/18