The '-no-shutdown' flag prevents qemu from terminating if a shutdown was
requested. Libvirt will handle the termination of the qemu process
anyways and using this consistently will allow greater flexibility for
the virDomainSetLifecycleAction API as well as will allow using
the 'system-reset' QMP command during startup to reinitiate devices
exported to the firmware.
This efectively partially reverts
0e034efaf9b963760516a65413fd9771034357aa
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
{
virQEMUCaps *qemuCaps = priv->qemuCaps;
- if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
- virCommandAddArg(cmd, "-no-reboot");
- else
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) {
+ /* with new qemu we always want '-no-shutdown' on startup and we set
+ * all the other behaviour later during startup */
virCommandAddArg(cmd, "-no-shutdown");
+ } else {
+ if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
+ virCommandAddArg(cmd, "-no-reboot");
+ else
+ virCommandAddArg(cmd, "-no-shutdown");
+ }
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI)) {
if (def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON)
* domain crashed; otherwise, if the monitor was started,
* then we can blame ourselves, else we failed before the
* monitor started so we don't really know. */
- if (!priv->mon && tryMonReconn && priv->allowReboot == VIR_TRISTATE_BOOL_YES)
+ if (!priv->mon && tryMonReconn &&
+ (priv->allowReboot == VIR_TRISTATE_BOOL_YES ||
+ virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)))
state = VIR_DOMAIN_SHUTOFF_CRASHED;
else if (priv->mon)
state = VIR_DOMAIN_SHUTOFF_DAEMON;
-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
--no-reboot \
+-no-shutdown \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \