[PATCH v2 05/17] qemu: assume -no-reboot is always available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c                       |  3 ---
 src/qemu/qemu_capabilities.h                       |  2 +-
 src/qemu/qemu_command.c                            | 16 +++++++---------
 tests/qemucapabilitiesdata/caps_1.2.2-1.caps       |  1 -
 tests/qemucapabilitiesdata/caps_1.3.1-1.caps       |  1 -
 tests/qemucapabilitiesdata/caps_1.4.2-1.caps       |  1 -
 tests/qemucapabilitiesdata/caps_1.5.3-1.caps       |  1 -
 tests/qemucapabilitiesdata/caps_1.6.0-1.caps       |  1 -
 tests/qemucapabilitiesdata/caps_1.6.50-1.caps      |  1 -
 tests/qemucapabilitiesdata/caps_2.1.1-1.caps       |  1 -
 tests/qemucaps2xmldata/all_1.6.0-1.caps            |  1 -
 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps |  1 -
 tests/qemuhelptest.c                               |  8 --------
 tests/qemuxml2argvtest.c                           |  1 -
 tests/qemuxml2xmltest.c                            |  1 -
 tests/qemuxmlnstest.c                              |  1 -
 16 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 55c310c..79d1692 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -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);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index af30759..5b241b4 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -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 */
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 25c7b78..15904a2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
index 743951b..24a03e2 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
index a3e9b4a..88b8dbc 100644
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
index e1c0354..635f2c6 100644
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
index 1ba18d6..5eb73c8 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
index 738cbae..6f84a40 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
index 1c01523..55ae85f 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
index 3bf0e6c..1fa1d20 100644
--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps
index 7a16aa7..8d55141 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
index 74399fc..d091776 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='no-reboot'/>
     <flag name='drive'/>
     <flag name='name'/>
     <flag name='uuid'/>
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 91be08d..4edf6ec 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -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,
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9c92eff..3842bc6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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);
 
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2583e67..ab72e7d 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -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"
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
index 3e1b4aa..4d83f7a 100644
--- a/tests/qemuxmlnstest.c
+++ b/tests/qemuxmlnstest.c
@@ -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);
 
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]