[PATCH] qemu: add support for -device pvpanic

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

 



qemu removes the builtin pvpanic device for all qemu versions since 1.7,
in order to support <on_crash>, '-device pvpanic' has to be added to
qemu command line.

Signed-off-by: Hu Tao <hutao@xxxxxxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 8 ++++++++
 src/qemu/qemu_capabilities.h | 2 ++
 src/qemu/qemu_command.c      | 4 ++++
 3 files changed, 14 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 548b988..7783997 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -243,6 +243,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "virtio-mmio",
               "ich9-intel-hda",
               "kvm-pit-lost-tick-policy",
+
+              "pvpanic", /* 160 */
     );
 
 struct _virQEMUCaps {
@@ -1198,6 +1200,9 @@ virQEMUCapsComputeCmdFlags(const char *help,
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNC_SHARE_POLICY);
     }
 
+    if (version >= 1005000)
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_PVPANIC);
+
     return 0;
 }
 
@@ -2561,6 +2566,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
     if (qemuCaps->version >= 1006000)
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
 
+    if (qemuCaps->version >= 1005000)
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_PVPANIC);
+
     if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
         goto cleanup;
     if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 02d47c6..06d2fac 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -199,6 +199,8 @@ enum virQEMUCapsFlags {
     QEMU_CAPS_DEVICE_ICH9_INTEL_HDA = 158, /* -device ich9-intel-hda */
     QEMU_CAPS_KVM_PIT_TICK_POLICY = 159, /* kvm-pit.lost_tick_policy */
 
+    QEMU_CAPS_PVPANIC            = 160, /* -device pvpanic */
+
     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 763417f..b1307a3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9588,6 +9588,10 @@ qemuBuildCommandLine(virConnectPtr conn,
         goto error;
     }
 
+    if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PVPANIC)) {
+        virCommandAddArgList(cmd, "-device", "pvpanic", NULL);
+    }
+
     if (mlock) {
         unsigned long long memKB;
 
-- 
1.8.3.1

--
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]