提交 81738cd0 编写于 作者: J Ján Tomko

storage: move qemu-img options before positional arguments

Modify the expected output of storagevolxml2argv tests as well.
上级 56e1b4c3
......@@ -773,8 +773,7 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
cmd = virCommandNew(create_tool);
if (inputvol) {
virCommandAddArgList(cmd, "convert", "-f", inputType, "-O", type,
inputPath, vol->target.path, NULL);
virCommandAddArgList(cmd, "convert", "-f", inputType, "-O", type, NULL);
if (imgformat == QEMU_IMG_BACKING_FORMAT_OPTIONS &&
(do_encryption || preallocate)) {
......@@ -785,18 +784,18 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
} else if (do_encryption) {
virCommandAddArg(cmd, "-e");
}
virCommandAddArgList(cmd, inputPath, vol->target.path, NULL);
} else if (vol->backingStore.path) {
virCommandAddArgList(cmd, "create", "-f", type,
"-b", vol->backingStore.path, NULL);
switch (imgformat) {
case QEMU_IMG_BACKING_FORMAT_FLAG:
virCommandAddArgList(cmd, "-F", backingType, vol->target.path,
NULL);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
virCommandAddArgList(cmd, "-F", backingType, NULL);
if (do_encryption)
virCommandAddArg(cmd, "-e");
virCommandAddArg(cmd, vol->target.path);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
break;
case QEMU_IMG_BACKING_FORMAT_OPTIONS:
......@@ -811,15 +810,13 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
VIR_INFO("Unable to set backing store format for %s with %s",
vol->target.path, create_tool);
virCommandAddArg(cmd, vol->target.path);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
if (do_encryption)
virCommandAddArg(cmd, "-e");
virCommandAddArg(cmd, vol->target.path);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
}
} else {
virCommandAddArgList(cmd, "create", "-f", type,
vol->target.path, NULL);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
virCommandAddArgList(cmd, "create", "-f", type, NULL);
if (imgformat == QEMU_IMG_BACKING_FORMAT_OPTIONS &&
(do_encryption || preallocate)) {
......@@ -830,6 +827,8 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
} else if (do_encryption) {
virCommandAddArg(cmd, "-e");
}
virCommandAddArg(cmd, vol->target.path);
virCommandAddArgFormat(cmd, "%lluK", size_arg);
}
return cmd;
......
qemu-img create -f qcow2 -b /dev/null -F raw /var/lib/libvirt/images/OtherDemo.img 5242880K -e
qemu-img create -f qcow2 -b /dev/null -F raw -e /var/lib/libvirt/images/OtherDemo.img 5242880K
qemu-img convert -f raw -O qcow2 /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img -e
qemu-img convert -f raw -O qcow2 -e /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img
qemu-img convert -f raw -O qcow2 /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img -e
qemu-img convert -f raw -O qcow2 -e /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img
qemu-img convert -f raw -O qcow2 /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img -o encryption=on,preallocation=metadata
qemu-img convert -f raw -O qcow2 -o encryption=on,preallocation=metadata /var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img
qemu-img create -f qcow2 /var/lib/libvirt/images/OtherDemo.img 5242880K -e
qemu-img create -f qcow2 -e /var/lib/libvirt/images/OtherDemo.img 5242880K
qemu-img create -f qcow2 /var/lib/libvirt/images/OtherDemo.img 5242880K -e
qemu-img create -f qcow2 -e /var/lib/libvirt/images/OtherDemo.img 5242880K
qemu-img create -f qcow2 /var/lib/libvirt/images/OtherDemo.img 5242880K -o encryption=on,preallocation=metadata
qemu-img create -f qcow2 -o encryption=on,preallocation=metadata /var/lib/libvirt/images/OtherDemo.img 5242880K
qemu-img create -f qcow2 -b /dev/null /var/lib/libvirt/images/OtherDemo.img 5242880K -e
qemu-img create -f qcow2 -b /dev/null -e /var/lib/libvirt/images/OtherDemo.img 5242880K
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册