提交 f7ee3411 编写于 作者: D Daniel P. Berrange

qemu: assume -no-reboot is always available

The -no-reboot arg was added in QEMU 0.9.0, so the QEMU driver
can now assume it is always present.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 932534e8
......@@ -1093,8 +1093,6 @@ virQEMUCapsComputeCmdFlags(const char *help,
virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM);
if (strstr(help, "-enable-kvm"))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_KVM);
if (strstr(help, "-no-reboot"))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_REBOOT);
if (strstr(help, "-name")) {
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NAME);
if (strstr(help, ",process="))
......@@ -3216,7 +3214,6 @@ static qemuMonitorCallbacks callbacks = {
static void
virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
{
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_REBOOT);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NAME);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_UUID);
......
......@@ -48,7 +48,7 @@ typedef enum {
/* 0 */
X_QEMU_CAPS_KQEMU, /* Whether KQEMU is compiled in */
X_QEMU_CAPS_VNC_COLON, /* VNC takes or address + display */
QEMU_CAPS_NO_REBOOT, /* Is the -no-reboot flag available */
X_QEMU_CAPS_NO_REBOOT, /* Is the -no-reboot flag available */
QEMU_CAPS_DRIVE, /* Is the new -drive arg available */
QEMU_CAPS_DRIVE_BOOT, /* Does -drive support boot=on */
......
......@@ -9774,15 +9774,13 @@ qemuBuildCommandLine(virConnectPtr conn,
}
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_REBOOT)) {
/* Only add -no-reboot option if each event destroys domain */
if (def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY &&
def->onPoweroff == VIR_DOMAIN_LIFECYCLE_DESTROY &&
(def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY ||
def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY)) {
allowReboot = false;
virCommandAddArg(cmd, "-no-reboot");
}
/* Only add -no-reboot option if each event destroys domain */
if (def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY &&
def->onPoweroff == VIR_DOMAIN_LIFECYCLE_DESTROY &&
(def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY ||
def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY)) {
allowReboot = false;
virCommandAddArg(cmd, "-no-reboot");
}
/* If JSON monitor is enabled, we can receive an event
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
<qemuCaps>
<flag name='no-reboot'/>
<flag name='drive'/>
<flag name='name'/>
<flag name='uuid'/>
......
......@@ -152,7 +152,6 @@ mymain(void)
DO_TEST_FULL(name, version, is_kvm, kvm_version, VIR_ERR_OK, __VA_ARGS__)
DO_TEST("qemu-0.12.1", 12001, 0, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
......@@ -187,7 +186,6 @@ mymain(void)
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_VNC);
DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
......@@ -249,7 +247,6 @@ mymain(void)
QEMU_CAPS_DEVICE_E1000,
QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
......@@ -291,7 +288,6 @@ mymain(void)
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_VNC);
DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
......@@ -365,7 +361,6 @@ mymain(void)
QEMU_CAPS_DEVICE_E1000,
QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
......@@ -434,7 +429,6 @@ mymain(void)
QEMU_CAPS_DEVICE_E1000,
QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
......@@ -511,7 +505,6 @@ mymain(void)
QEMU_CAPS_DEVICE_E1000,
QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
......@@ -603,7 +596,6 @@ mymain(void)
QEMU_CAPS_DEVICE_E1000,
QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
......
......@@ -292,7 +292,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
monitor_chr.data.nix.listen = true;
virQEMUCapsSetList(extraFlags,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
......
......@@ -114,7 +114,6 @@ static const char testStatusXMLPrefix[] =
" <vcpu pid='3803519'/>\n"
" </vcpus>\n"
" <qemuCaps>\n"
" <flag name='no-reboot'/>\n"
" <flag name='drive'/>\n"
" <flag name='name'/>\n"
" <flag name='uuid'/>\n"
......
......@@ -86,7 +86,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
goto fail;
virQEMUCapsSetList(extraFlags,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册