From 6e6e55f5c2e5b520d6506c2716287ba3b5d1bbc8 Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 17 Jul 2017 20:34:22 -0400 Subject: qemu-img: Check for backing image if specified during create Or, rather, force the open of a backing image if one was specified for creation. Using a similar -unsafe option as rebase, allow qemu-img to ignore the backing file validation if possible. It may not always be possible, as in the existing case when a filesize for the new image was not specified. This is accomplished by shifting around the conditionals in bdrv_img_create, such that a backing file is always opened unless we provide BDRV_O_NO_BACKING. qemu-img is adjusted to pass this new flag when -u is provided to create. Sorry for the heinous looking diffstat, but it's mostly whitespace. Inspired by: https://bugzilla.redhat.com/show_bug.cgi?id=1213786 Signed-off-by: John Snow Signed-off-by: Kevin Wolf --- tests/qemu-iotests/139 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/qemu-iotests/139') diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index 175d8f0008..9ff51d9647 100644 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -65,7 +65,7 @@ class TestBlockdevDel(iotests.QMPTestCase): # Add a BlockDriverState that will be used as overlay for the base_img BDS def addBlockDriverStateOverlay(self, node): self.checkBlockDriverState(node, False) - iotests.qemu_img('create', '-f', iotests.imgfmt, + iotests.qemu_img('create', '-u', '-f', iotests.imgfmt, '-b', base_img, new_img, '1M') opts = {'driver': iotests.imgfmt, 'node-name': node, -- cgit v1.2.3