mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
Check that '-drive format=' is supported before adding to qemu cmdline.
Qemu < 0.10.0 did not support it, and virt-* tools now try to add this by default, so it's extra important we ensure the option exists.
This commit is contained in:
parent
c9d9eddaa4
commit
659bd66529
@ -1,3 +1,8 @@
|
||||
Tue Jun 16 11:16:17 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||
|
||||
* src/qemu_conf.c src/qemu_conf.h tests/qemuhelptest.c
|
||||
tests/qemuxml2argvtest.c: Check that '-drive format=' is supported
|
||||
|
||||
Tue Jun 16 10:04:32 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||
|
||||
* tests/.cvsignore tests/.hgignore tests/.gitignore:
|
||||
|
@ -435,6 +435,8 @@ static unsigned int qemudComputeCmdFlags(const char *help,
|
||||
flags |= QEMUD_CMD_FLAG_DRIVE;
|
||||
if (strstr(help, "cache=writethrough|writeback|none"))
|
||||
flags |= QEMUD_CMD_FLAG_DRIVE_CACHE_V2;
|
||||
if (strstr(help, "format="))
|
||||
flags |= QEMUD_CMD_FLAG_DRIVE_FORMAT;
|
||||
}
|
||||
if (strstr(help, "boot=on"))
|
||||
flags |= QEMUD_CMD_FLAG_DRIVE_BOOT;
|
||||
@ -1231,7 +1233,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
if (bootable &&
|
||||
disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
|
||||
virBufferAddLit(&opt, ",boot=on");
|
||||
if (disk->driverType)
|
||||
if (disk->driverType &&
|
||||
qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_FORMAT)
|
||||
virBufferVSprintf(&opt, ",format=%s", disk->driverType);
|
||||
|
||||
if (disk->cachemode) {
|
||||
|
@ -56,6 +56,7 @@ enum qemud_cmd_flags {
|
||||
QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC = (1 << 11), /* New migration syntax after merge to QEMU with EXEC transport */
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2 = (1 << 12), /* Is the cache= flag wanting new v2 values */
|
||||
QEMUD_CMD_FLAG_KVM = (1 << 13), /* Whether KVM is compiled in */
|
||||
QEMUD_CMD_FLAG_DRIVE_FORMAT = (1 << 14), /* Is -drive format= avail */
|
||||
};
|
||||
|
||||
/* Main driver state */
|
||||
|
@ -90,10 +90,10 @@ mymain(int argc, char **argv)
|
||||
} while (0)
|
||||
|
||||
DO_TEST("qemu-0.9.1", 0x002f, 9001, 0, 0);
|
||||
DO_TEST("kvm-74", 0x233e, 9001, 1, 74);
|
||||
DO_TEST("qemu-0.10.5", 0x1c6f, 10005, 0, 0);
|
||||
DO_TEST("qemu-kvm-0.10.5", 0x3d7e, 10005, 1, 0);
|
||||
DO_TEST("kvm-86", 0x3d7e, 10050, 1, 0);
|
||||
DO_TEST("kvm-74", 0x633e, 9001, 1, 74);
|
||||
DO_TEST("qemu-0.10.5", 0x5c6f, 10005, 0, 0);
|
||||
DO_TEST("qemu-kvm-0.10.5", 0x7d7e, 10005, 1, 0);
|
||||
DO_TEST("kvm-86", 0x7d7e, 10050, 1, 0);
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
@ -196,17 +196,21 @@ mymain(int argc, char **argv)
|
||||
DO_TEST("disk-drive-boot-cdrom", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_BOOT);
|
||||
DO_TEST("disk-drive-fmt-qcow", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_BOOT);
|
||||
DO_TEST("disk-drive-shared", QEMUD_CMD_FLAG_DRIVE);
|
||||
DO_TEST("disk-drive-cache-v1-wt", QEMUD_CMD_FLAG_DRIVE);
|
||||
DO_TEST("disk-drive-cache-v1-wb", QEMUD_CMD_FLAG_DRIVE);
|
||||
DO_TEST("disk-drive-cache-v1-none", QEMUD_CMD_FLAG_DRIVE);
|
||||
QEMUD_CMD_FLAG_DRIVE_BOOT | QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-shared", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v1-wt", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v1-wb", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v1-none", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v2-wt", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2);
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2 | QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v2-wb", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2);
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2 | QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-drive-cache-v2-none", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2);
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2 | QEMUD_CMD_FLAG_DRIVE_FORMAT);
|
||||
DO_TEST("disk-usb", 0);
|
||||
DO_TEST("graphics-vnc", 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user