278 lines
9.8 KiB
Diff
278 lines
9.8 KiB
Diff
commit f887b0c4913b81c33a7d0a8cce3da09caf88ecbb
|
|
Author: Jim Fehlig <jfehlig@novell.com>
|
|
Date: Thu Sep 22 20:48:07 2011 -0600
|
|
|
|
Revert "qemu: Fix shutdown regression with buggy qemu"
|
|
|
|
This reverts commit f84aedad090da1e05ccc5651815febba013eb3ad.
|
|
|
|
The commit is not needed since the affected SUSE kvm packages
|
|
have the necessary qemu patch
|
|
|
|
http://lists.nongnu.org/archive/html/qemu-devel/2011-09/msg01757.html
|
|
|
|
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
|
index 850d46e..36f47a9 100644
|
|
--- a/src/qemu/qemu_capabilities.c
|
|
+++ b/src/qemu/qemu_capabilities.c
|
|
@@ -136,7 +136,6 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
|
|
"pci-ohci",
|
|
"usb-redir",
|
|
"usb-hub",
|
|
- "no-shutdown",
|
|
);
|
|
|
|
struct qemu_feature_flags {
|
|
@@ -1009,13 +1008,6 @@ qemuCapsComputeCmdFlags(const char *help,
|
|
qemuCapsSet(flags, QEMU_CAPS_VHOST_NET);
|
|
}
|
|
|
|
- /* Do not use -no-shutdown if qemu doesn't support it or SIGTERM handling
|
|
- * is most likely buggy when used with -no-shutdown (which applies for qemu
|
|
- * 0.14.* and 0.15.*)
|
|
- */
|
|
- if (strstr(help, "-no-shutdown") && (version < 14000 || version > 15999))
|
|
- qemuCapsSet(flags, QEMU_CAPS_NO_SHUTDOWN);
|
|
-
|
|
/*
|
|
* Handling of -incoming arg with varying features
|
|
* -incoming tcp (kvm >= 79, qemu >= 0.10.0)
|
|
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
|
index 74d3ab2..96b7a3b 100644
|
|
--- a/src/qemu/qemu_capabilities.h
|
|
+++ b/src/qemu/qemu_capabilities.h
|
|
@@ -110,7 +110,6 @@ enum qemuCapsFlags {
|
|
QEMU_CAPS_PCI_OHCI = 71, /* -device pci-ohci */
|
|
QEMU_CAPS_USB_REDIR = 72, /* -device usb-redir */
|
|
QEMU_CAPS_USB_HUB = 73, /* -device usb-hub */
|
|
- QEMU_CAPS_NO_SHUTDOWN = 74, /* usable -no-shutdown */
|
|
|
|
QEMU_CAPS_LAST, /* this must always be the last item */
|
|
};
|
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
index 0adc56a..ee4b52b 100644
|
|
--- a/src/qemu/qemu_command.c
|
|
+++ b/src/qemu/qemu_command.c
|
|
@@ -3574,7 +3574,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
* when QEMU stops. If we use no-shutdown, then we can
|
|
* watch for this event and do a soft/warm reboot.
|
|
*/
|
|
- if (monitor_json && qemuCapsGet(qemuCaps, QEMU_CAPS_NO_SHUTDOWN))
|
|
+ if (monitor_json)
|
|
virCommandAddArg(cmd, "-no-shutdown");
|
|
|
|
if (!(def->features & (1 << VIR_DOMAIN_FEATURE_ACPI)))
|
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
index 0d0bea2..f87af06 100644
|
|
--- a/src/qemu/qemu_driver.c
|
|
+++ b/src/qemu/qemu_driver.c
|
|
@@ -1556,12 +1556,6 @@ static int qemuDomainReboot(virDomainPtr dom, unsigned int flags) {
|
|
priv = vm->privateData;
|
|
|
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
|
|
- if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) {
|
|
- qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
- _("Reboot is not supported with this QEMU binary"));
|
|
- goto cleanup;
|
|
- }
|
|
-
|
|
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
|
goto cleanup;
|
|
|
|
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
|
|
index 933d556..f0b0879 100644
|
|
--- a/tests/qemuhelptest.c
|
|
+++ b/tests/qemuhelptest.c
|
|
@@ -152,8 +152,7 @@ mymain(void)
|
|
QEMU_CAPS_KVM,
|
|
QEMU_CAPS_DRIVE_FORMAT,
|
|
QEMU_CAPS_MEM_PATH,
|
|
- QEMU_CAPS_TDF,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_TDF);
|
|
DO_TEST("kvm-83-rhel56", 9001, 1, 83,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -178,8 +177,7 @@ mymain(void)
|
|
QEMU_CAPS_TDF,
|
|
QEMU_CAPS_DRIVE_READONLY,
|
|
QEMU_CAPS_SMBIOS_TYPE,
|
|
- QEMU_CAPS_SPICE,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_SPICE);
|
|
DO_TEST("qemu-0.10.5", 10005, 0, 0,
|
|
QEMU_CAPS_KQEMU,
|
|
QEMU_CAPS_VNC_COLON,
|
|
@@ -198,8 +196,7 @@ mymain(void)
|
|
QEMU_CAPS_SDL,
|
|
QEMU_CAPS_RTC_TD_HACK,
|
|
QEMU_CAPS_NO_HPET,
|
|
- QEMU_CAPS_VGA_NONE,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_VGA_NONE);
|
|
DO_TEST("qemu-kvm-0.10.5", 10005, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -224,8 +221,7 @@ mymain(void)
|
|
QEMU_CAPS_NO_KVM_PIT,
|
|
QEMU_CAPS_TDF,
|
|
QEMU_CAPS_NESTING,
|
|
- QEMU_CAPS_VGA_NONE,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_VGA_NONE);
|
|
DO_TEST("kvm-86", 10050, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -250,8 +246,7 @@ mymain(void)
|
|
QEMU_CAPS_TDF,
|
|
QEMU_CAPS_NESTING,
|
|
QEMU_CAPS_SMBIOS_TYPE,
|
|
- QEMU_CAPS_VGA_NONE,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_VGA_NONE);
|
|
DO_TEST("qemu-kvm-0.11.0-rc2", 10092, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -281,8 +276,7 @@ mymain(void)
|
|
QEMU_CAPS_NESTING,
|
|
QEMU_CAPS_NAME_PROCESS,
|
|
QEMU_CAPS_SMBIOS_TYPE,
|
|
- QEMU_CAPS_VGA_NONE,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_VGA_NONE);
|
|
DO_TEST("qemu-0.12.1", 12001, 0, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -312,8 +306,7 @@ mymain(void)
|
|
QEMU_CAPS_SMBIOS_TYPE,
|
|
QEMU_CAPS_VGA_NONE,
|
|
QEMU_CAPS_MIGRATE_QEMU_FD,
|
|
- QEMU_CAPS_DRIVE_AIO,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_DRIVE_AIO);
|
|
DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -357,8 +350,7 @@ mymain(void)
|
|
QEMU_CAPS_DEVICE_SPICEVMC,
|
|
QEMU_CAPS_PIIX3_USB_UHCI,
|
|
QEMU_CAPS_PIIX4_USB_UHCI,
|
|
- QEMU_CAPS_USB_HUB,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_USB_HUB);
|
|
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -395,8 +387,7 @@ mymain(void)
|
|
QEMU_CAPS_SMBIOS_TYPE,
|
|
QEMU_CAPS_VGA_NONE,
|
|
QEMU_CAPS_MIGRATE_QEMU_FD,
|
|
- QEMU_CAPS_DRIVE_AIO,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_DRIVE_AIO);
|
|
DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -448,8 +439,7 @@ mymain(void)
|
|
QEMU_CAPS_PIIX4_USB_UHCI,
|
|
QEMU_CAPS_VT82C686B_USB_UHCI,
|
|
QEMU_CAPS_PCI_OHCI,
|
|
- QEMU_CAPS_USB_HUB,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_USB_HUB);
|
|
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
|
|
QEMU_CAPS_VNC_COLON,
|
|
QEMU_CAPS_NO_REBOOT,
|
|
@@ -497,8 +487,7 @@ mymain(void)
|
|
QEMU_CAPS_VIRTIO_IOEVENTFD,
|
|
QEMU_CAPS_PIIX3_USB_UHCI,
|
|
QEMU_CAPS_PIIX4_USB_UHCI,
|
|
- QEMU_CAPS_USB_HUB,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
+ QEMU_CAPS_USB_HUB);
|
|
|
|
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
}
|
|
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args b/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
|
|
index e04cdec..8d8e43e 100644
|
|
--- a/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
|
|
+++ b/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
|
|
@@ -1,5 +1,5 @@
|
|
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
|
|
pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,\
|
|
id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,\
|
|
-id=monitor,mode=control -no-acpi -boot c -hda /dev/hda1 -usb -device \
|
|
+id=monitor,mode=control -no-shutdown -no-acpi -boot c -hda /dev/hda1 -usb -device \
|
|
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args b/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args
|
|
deleted file mode 100644
|
|
index 1464d09..0000000
|
|
--- a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args
|
|
+++ /dev/null
|
|
@@ -1,21 +0,0 @@
|
|
-LC_ALL=C \
|
|
-PATH=/bin \
|
|
-HOME=/home/test \
|
|
-USER=test \
|
|
-LOGNAME=test \
|
|
-/usr/bin/qemu \
|
|
--S \
|
|
--M pc \
|
|
--m 214 \
|
|
--smp 1 \
|
|
--nographic \
|
|
--nodefconfig \
|
|
--nodefaults \
|
|
--chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
|
|
--mon chardev=charmonitor,id=monitor,mode=control \
|
|
--no-shutdown \
|
|
--no-acpi \
|
|
--boot c \
|
|
--hda /dev/hda1 \
|
|
--usb \
|
|
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml b/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml
|
|
deleted file mode 100644
|
|
index 1901715..0000000
|
|
--- a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml
|
|
+++ /dev/null
|
|
@@ -1,24 +0,0 @@
|
|
-<domain type='qemu'>
|
|
- <name>encryptdisk</name>
|
|
- <uuid>496898a6-e6ff-f7c8-5dc2-3cf410945ee9</uuid>
|
|
- <memory>219100</memory>
|
|
- <currentMemory>219100</currentMemory>
|
|
- <vcpu>1</vcpu>
|
|
- <os>
|
|
- <type arch='i686' machine='pc'>hvm</type>
|
|
- <boot dev='hd'/>
|
|
- </os>
|
|
- <clock offset='utc'/>
|
|
- <on_poweroff>destroy</on_poweroff>
|
|
- <on_reboot>restart</on_reboot>
|
|
- <on_crash>destroy</on_crash>
|
|
- <devices>
|
|
- <emulator>/usr/bin/qemu</emulator>
|
|
- <disk type='file' device='disk'>
|
|
- <driver name='qemu' type='qcow2'/>
|
|
- <source file='/dev/hda1'/>
|
|
- <target dev='hda'/>
|
|
- </disk>
|
|
- <memballoon model='virtio'/>
|
|
- </devices>
|
|
-</domain>
|
|
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
|
index 1dc6a01..fcb20bb 100644
|
|
--- a/tests/qemuxml2argvtest.c
|
|
+++ b/tests/qemuxml2argvtest.c
|
|
@@ -578,9 +578,6 @@ mymain(void)
|
|
json = true;
|
|
DO_TEST("monitor-json", false, QEMU_CAPS_DEVICE,
|
|
QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG);
|
|
- DO_TEST("no-shutdown", false, QEMU_CAPS_DEVICE,
|
|
- QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG,
|
|
- QEMU_CAPS_NO_SHUTDOWN);
|
|
json = false;
|
|
|
|
free(driver.stateDir);
|