[libvirt PATCH 6/6] qemu: Do not pass unused opaque pointer to monitor callbacks

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.c      |  16 ++---
 src/qemu/qemu_monitor.h      | 108 ++++++++++++----------------------
 src/qemu/qemu_monitor_priv.h |   1 -
 src/qemu/qemu_process.c      | 110 ++++++++++++-----------------------
 src/qemu/qemu_processpriv.h  |   3 +-
 tests/qemuhotplugtest.c      |   3 +-
 tests/qemumonitortestutils.c |  15 ++---
 tests/qemumonitortestutils.h |   5 +-
 8 files changed, 88 insertions(+), 173 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index d44c7f0c60..2cfe9dbb00 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -578,7 +578,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED,
         virObjectUnlock(mon);
         VIR_DEBUG("Triggering EOF callback mon=%p vm=%p name=%s",
                   mon, mon->vm, mon->domainName);
-        (eofNotify)(mon, vm, mon->callbackOpaque);
+        (eofNotify)(mon, vm);
         virObjectUnref(mon);
     } else if (error) {
         qemuMonitorErrorNotifyCallback errorNotify = mon->cb->errorNotify;
@@ -589,7 +589,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED,
         virObjectUnlock(mon);
         VIR_DEBUG("Triggering error callback mon=%p vm=%p name=%s",
                   mon, mon->vm, mon->domainName);
-        (errorNotify)(mon, vm, mon->callbackOpaque);
+        (errorNotify)(mon, vm);
         virObjectUnref(mon);
     } else {
         virObjectUnlock(mon);
@@ -604,8 +604,7 @@ static qemuMonitor *
 qemuMonitorOpenInternal(virDomainObj *vm,
                         int fd,
                         GMainContext *context,
-                        qemuMonitorCallbacks *cb,
-                        void *opaque)
+                        qemuMonitorCallbacks *cb)
 {
     qemuDomainObjPrivate *priv = vm->privateData;
     qemuMonitor *mon;
@@ -639,7 +638,6 @@ qemuMonitorOpenInternal(virDomainObj *vm,
     mon->domainName = g_strdup(NULLSTR(vm->def->name));
     mon->waitGreeting = true;
     mon->cb = cb;
-    mon->callbackOpaque = opaque;
 
     if (priv)
         mon->objectAddNoWrap = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_JSON);
@@ -688,7 +686,6 @@ qemuMonitorOpenInternal(virDomainObj *vm,
  * @config: monitor configuration
  * @timeout: number of seconds to add to default timeout
  * @cb: monitor event handles
- * @opaque: opaque data for @cb
  *
  * Opens the monitor for running qemu. It may happen that it
  * takes some time for qemu to create the monitor socket (e.g.
@@ -704,8 +701,7 @@ qemuMonitorOpen(virDomainObj *vm,
                 bool retry,
                 unsigned long long timeout,
                 GMainContext *context,
-                qemuMonitorCallbacks *cb,
-                void *opaque)
+                qemuMonitorCallbacks *cb)
 {
     VIR_AUTOCLOSE fd = -1;
     qemuMonitor *ret = NULL;
@@ -733,7 +729,7 @@ qemuMonitorOpen(virDomainObj *vm,
         return NULL;
     }
 
-    ret = qemuMonitorOpenInternal(vm, fd, context, cb, opaque);
+    ret = qemuMonitorOpenInternal(vm, fd, context, cb);
     fd = -1;
     return ret;
 }
@@ -1085,7 +1081,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitor *mon,
         virObjectRef(mon); \
         virObjectUnlock(mon); \
         if ((mon)->cb && (mon)->cb->callback) \
-            (mon)->cb->callback(mon, __VA_ARGS__, (mon)->callbackOpaque); \
+            (mon)->cb->callback(mon, __VA_ARGS__); \
         virObjectLock(mon); \
         virObjectUnref(mon); \
     } while (0)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index b1484fdff8..be341d5196 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -180,49 +180,38 @@ void qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatus *info);
 void qemuMonitorMemoryDeviceSizeChangeFree(qemuMonitorMemoryDeviceSizeChange *info);
 
 typedef void (*qemuMonitorDestroyCallback)(qemuMonitor *mon,
-                                           virDomainObj *vm,
-                                           void *opaque);
+                                           virDomainObj *vm);
 typedef void (*qemuMonitorEofNotifyCallback)(qemuMonitor *mon,
-                                             virDomainObj *vm,
-                                             void *opaque);
+                                             virDomainObj *vm);
 typedef void (*qemuMonitorErrorNotifyCallback)(qemuMonitor *mon,
-                                               virDomainObj *vm,
-                                               void *opaque);
+                                               virDomainObj *vm);
 typedef void (*qemuMonitorDomainEventCallback)(qemuMonitor *mon,
                                                virDomainObj *vm,
                                                const char *event,
                                                long long seconds,
                                                unsigned int micros,
-                                               const char *details,
-                                               void *opaque);
+                                               const char *details);
 typedef void (*qemuMonitorDomainShutdownCallback)(qemuMonitor *mon,
                                                   virDomainObj *vm,
-                                                  virTristateBool guest,
-                                                  void *opaque);
+                                                  virTristateBool guest);
 typedef void (*qemuMonitorDomainResetCallback)(qemuMonitor *mon,
-                                               virDomainObj *vm,
-                                               void *opaque);
+                                               virDomainObj *vm);
 typedef void (*qemuMonitorDomainStopCallback)(qemuMonitor *mon,
-                                              virDomainObj *vm,
-                                              void *opaque);
+                                              virDomainObj *vm);
 typedef void (*qemuMonitorDomainResumeCallback)(qemuMonitor *mon,
-                                                virDomainObj *vm,
-                                                void *opaque);
+                                                virDomainObj *vm);
 typedef void (*qemuMonitorDomainRTCChangeCallback)(qemuMonitor *mon,
                                                    virDomainObj *vm,
-                                                   long long offset,
-                                                   void *opaque);
+                                                   long long offset);
 typedef void (*qemuMonitorDomainWatchdogCallback)(qemuMonitor *mon,
                                                   virDomainObj *vm,
-                                                  int action,
-                                                  void *opaque);
+                                                  int action);
 typedef void (*qemuMonitorDomainIOErrorCallback)(qemuMonitor *mon,
                                                  virDomainObj *vm,
                                                  const char *diskAlias,
                                                  const char *nodename,
                                                  int action,
-                                                 const char *reason,
-                                                 void *opaque);
+                                                 const char *reason);
 typedef void (*qemuMonitorDomainGraphicsCallback)(qemuMonitor *mon,
                                                   virDomainObj *vm,
                                                   int phase,
@@ -234,76 +223,60 @@ typedef void (*qemuMonitorDomainGraphicsCallback)(qemuMonitor *mon,
                                                   const char *remoteService,
                                                   const char *authScheme,
                                                   const char *x509dname,
-                                                  const char *saslUsername,
-                                                  void *opaque);
+                                                  const char *saslUsername);
 typedef void (*qemuMonitorDomainBlockJobCallback)(qemuMonitor *mon,
                                                   virDomainObj *vm,
                                                   const char *diskAlias,
                                                   int type,
                                                   int status,
-                                                  const char *error,
-                                                  void *opaque);
+                                                  const char *error);
 typedef void (*qemuMonitorDomainJobStatusChangeCallback)(qemuMonitor *mon,
                                                          virDomainObj *vm,
                                                          const char *jobname,
-                                                         int status,
-                                                         void *opaque);
+                                                         int status);
 typedef void (*qemuMonitorDomainTrayChangeCallback)(qemuMonitor *mon,
                                                     virDomainObj *vm,
                                                     const char *devAlias,
                                                     const char *devid,
-                                                    int reason,
-                                                    void *opaque);
+                                                    int reason);
 typedef void (*qemuMonitorDomainPMWakeupCallback)(qemuMonitor *mon,
-                                                  virDomainObj *vm,
-                                                  void *opaque);
+                                                  virDomainObj *vm);
 typedef void (*qemuMonitorDomainPMSuspendCallback)(qemuMonitor *mon,
-                                                   virDomainObj *vm,
-                                                   void *opaque);
+                                                   virDomainObj *vm);
 typedef void (*qemuMonitorDomainBalloonChangeCallback)(qemuMonitor *mon,
                                                        virDomainObj *vm,
-                                                       unsigned long long actual,
-                                                       void *opaque);
+                                                       unsigned long long actual);
 typedef void (*qemuMonitorDomainPMSuspendDiskCallback)(qemuMonitor *mon,
-                                                       virDomainObj *vm,
-                                                       void *opaque);
+                                                       virDomainObj *vm);
 typedef void (*qemuMonitorDomainGuestPanicCallback)(qemuMonitor *mon,
                                                     virDomainObj *vm,
-                                                    qemuMonitorEventPanicInfo *info,
-                                                    void *opaque);
+                                                    qemuMonitorEventPanicInfo *info);
 typedef void (*qemuMonitorDomainDeviceDeletedCallback)(qemuMonitor *mon,
                                                        virDomainObj *vm,
-                                                       const char *devAlias,
-                                                       void *opaque);
+                                                       const char *devAlias);
 typedef void (*qemuMonitorDomainDeviceUnplugErrCallback)(qemuMonitor *mon,
                                                          virDomainObj *vm,
                                                          const char *devPath,
-                                                         const char *devAlias,
-                                                         void *opaque);
+                                                         const char *devAlias);
 typedef void (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitor *mon,
                                                             virDomainObj *vm,
-                                                            const char *devAlias,
-                                                            void *opaque);
+                                                            const char *devAlias);
 
 typedef void (*qemuMonitorDomainSerialChangeCallback)(qemuMonitor *mon,
                                                       virDomainObj *vm,
                                                       const char *devAlias,
-                                                      bool connected,
-                                                      void *opaque);
+                                                      bool connected);
 
 typedef void (*qemuMonitorDomainSpiceMigratedCallback)(qemuMonitor *mon,
-                                                       virDomainObj *vm,
-                                                       void *opaque);
+                                                       virDomainObj *vm);
 
 typedef void (*qemuMonitorDomainMigrationStatusCallback)(qemuMonitor *mon,
                                                          virDomainObj *vm,
-                                                         int status,
-                                                         void *opaque);
+                                                         int status);
 
 typedef void (*qemuMonitorDomainMigrationPassCallback)(qemuMonitor *mon,
                                                        virDomainObj *vm,
-                                                       int pass,
-                                                       void *opaque);
+                                                       int pass);
 
 typedef void (*qemuMonitorDomainAcpiOstInfoCallback)(qemuMonitor *mon,
                                                      virDomainObj *vm,
@@ -311,16 +284,14 @@ typedef void (*qemuMonitorDomainAcpiOstInfoCallback)(qemuMonitor *mon,
                                                      const char *slotType,
                                                      const char *slot,
                                                      unsigned int source,
-                                                     unsigned int status,
-                                                     void *opaque);
+                                                     unsigned int status);
 
 
 typedef void (*qemuMonitorDomainBlockThresholdCallback)(qemuMonitor *mon,
                                                         virDomainObj *vm,
                                                         const char *nodename,
                                                         unsigned long long threshold,
-                                                        unsigned long long excess,
-                                                        void *opaque);
+                                                        unsigned long long excess);
 
 
 typedef enum {
@@ -345,26 +316,22 @@ typedef void (*qemuMonitorDomainDumpCompletedCallback)(qemuMonitor *mon,
                                                        virDomainObj *vm,
                                                        int status,
                                                        qemuMonitorDumpStats *stats,
-                                                       const char *error,
-                                                       void *opaque);
+                                                       const char *error);
 
 typedef void (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitor *mon,
                                                                 virDomainObj *vm,
                                                                 const char *prManager,
-                                                                bool connected,
-                                                                void *opaque);
+                                                                bool connected);
 
 typedef void (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitor *mon,
                                                               virDomainObj *vm,
                                                               const char *netdev,
                                                               bool gid_status,
                                                               unsigned long long subnet_prefix,
-                                                              unsigned long long interface_id,
-                                                              void *opaque);
+                                                              unsigned long long interface_id);
 
 typedef void (*qemuMonitorDomainGuestCrashloadedCallback)(qemuMonitor *mon,
-                                                          virDomainObj *vm,
-                                                          void *opaque);
+                                                          virDomainObj *vm);
 
 typedef enum {
     QEMU_MONITOR_MEMORY_FAILURE_RECIPIENT_HYPERVISOR,
@@ -396,14 +363,12 @@ struct _qemuMonitorEventMemoryFailure {
 
 typedef void (*qemuMonitorDomainMemoryFailureCallback)(qemuMonitor *mon,
                                                        virDomainObj *vm,
-                                                       qemuMonitorEventMemoryFailure *mfp,
-                                                       void *opaque);
+                                                       qemuMonitorEventMemoryFailure *mfp);
 
 typedef void (*qemuMonitorDomainMemoryDeviceSizeChange)(qemuMonitor *mon,
                                                         virDomainObj *vm,
                                                         const char *alias,
-                                                        unsigned long long size,
-                                                        void *opaque);
+                                                        unsigned long long size);
 
 typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
 struct _qemuMonitorCallbacks {
@@ -448,8 +413,7 @@ qemuMonitor *qemuMonitorOpen(virDomainObj *vm,
                                bool retry,
                                unsigned long long timeout,
                                GMainContext *context,
-                               qemuMonitorCallbacks *cb,
-                               void *opaque)
+                               qemuMonitorCallbacks *cb)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
 
 void qemuMonitorWatchDispose(void);
