mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
virstoragetest: Don't rewrite the 'qcow2' image
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>
This commit is contained in:
parent
2d6bd113e2
commit
b8732224a7
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user