]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Don't rewrite the 'qcow2' image
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Sep 2021 15:07:31 +0000 (17:07 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
Create it with the appropriate backing file path rather than using
another instance of 'qemu-img rebase'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virstoragetest.c

index 1ee7bb5230b201424d4c77add369c0752bc05acc..9a7905e28dce3e47356fb13cc5627c46c9dcfd86 100644 (file)
@@ -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.  */