[PATCH 4/5] qemu: Implement virConnectCrash

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

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4aa1625..4b394db 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20131,6 +20131,34 @@ static int qemuDomainRename(virDomainPtr dom,
     return ret;
 }
 
+static int qemuConnectCrash(virConnectPtr conn,
+                            int side,
+                            int mode,
+                            unsigned int flags)
+{
+    virCheckFlags(0, -1);
+
+    if (virConnectCrashEnsureACL(conn) < 0)
+        return -1;
+
+    if (side != VIR_CONNECT_CRASH_SERVER) {
+        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                       _("Only server crashing is supported"));
+        return -1;
+    }
+
+    if (mode != VIR_CONNECT_CRASH_WRITE_RO &&
+        mode != VIR_CONNECT_CRASH_NULL_DEREF &&
+        mode != VIR_CONNECT_CRASH_STACK_OVERFLOW) {
+        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                       _("Invalid mode for crash"));
+        return -1;
+    }
+
+    return virCrash(mode);
+}
+
+
 static virHypervisorDriver qemuHypervisorDriver = {
     .name = QEMU_DRIVER_NAME,
     .connectOpen = qemuConnectOpen, /* 0.2.0 */
@@ -20342,6 +20370,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
     .domainSetUserPassword = qemuDomainSetUserPassword, /* 1.2.16 */
     .domainRename = qemuDomainRename, /* 1.2.19 */
     .domainMigrateStartPostCopy = qemuDomainMigrateStartPostCopy, /* 1.3.3 */
+    .connectCrash = qemuConnectCrash, /* 1.3.3 */
 };
 
 
-- 
2.7.3

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