mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: Add a capability flag for -no-acpi
Currently non-x86 guests must have <acpi/> defined in <features> to prevent libvirt from running qemu with -no-acpi. Although it works, it is a hack. Instead add a capability flag which indicates whether qemu understands the -no-acpi option. Use it to control whether libvirt emits -no-acpi. Current versions of qemu always display -no-acpi in their help output, so this patch has no effect. However the development version of qemu has been modified such that -no-acpi is only displayed when it is actually supported. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
This commit is contained in:
parent
9da9a3b047
commit
5abbe04d68
@ -142,6 +142,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
|
||||
"cache-unsafe", /* 75 */
|
||||
"rombar",
|
||||
"ich9-ahci",
|
||||
"no-acpi",
|
||||
);
|
||||
|
||||
struct qemu_feature_flags {
|
||||
@ -1066,6 +1067,8 @@ qemuCapsComputeCmdFlags(const char *help,
|
||||
qemuCapsSet(flags, QEMU_CAPS_RTC_TD_HACK);
|
||||
if (strstr(help, "-no-hpet"))
|
||||
qemuCapsSet(flags, QEMU_CAPS_NO_HPET);
|
||||
if (strstr(help, "-no-acpi"))
|
||||
qemuCapsSet(flags, QEMU_CAPS_NO_ACPI);
|
||||
if (strstr(help, "-no-kvm-pit-reinjection"))
|
||||
qemuCapsSet(flags, QEMU_CAPS_NO_KVM_PIT);
|
||||
if (strstr(help, "-tdf"))
|
||||
|
@ -115,6 +115,7 @@ enum qemuCapsFlags {
|
||||
QEMU_CAPS_DRIVE_CACHE_UNSAFE = 75, /* Is cache=unsafe supported? */
|
||||
QEMU_CAPS_PCI_ROMBAR = 76, /* -device rombar=0|1 */
|
||||
QEMU_CAPS_ICH9_AHCI = 77, /* -device ich9-ahci */
|
||||
QEMU_CAPS_NO_ACPI = 78, /* -no-acpi */
|
||||
|
||||
QEMU_CAPS_LAST, /* this must always be the last item */
|
||||
};
|
||||
|
@ -3941,8 +3941,10 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
if (monitor_json && qemuCapsGet(qemuCaps, QEMU_CAPS_NO_SHUTDOWN))
|
||||
virCommandAddArg(cmd, "-no-shutdown");
|
||||
|
||||
if (!(def->features & (1 << VIR_DOMAIN_FEATURE_ACPI)))
|
||||
virCommandAddArg(cmd, "-no-acpi");
|
||||
if (qemuCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI)) {
|
||||
if (!(def->features & (1 << VIR_DOMAIN_FEATURE_ACPI)))
|
||||
virCommandAddArg(cmd, "-no-acpi");
|
||||
}
|
||||
|
||||
if (!def->os.bootloader) {
|
||||
/*
|
||||
|
@ -81,11 +81,12 @@ static int testHelpStrParsing(const void *data)
|
||||
goto cleanup;
|
||||
|
||||
if (STRNEQ(got, expected)) {
|
||||
fprintf(stderr,
|
||||
"%s: computed flags do not match: got %s, expected %s\n",
|
||||
info->name, got, expected);
|
||||
if (virTestGetVerbose() || virTestGetDebug())
|
||||
fprintf(stderr,
|
||||
"%s: computed flags do not match: got %s, expected %s\n",
|
||||
info->name, got, expected);
|
||||
|
||||
if (getenv("VIR_TEST_DEBUG"))
|
||||
if (virTestGetDebug())
|
||||
printMismatchedFlags(flags, info->flags);
|
||||
|
||||
goto cleanup;
|
||||
@ -145,7 +146,8 @@ mymain(void)
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
QEMU_CAPS_DRIVE,
|
||||
QEMU_CAPS_NAME);
|
||||
QEMU_CAPS_NAME,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("kvm-74", 9001, 1, 74,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -158,7 +160,8 @@ mymain(void)
|
||||
QEMU_CAPS_DRIVE_FORMAT,
|
||||
QEMU_CAPS_MEM_PATH,
|
||||
QEMU_CAPS_TDF,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("kvm-83-rhel56", 9001, 1, 83,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -185,7 +188,8 @@ mymain(void)
|
||||
QEMU_CAPS_DRIVE_READONLY,
|
||||
QEMU_CAPS_SMBIOS_TYPE,
|
||||
QEMU_CAPS_SPICE,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-0.10.5", 10005, 0, 0,
|
||||
QEMU_CAPS_KQEMU,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
@ -205,7 +209,8 @@ mymain(void)
|
||||
QEMU_CAPS_RTC_TD_HACK,
|
||||
QEMU_CAPS_NO_HPET,
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.10.5", 10005, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -231,7 +236,8 @@ mymain(void)
|
||||
QEMU_CAPS_TDF,
|
||||
QEMU_CAPS_NESTING,
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("kvm-86", 10050, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -257,7 +263,8 @@ mymain(void)
|
||||
QEMU_CAPS_NESTING,
|
||||
QEMU_CAPS_SMBIOS_TYPE,
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.11.0-rc2", 10092, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -288,7 +295,8 @@ mymain(void)
|
||||
QEMU_CAPS_NAME_PROCESS,
|
||||
QEMU_CAPS_SMBIOS_TYPE,
|
||||
QEMU_CAPS_VGA_NONE,
|
||||
QEMU_CAPS_NO_SHUTDOWN);
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-0.12.1", 12001, 0, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -320,7 +328,8 @@ mymain(void)
|
||||
QEMU_CAPS_MIGRATE_QEMU_FD,
|
||||
QEMU_CAPS_DRIVE_AIO,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -366,7 +375,8 @@ mymain(void)
|
||||
QEMU_CAPS_PIIX4_USB_UHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -405,7 +415,8 @@ mymain(void)
|
||||
QEMU_CAPS_MIGRATE_QEMU_FD,
|
||||
QEMU_CAPS_DRIVE_AIO,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -460,7 +471,8 @@ mymain(void)
|
||||
QEMU_CAPS_PCI_OHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -511,7 +523,8 @@ mymain(void)
|
||||
QEMU_CAPS_PIIX4_USB_UHCI,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -570,7 +583,8 @@ mymain(void)
|
||||
QEMU_CAPS_ICH9_USB_EHCI1,
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR);
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
DO_TEST("qemu-1.0", 1000000, 0, 0,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
@ -632,7 +646,8 @@ mymain(void)
|
||||
QEMU_CAPS_USB_HUB,
|
||||
QEMU_CAPS_NO_SHUTDOWN,
|
||||
QEMU_CAPS_PCI_ROMBAR,
|
||||
QEMU_CAPS_ICH9_AHCI);
|
||||
QEMU_CAPS_ICH9_AHCI,
|
||||
QEMU_CAPS_NO_ACPI);
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
@ -145,6 +145,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
qemuCapsSetList(extraFlags,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_LAST);
|
||||
|
||||
if (qemudCanonicalizeMachine(&driver, vmdef) < 0)
|
||||
|
@ -89,6 +89,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
qemuCapsSetList(extraFlags,
|
||||
QEMU_CAPS_VNC_COLON,
|
||||
QEMU_CAPS_NO_REBOOT,
|
||||
QEMU_CAPS_NO_ACPI,
|
||||
QEMU_CAPS_LAST);
|
||||
|
||||
if (qemudCanonicalizeMachine(&driver, vmdef) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user