diff --git a/src/qemu/qemu_monitor_priv.h b/src/qemu/qemu_monitor_priv.h
index 70f5f16e72..05ac5499bb 100644
--- a/src/qemu/qemu_monitor_priv.h
+++ b/src/qemu/qemu_monitor_priv.h
@@ -57,7 +57,6 @@ struct _qemuMonitor {
     char *domainName;
 
     qemuMonitorCallbacks *cb;
-    void *callbackOpaque;
 
     /* If there's a command being processed this will be
      * non-NULL */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 11d1a4176a..07acb1c427 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -304,8 +304,7 @@ qemuProcessEventSubmit(virDomainObj *vm,
  */
 static void
 qemuProcessHandleMonitorEOF(qemuMonitor *mon,
-                            virDomainObj *vm,
-                            void *opaque G_GNUC_UNUSED)
+                            virDomainObj *vm)
 {
     qemuDomainObjPrivate *priv;
 
@@ -346,8 +345,7 @@ qemuProcessHandleMonitorEOF(qemuMonitor *mon,
  */
 static void
 qemuProcessHandleMonitorError(qemuMonitor *mon G_GNUC_UNUSED,
-                              virDomainObj *vm,
-                              void *opaque G_GNUC_UNUSED)
+                              virDomainObj *vm)
 {
     qemuDomainObjPrivate *priv;
     virObjectEvent *event = NULL;
@@ -408,8 +406,7 @@ qemuProcessFindDomainDiskByAliasOrQOM(virDomainObj *vm,
 
 static void
 qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
-                       virDomainObj *vm,
-                       void *opaque G_GNUC_UNUSED)
+                       virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -542,8 +539,7 @@ qemuProcessHandleEvent(qemuMonitor *mon G_GNUC_UNUSED,
                        const char *eventName,
                        long long seconds,
                        unsigned int micros,
-                       const char *details,
-                       void *opaque G_GNUC_UNUSED)
+                       const char *details)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -564,8 +560,7 @@ qemuProcessHandleEvent(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED,
                           virDomainObj *vm,
-                          virTristateBool guest_initiated,
-                          void *opaque G_GNUC_UNUSED)
+                          virTristateBool guest_initiated)
 {
     virQEMUDriver *driver;
     qemuDomainObjPrivate *priv;
@@ -636,8 +631,7 @@ qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandleStop(qemuMonitor *mon G_GNUC_UNUSED,
-                      virDomainObj *vm,
-                      void *opaque G_GNUC_UNUSED)
+                      virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -694,8 +688,7 @@ qemuProcessHandleStop(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandleResume(qemuMonitor *mon G_GNUC_UNUSED,
-                        virDomainObj *vm,
-                        void *opaque G_GNUC_UNUSED)
+                        virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -734,8 +727,7 @@ qemuProcessHandleResume(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleRTCChange(qemuMonitor *mon G_GNUC_UNUSED,
                            virDomainObj *vm,
-                           long long offset,
-                           void *opaque G_GNUC_UNUSED)
+                           long long offset)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -776,8 +768,7 @@ qemuProcessHandleRTCChange(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleWatchdog(qemuMonitor *mon G_GNUC_UNUSED,
                           virDomainObj *vm,
-                          int action,
-                          void *opaque G_GNUC_UNUSED)
+                          int action)
 {
     virQEMUDriver *driver;
     virObjectEvent *watchdogEvent = NULL;
@@ -822,8 +813,7 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
                          const char *diskAlias,
                          const char *nodename,
                          int action,
-                         const char *reason,
-                         void *opaque G_GNUC_UNUSED)
+                         const char *reason)
 {
     virQEMUDriver *driver;
     virObjectEvent *ioErrorEvent = NULL;
@@ -890,8 +880,7 @@ qemuProcessHandleBlockJob(qemuMonitor *mon G_GNUC_UNUSED,
                           const char *diskAlias,
                           int type,
                           int status,
-                          const char *error,
-                          void *opaque G_GNUC_UNUSED)
+                          const char *error)
 {
     qemuDomainObjPrivate *priv;
     virDomainDiskDef *disk;
@@ -934,8 +923,7 @@ static void
 qemuProcessHandleJobStatusChange(qemuMonitor *mon G_GNUC_UNUSED,
                                  virDomainObj *vm,
                                  const char *jobname,
-                                 int status,
-                                 void *opaque G_GNUC_UNUSED)
+                                 int status)
 {
     qemuDomainObjPrivate *priv;
     qemuBlockJobData *job = NULL;
@@ -989,8 +977,7 @@ qemuProcessHandleGraphics(qemuMonitor *mon G_GNUC_UNUSED,
                           const char *remoteService,
                           const char *authScheme,
                           const char *x509dname,
-                          const char *saslUsername,
-                          void *opaque G_GNUC_UNUSED)
+                          const char *saslUsername)
 {
     virQEMUDriver *driver;
     virObjectEvent *event;
@@ -1035,8 +1022,7 @@ qemuProcessHandleTrayChange(qemuMonitor *mon G_GNUC_UNUSED,
                             virDomainObj *vm,
                             const char *devAlias,
                             const char *devid,
-                            int reason,
-                            void *opaque G_GNUC_UNUSED)
+                            int reason)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1064,8 +1050,7 @@ qemuProcessHandleTrayChange(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandlePMWakeup(qemuMonitor *mon G_GNUC_UNUSED,
-                          virDomainObj *vm,
-                          void *opaque G_GNUC_UNUSED)
+                          virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1097,8 +1082,7 @@ qemuProcessHandlePMWakeup(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandlePMSuspend(qemuMonitor *mon G_GNUC_UNUSED,
-                           virDomainObj *vm,
-                           void *opaque G_GNUC_UNUSED)
+                           virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1134,8 +1118,7 @@ qemuProcessHandlePMSuspend(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleBalloonChange(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
-                               unsigned long long actual,
-                               void *opaque G_GNUC_UNUSED)
+                               unsigned long long actual)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1168,8 +1151,7 @@ qemuProcessHandleBalloonChange(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandlePMSuspendDisk(qemuMonitor *mon G_GNUC_UNUSED,
-                               virDomainObj *vm,
-                               void *opaque G_GNUC_UNUSED)
+                               virDomainObj *vm)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1206,8 +1188,7 @@ qemuProcessHandlePMSuspendDisk(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleGuestPanic(qemuMonitor *mon G_GNUC_UNUSED,
                             virDomainObj *vm,
-                            qemuMonitorEventPanicInfo *info,
-                            void *opaque G_GNUC_UNUSED)
+                            qemuMonitorEventPanicInfo *info)
 {
     virObjectLock(vm);
 
@@ -1221,8 +1202,7 @@ qemuProcessHandleGuestPanic(qemuMonitor *mon G_GNUC_UNUSED,
 void
 qemuProcessHandleDeviceDeleted(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
-                               const char *devAlias,
-                               void *opaque G_GNUC_UNUSED)
+                               const char *devAlias)
 {
     virObjectLock(vm);
 
@@ -1245,8 +1225,7 @@ static void
 qemuProcessHandleDeviceUnplugErr(qemuMonitor *mon G_GNUC_UNUSED,
                                  virDomainObj *vm,
                                  const char *devPath,
-                                 const char *devAlias,
-                                 void *opaque G_GNUC_UNUSED)
+                                 const char *devAlias)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1341,8 +1320,7 @@ qemuProcessHandleAcpiOstInfo(qemuMonitor *mon G_GNUC_UNUSED,
                              const char *slotType,
                              const char *slot,
                              unsigned int source,
-                             unsigned int status,
-                             void *opaque G_GNUC_UNUSED)
+                             unsigned int status)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1378,8 +1356,7 @@ qemuProcessHandleBlockThreshold(qemuMonitor *mon G_GNUC_UNUSED,
                                 virDomainObj *vm,
                                 const char *nodename,
                                 unsigned long long threshold,
-                                unsigned long long excess,
-                                void *opaque G_GNUC_UNUSED)
+                                unsigned long long excess)
 {
     qemuDomainObjPrivate *priv;
     virQEMUDriver *driver;
@@ -1427,8 +1404,7 @@ qemuProcessHandleBlockThreshold(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleNicRxFilterChanged(qemuMonitor *mon G_GNUC_UNUSED,
                                     virDomainObj *vm,
-                                    const char *devAlias,
-                                    void *opaque G_GNUC_UNUSED)
+                                    const char *devAlias)
 {
     virObjectLock(vm);
 
@@ -1446,8 +1422,7 @@ static void
 qemuProcessHandleSerialChanged(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
                                const char *devAlias,
-                               bool connected,
-                               void *opaque G_GNUC_UNUSED)
+                               bool connected)
 {
     virObjectLock(vm);
 
@@ -1463,8 +1438,7 @@ qemuProcessHandleSerialChanged(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandleSpiceMigrated(qemuMonitor *mon G_GNUC_UNUSED,
-                               virDomainObj *vm,
-                               void *opaque G_GNUC_UNUSED)
+                               virDomainObj *vm)
 {
     qemuDomainObjPrivate *priv;
     qemuDomainJobPrivate *jobPriv;
@@ -1492,8 +1466,7 @@ qemuProcessHandleSpiceMigrated(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
                                  virDomainObj *vm,
-                                 int status,
-                                 void *opaque G_GNUC_UNUSED)
+                                 int status)
 {
     qemuDomainObjPrivate *priv;
     qemuDomainJobDataPrivate *privJob = NULL;
@@ -1544,8 +1517,7 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleMigrationPass(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
-                               int pass,
-                               void *opaque G_GNUC_UNUSED)
+                               int pass)
 {
     qemuDomainObjPrivate *priv;
 
@@ -1573,8 +1545,7 @@ qemuProcessHandleDumpCompleted(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
                                int status,
                                qemuMonitorDumpStats *stats,
-                               const char *error,
-                               void *opaque G_GNUC_UNUSED)
+                               const char *error)
 {
     qemuDomainObjPrivate *priv;
     qemuDomainJobPrivate *jobPriv;
@@ -1614,8 +1585,7 @@ static void
 qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon G_GNUC_UNUSED,
                                         virDomainObj *vm,
                                         const char *prManager,
-                                        bool connected,
-                                        void *opaque G_GNUC_UNUSED)
+                                        bool connected)
 {
     qemuDomainObjPrivate *priv;
     const char *managedAlias = qemuDomainGetManagedPRAlias();
@@ -1654,8 +1624,7 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitor *mon G_GNUC_UNUSED,
                                       const char *netdev,
                                       bool gid_status,
                                       unsigned long long subnet_prefix,
-                                      unsigned long long interface_id,
-                                      void *opaque G_GNUC_UNUSED)
+                                      unsigned long long interface_id)
 {
     qemuMonitorRdmaGidStatus *info = NULL;
 
@@ -1681,8 +1650,7 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitor *mon G_GNUC_UNUSED,
 
 static void
 qemuProcessHandleGuestCrashloaded(qemuMonitor *mon G_GNUC_UNUSED,
-                                  virDomainObj *vm,
-                                  void *opaque G_GNUC_UNUSED)
+                                  virDomainObj *vm)
 {
     virObjectLock(vm);
 
@@ -1696,8 +1664,7 @@ qemuProcessHandleGuestCrashloaded(qemuMonitor *mon G_GNUC_UNUSED,
 static void
 qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED,
                                virDomainObj *vm,
-                               qemuMonitorEventMemoryFailure *mfp,
-                               void *opaque G_GNUC_UNUSED)
+                               qemuMonitorEventMemoryFailure *mfp)
 {
     virQEMUDriver *driver;
     virObjectEvent *event = NULL;
@@ -1755,8 +1722,7 @@ static void
 qemuProcessHandleMemoryDeviceSizeChange(qemuMonitor *mon G_GNUC_UNUSED,
                                         virDomainObj *vm,
                                         const char *devAlias,
-                                        unsigned long long size,
-                                        void *opaque G_GNUC_UNUSED)
+                                        unsigned long long size)
 {
     qemuMonitorMemoryDeviceSizeChange *info = NULL;
 
@@ -1876,8 +1842,7 @@ qemuConnectMonitor(virQEMUDriver *driver,
                           retry,
                           timeout,
                           virEventThreadGetContext(priv->eventThread),
-                          &monitorCallbacks,
-                          driver);
+                          &monitorCallbacks);
 
     if (mon && logCtxt) {
         g_object_ref(logCtxt);
@@ -9059,8 +9024,7 @@ qemuProcessReconnectAll(virQEMUDriver *driver)
 
 
 static void virQEMUCapsMonitorNotify(qemuMonitor *mon G_GNUC_UNUSED,
-                                     virDomainObj *vm G_GNUC_UNUSED,
-                                     void *opaque G_GNUC_UNUSED)
+                                     virDomainObj *vm G_GNUC_UNUSED)
 {
 }
 
@@ -9343,7 +9307,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMP *proc)
 
     if (!(proc->mon = qemuMonitorOpen(proc->vm, &monConfig, true, 0,
                                       virEventThreadGetContext(proc->eventThread),
-                                      &callbacks, NULL)))
+                                      &callbacks)))
         return -1;
 
     virObjectLock(proc->mon);
