}
-static int
+static void
qemuBuildPMCommandLine(virCommand *cmd,
const virDomainDef *def,
qemuDomainObjPrivate *priv)
virCommandAddArg(cmd, "-no-acpi");
}
- /* We fall back to PIIX4_PM even for q35, since it's what we did
- pre-q35-pm support. QEMU starts up fine (with a warning) if
- mixing PIIX PM and -M q35. Starting to reject things here
- could mean we refuse to start existing configs in the wild.*/
- if (def->pm.s3) {
+ if (def->pm.s3 || def->pm.s4) {
const char *pm_object = "PIIX4_PM";
- if (qemuDomainIsQ35(def) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S3))
+ if (qemuDomainIsQ35(def))
pm_object = "ICH9-LPC";
- virCommandAddArg(cmd, "-global");
- virCommandAddArgFormat(cmd, "%s.disable_s3=%d",
- pm_object, def->pm.s3 == VIR_TRISTATE_BOOL_NO);
- }
-
- if (def->pm.s4) {
- const char *pm_object = "PIIX4_PM";
-
- if (qemuDomainIsQ35(def) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S4))
- pm_object = "ICH9-LPC";
+ if (def->pm.s3) {
+ virCommandAddArg(cmd, "-global");
+ virCommandAddArgFormat(cmd, "%s.disable_s3=%d",
+ pm_object, def->pm.s3 == VIR_TRISTATE_BOOL_NO);
+ }
- virCommandAddArg(cmd, "-global");
- virCommandAddArgFormat(cmd, "%s.disable_s4=%d",
- pm_object, def->pm.s4 == VIR_TRISTATE_BOOL_NO);
+ if (def->pm.s4) {
+ virCommandAddArg(cmd, "-global");
+ virCommandAddArgFormat(cmd, "%s.disable_s4=%d",
+ pm_object, def->pm.s4 == VIR_TRISTATE_BOOL_NO);
+ }
}
-
- return 0;
}
if (qemuBuildClockCommandLine(cmd, def, qemuCaps) < 0)
return NULL;
- if (qemuBuildPMCommandLine(cmd, def, priv) < 0)
- return NULL;
+ qemuBuildPMCommandLine(cmd, def, priv);
if (qemuBuildBootCommandLine(cmd, def) < 0)
return NULL;
}
-static int
-qemuValidateDomainDefPM(const virDomainDef *def,
- virQEMUCaps *qemuCaps)
-{
- bool q35Dom = qemuDomainIsQ35(def);
-
- if (def->pm.s3) {
- bool q35ICH9_S3 = q35Dom &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S3);
-
- if (!q35ICH9_S3 && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX_DISABLE_S3)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("setting ACPI S3 not supported"));
- return -1;
- }
- }
-
- if (def->pm.s4) {
- bool q35ICH9_S4 = q35Dom &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S4);
-
- if (!q35ICH9_S4 && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX_DISABLE_S4)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("setting ACPI S4 not supported"));
- return -1;
- }
- }
-
- return 0;
-}
-
-
static int
qemuValidateDomainDefNvram(const virDomainDef *def,
virQEMUCaps *qemuCaps)
if (qemuValidateDomainDefClockTimers(def, qemuCaps) < 0)
return -1;
- if (qemuValidateDomainDefPM(def, qemuCaps) < 0)
+ if ((def->pm.s3 || def->pm.s4) && !ARCH_IS_X86(def->os.arch)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("setting ACPI S3/S4 not supported"));
return -1;
+ }
if (qemuValidateDomainDefBoot(def, qemuCaps) < 0)
return -1;
+++ /dev/null
-unsupported configuration: setting ACPI S4 not supported
+++ /dev/null
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-q35 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-q35/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-q35/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=q35,debug-threads=on \
--S \
--object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-q35/master-key.aes \
--machine q35,usb=off,dump-guest-core=off \
--accel tcg \
--m size=1048576k \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--global PIIX4_PM.disable_s3=1 \
--global PIIX4_PM.disable_s4=1 \
--boot strict=on \
--device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device ioh3420,port=8,chassis=3,id=pci.3,bus=pcie.0,addr=0x1 \
--audiodev '{"id":"audio1","driver":"none"}' \
--global ICH9-LPC.noreboot=off \
--watchdog-action reset \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1 \
--msg timestamp=on
+++ /dev/null
-<domain type='qemu'>
- <name>q35</name>
- <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid>
- <memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
- <vcpu placement='static'>1</vcpu>
- <os>
- <type arch='x86_64' machine='q35'>hvm</type>
- <boot dev='network'/>
- </os>
- <pm>
- <suspend-to-mem enabled='no'/>
- <suspend-to-disk enabled='no'/>
- </pm>
- <devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
- </devices>
-</domain>
+++ /dev/null
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-q35 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-q35/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-q35/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=q35,debug-threads=on \
--S \
--object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-q35/master-key.aes \
--machine q35,usb=off,dump-guest-core=off \
--accel tcg \
--m size=1048576k \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--global ICH9-LPC.disable_s3=1 \
--global ICH9-LPC.disable_s4=1 \
--boot strict=on \
--device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device ioh3420,port=8,chassis=3,id=pci.3,bus=pcie.0,addr=0x1 \
--audiodev '{"id":"audio1","driver":"none"}' \
--global ICH9-LPC.noreboot=off \
--watchdog-action reset \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1 \
--msg timestamp=on
+++ /dev/null
-<domain type='qemu'>
- <name>q35</name>
- <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid>
- <memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
- <vcpu placement='static'>1</vcpu>
- <os>
- <type arch='x86_64' machine='q35'>hvm</type>
- <boot dev='network'/>
- </os>
- <pm>
- <suspend-to-mem enabled='no'/>
- <suspend-to-disk enabled='no'/>
- </pm>
- <devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
- </devices>
-</domain>
-rtc base=utc \
-no-shutdown \
-no-acpi \
+-global ICH9-LPC.disable_s3=1 \
+-global ICH9-LPC.disable_s4=0 \
-boot strict=on \
-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x1d \
<type arch='x86_64' machine='q35'>hvm</type>
<boot dev='hd'/>
</os>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='yes'/>
+ </pm>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
DO_TEST_NOCAPS("input-usbmouse");
DO_TEST_NOCAPS("input-usbtablet");
DO_TEST_NOCAPS("misc-acpi");
- DO_TEST("misc-disable-s3", QEMU_CAPS_PIIX_DISABLE_S3);
- DO_TEST("misc-disable-suspends", QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4);
- DO_TEST("misc-enable-s4", QEMU_CAPS_PIIX_DISABLE_S4);
- DO_TEST_PARSE_ERROR_NOCAPS("misc-enable-s4");
+ DO_TEST_NOCAPS("misc-disable-s3");
+ DO_TEST_NOCAPS("misc-disable-suspends");
+ DO_TEST_NOCAPS("misc-enable-s4");
DO_TEST_CAPS_VER("misc-no-reboot", "5.2.0");
DO_TEST_CAPS_LATEST("misc-no-reboot");
DO_TEST_NOCAPS("misc-uuid");
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
QEMU_CAPS_DEVICE_IOH3420);
- DO_TEST("q35-pm-disable",
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4,
- QEMU_CAPS_ICH9_DISABLE_S3, QEMU_CAPS_ICH9_DISABLE_S4);
- DO_TEST("q35-pm-disable-fallback",
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4);
DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable");
DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-enable");
DO_TEST_CAPS_VER_PARSE_ERROR("pc-i440fx-acpi-root-hotplug-disable", "5.1.0");
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='yes'/>
+ </pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='block' device='disk'>