From b8732224a7dfc45e3de6b971213dfab4ea3a4cfc Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 8 Sep 2021 17:07:31 +0200 Subject: [PATCH] virstoragetest: Don't rewrite the 'qcow2' image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create it with the appropriate backing file path rather than using another instance of 'qemu-img rebase'. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/virstoragetest.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 1ee7bb5230..9a7905e28d 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -132,18 +132,15 @@ testPrepImages(void) /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ virCommandFree(cmd); - cmd = virCommandNewArgList(qemuimg, "create", "-f", "qcow2", NULL); - virCommandAddArgFormat(cmd, "-obacking_file=raw,backing_fmt=raw%s", - compat ? ",compat=0.10" : ""); + cmd = virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "raw", + "-b", absraw, NULL); + if (compat) + virCommandAddArgList(cmd, "-o", "compat=0.10", NULL); virCommandAddArg(cmd, "qcow2"); if (virCommandRun(cmd, NULL) < 0) goto skip; - /* Make sure our later uses of 'qemu-img rebase' will work */ - virCommandFree(cmd); - cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", absraw, "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - goto skip; /* Create a second qcow2 wrapping the first, to be sure that we * can correctly avoid insecure probing. */