diff --git a/src/qemu/qemu_processpriv.h b/src/qemu/qemu_processpriv.h
index 9cb176e97c..0ba5897f40 100644
--- a/src/qemu/qemu_processpriv.h
+++ b/src/qemu/qemu_processpriv.h
@@ -34,7 +34,6 @@
 
 void qemuProcessHandleDeviceDeleted(qemuMonitor *mon,
                                     virDomainObj *vm,
-                                    const char *devAlias,
-                                    void *opaque);
+                                    const char *devAlias);
 
 int qemuProcessQMPInitMonitor(qemuMonitor *mon);
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index fe8f0b58db..21123b88ed 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -298,8 +298,7 @@ testQemuHotplug(const void *data)
 
     /* Now is the best time to feed the spoofed monitor with predefined
      * replies. */
-    if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, &driver,
-                                        NULL, NULL)))
+    if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, NULL, NULL)))
         goto cleanup;
 
     tmp = test->mon;
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 86300da68a..ddd7d91b13 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -953,16 +953,14 @@ qemuMonitorTestAddItemExpect(qemuMonitorTest *test,
 
 static void
 qemuMonitorTestEOFNotify(qemuMonitor *mon G_GNUC_UNUSED,
-                         virDomainObj *vm G_GNUC_UNUSED,
-                         void *opaque G_GNUC_UNUSED)
+                         virDomainObj *vm G_GNUC_UNUSED)
 {
 }
 
 
 static void
 qemuMonitorTestErrorNotify(qemuMonitor *mon G_GNUC_UNUSED,
-                           virDomainObj *vm G_GNUC_UNUSED,
-                           void *opaque G_GNUC_UNUSED)
+                           virDomainObj *vm G_GNUC_UNUSED)
 {
 }
 
