[PATCH 32/33] qemu: Remove return value from qemuMonitorDomainMemoryFailureCallback

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

 



Change the callback prototype and fix the callback registered in the
process code.

The removed error messages are impossible as the enum values are
converted via VIR_ENUM helpers and guarded by compiler checks.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.h |  8 ++++----
 src/qemu/qemu_process.c | 12 +++---------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index c3a463aa51..4c5ba95dd8 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -356,10 +356,10 @@ struct _qemuMonitorEventMemoryFailure {
     bool recursive;
 };

-typedef int (*qemuMonitorDomainMemoryFailureCallback)(qemuMonitor *mon,
-                                                      virDomainObj *vm,
-                                                      qemuMonitorEventMemoryFailure *mfp,
-                                                      void *opaque);
+typedef void (*qemuMonitorDomainMemoryFailureCallback)(qemuMonitor *mon,
+                                                       virDomainObj *vm,
+                                                       qemuMonitorEventMemoryFailure *mfp,
+                                                       void *opaque);

 typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
 struct _qemuMonitorCallbacks {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index eee65a71b2..1bdfbce697 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1815,7 +1815,7 @@ qemuProcessHandleGuestCrashloaded(qemuMonitor *mon G_GNUC_UNUSED,
 }


-static int
+static void
 qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
                                qemuMonitorEventMemoryFailure *mfp,
@@ -1836,9 +1836,7 @@ qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED,
         break;
     case QEMU_MONITOR_MEMORY_FAILURE_RECIPIENT_LAST:
     default:
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("requested unknown memory failure recipient"));
-        return -1;
+        return;
     }

     switch (mfp->action) {
@@ -1856,9 +1854,7 @@ qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED,
         break;
     case QEMU_MONITOR_MEMORY_FAILURE_ACTION_LAST:
     default:
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("requested unknown memory failure action"));
-        return -1;
+        return;
     }

     if (mfp->action_required)
@@ -1868,8 +1864,6 @@ qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED,

     event = virDomainEventMemoryFailureNewFromObj(vm, recipient, action, flags);
     virObjectEventStateQueue(driver->domainEventState, event);
-
-    return 0;
 }


-- 
2.31.1




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

  Powered by Linux