From: Peter Krempa Date: Tue, 20 Jul 2021 08:05:06 +0000 (+0200) Subject: qemu: Remove return value from qemuMonitorDomainMemoryFailureCallback X-Git-Tag: v7.6.0-rc1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59ba742cbc09a0661eb2d33b9e6da06fcc1ae6a0;p=thirdparty%2Flibvirt.git qemu: Remove return value from qemuMonitorDomainMemoryFailureCallback 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index c474668c9c..1491c1297c 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 778ee55c11..2e2a9498f0 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; }