From 3b63871f2c993b3fa9973eb40419396dbd0e9091 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 20 Jul 2021 10:05:06 +0200 Subject: [PATCH] qemu: Remove return value from qemuMonitorDomainPRManagerStatusChangedCallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the callback prototype and fix the callback registered in the process code. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_monitor.h | 10 +++++----- src/qemu/qemu_process.c | 13 ++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 1de39e81eb..45396c7908 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -310,11 +310,11 @@ typedef void (*qemuMonitorDomainDumpCompletedCallback)(qemuMonitor *mon, const char *error, void *opaque); -typedef int (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitor *mon, - virDomainObj *vm, - const char *prManager, - bool connected, - void *opaque); +typedef void (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitor *mon, + virDomainObj *vm, + const char *prManager, + bool connected, + void *opaque); typedef int (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitor *mon, virDomainObj *vm, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e4a025e35..af6355c653 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1703,7 +1703,7 @@ qemuProcessHandleDumpCompleted(qemuMonitor *mon G_GNUC_UNUSED, } -static int +static void qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon G_GNUC_UNUSED, virDomainObj *vm, const char *prManager, @@ -1714,24 +1714,21 @@ qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon G_GNUC_UNUSED, qemuDomainObjPrivate *priv; struct qemuProcessEvent *processEvent = NULL; const char *managedAlias = qemuDomainGetManagedPRAlias(); - int ret = -1; virObjectLock(vm); VIR_DEBUG("pr-manager %s status changed for domain %p %s connected=%d", prManager, vm, vm->def->name, connected); - if (connected) { - /* Connect events are boring. */ - ret = 0; + /* Connect events are boring. */ + if (connected) goto cleanup; - } + /* Disconnect events are more interesting. */ if (STRNEQ(prManager, managedAlias)) { VIR_DEBUG("pr-manager %s not managed, ignoring event", prManager); - ret = 0; goto cleanup; } @@ -1749,10 +1746,8 @@ qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon G_GNUC_UNUSED, goto cleanup; } - ret = 0; cleanup: virObjectUnlock(vm); - return ret; }