@@ -1096,7 +1094,6 @@ qemuMonitorCommonTestInit(qemuMonitorTest *test)
 qemuMonitorTest *
 qemuMonitorTestNew(virDomainXMLOption *xmlopt,
                    virDomainObj *vm,
-                   virQEMUDriver *driver,
                    const char *greeting,
                    GHashTable *schema)
 {
@@ -1117,8 +1114,7 @@ qemuMonitorTestNew(virDomainXMLOption *xmlopt,
                                       true,
                                       0,
                                       virEventThreadGetContext(test->eventThread),
-                                      &qemuMonitorTestCallbacks,
-                                      driver)))
+                                      &qemuMonitorTestCallbacks)))
         goto error;
 
     virObjectLock(test->mon);
@@ -1190,7 +1186,7 @@ qemuMonitorTestNewFromFile(const char *fileName,
                     return NULL;
             } else {
                 /* Create new mocked monitor with our greeting */
-                if (!(test = qemuMonitorTestNew(xmlopt, NULL, NULL,
+                if (!(test = qemuMonitorTestNew(xmlopt, NULL,
                                                 singleReply, NULL)))
                     return NULL;
             }
@@ -1390,8 +1386,7 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
     if (virTestLoadFile(fileName, &jsonstr) < 0)
         return NULL;
 
-    if (!(ret = qemuMonitorTestNew(driver->xmlopt, vm, driver, NULL,
-                                   qmpschema)))
+    if (!(ret = qemuMonitorTestNew(driver->xmlopt, vm, NULL, qmpschema)))
         return NULL;
 
     if (qemuMonitorTestProcessFileEntries(jsonstr, fileName, &items, &nitems) < 0)
diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h
index 56e3d56056..935f9d1e1a 100644
--- a/tests/qemumonitortestutils.h
+++ b/tests/qemumonitortestutils.h
@@ -90,14 +90,13 @@ qemuMonitorTestAddItemExpect(qemuMonitorTest *test,
                              const char *response);
 
 #define qemuMonitorTestNewSimple(xmlopt) \
-    qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, NULL)
+    qemuMonitorTestNew(xmlopt, NULL, NULL, NULL)
 #define qemuMonitorTestNewSchema(xmlopt, schema) \
-    qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema)
+    qemuMonitorTestNew(xmlopt, NULL, NULL, schema)
 
 qemuMonitorTest *
 qemuMonitorTestNew(virDomainXMLOption *xmlopt,
                    virDomainObj *vm,
-                   virQEMUDriver *driver,
                    const char *greeting,
                    GHashTable *schema);
 
-- 
2.35.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