[PATCH RFC 4/5] qemu: drop driver parameter on domain enter/exit monitor

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

 



As it is not used anymore. Most of the work is done by sed:

sed -i.bak s/qemuDomainObjEnterMonitor(driver, vm)/qemuDomainObjEnterMonitor(vm)/ src/qemu/*
sed -i.bak s/qemuDomainObjExitMonitor(driver, vm)/qemuDomainObjExitMonitor(vm)/ src/qemu/*

Then drop driver parameter from the callers until gcc stops
giving 'unused parameter' error.
---
 src/qemu/qemu_domain.c    |  24 ++---
 src/qemu/qemu_domain.h    |  11 +-
 src/qemu/qemu_driver.c    | 224 ++++++++++++++++++++---------------------
 src/qemu/qemu_hotplug.c   | 248 ++++++++++++++++++++++------------------------
 src/qemu/qemu_hotplug.h   |  12 +--
 src/qemu/qemu_migration.c |  48 ++++-----
 src/qemu/qemu_process.c   |  65 ++++++------
 tests/qemuhotplugtest.c   |   2 +-
 8 files changed, 304 insertions(+), 330 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 40d46d6..0a51fe8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3511,8 +3511,7 @@ qemuDomainObjExitMonitorInternal(virDomainObjPtr obj)
         priv->mon = NULL;
 }
 
-void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
-                               virDomainObjPtr obj)
+void qemuDomainObjEnterMonitor(virDomainObjPtr obj)
 {
     qemuDomainObjEnterMonitorInternal(obj);
 }
@@ -3527,8 +3526,7 @@ void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
  * and replaced by the persistent definition, so pointers stolen
  * from the live definition could no longer be valid.
  */
-int qemuDomainObjExitMonitor(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
-                             virDomainObjPtr obj)
+int qemuDomainObjExitMonitor(virDomainObjPtr obj)
 {
     qemuDomainObjExitMonitorInternal(obj);
     if (!virDomainObjIsActive(obj)) {
@@ -4435,10 +4433,10 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
                 goto cleanup;
         } else {
             priv = vm->privateData;
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
             /* we continue on even in the face of error */
             qemuMonitorDeleteSnapshot(priv->mon, snap->def->name);
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
         }
     }
 
@@ -5207,7 +5205,7 @@ qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
         return -1;
     rc = qemuMonitorGetDeviceAliases(priv->mon, &aliases);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
     if (rc < 0)
         return -1;
@@ -5236,7 +5234,7 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver,
 
     rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     /* if qemu doesn't support the info request, just carry on */
@@ -5847,9 +5845,9 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
             goto endjob;
         }
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorGetBalloonInfo(priv->mon, &balloon);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
 
  endjob:
@@ -6194,7 +6192,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
 
     rc = qemuMonitorGetCPUInfo(qemuDomainGetMonitor(vm), &info, maxvcpus, hotplug);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if (rc < 0)
@@ -6308,7 +6306,7 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
 
     haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || !haltedmap)
+    if (qemuDomainObjExitMonitor(vm) < 0 || !haltedmap)
         goto cleanup;
 
     for (i = 0; i < maxvcpus; i++) {
@@ -6585,7 +6583,7 @@ qemuDomainCheckMonitor(virQEMUDriverPtr driver,
 
     ret = qemuMonitorCheck(priv->mon);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     return ret;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 7fd8cd6..12fef38 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -431,13 +431,10 @@ void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj);
 
 qemuMonitorPtr qemuDomainGetMonitor(virDomainObjPtr vm)
     ATTRIBUTE_NONNULL(1);
-void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
-                               virDomainObjPtr obj)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
-                             virDomainObjPtr obj)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
-    ATTRIBUTE_RETURN_CHECK;
+void qemuDomainObjEnterMonitor(virDomainObjPtr obj)
+    ATTRIBUTE_NONNULL(1);
+int qemuDomainObjExitMonitor(virDomainObjPtr obj)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
 int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
                                    virDomainObjPtr obj,
                                    qemuDomainAsyncJob asyncJob)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fdfe912..4b39021 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2034,9 +2034,9 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
         }
 
         qemuDomainSetFakeReboot(driver, vm, isReboot);
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorSystemPowerdown(priv->mon);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
     }
 
@@ -2136,9 +2136,9 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
         }
 #endif
         qemuDomainSetFakeReboot(driver, vm, isReboot);
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorSystemPowerdown(priv->mon);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
     }
 
@@ -2178,9 +2178,9 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorSystemReset(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     priv->fakeReboot = false;
@@ -2396,9 +2396,9 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (def) {
             priv = vm->privateData;
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
             r = qemuMonitorSetBalloon(priv->mon, newmem);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0 || r < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0 || r < 0)
                 goto endjob;
 
             /* Lack of balloon support is a fatal error */
@@ -2478,9 +2478,9 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
             goto endjob;
         }
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         r = qemuMonitorSetMemoryStatsPeriod(priv->mon, def->memballoon, period);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto endjob;
         if (r < 0) {
             virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -2542,9 +2542,9 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorInjectNMI(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -2605,9 +2605,9 @@ static int qemuDomainSendKey(virDomainPtr domain,
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorSendKey(priv->mon, holdtime, keycodes, nkeycodes);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -3571,7 +3571,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
     ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat);
 
  cleanup:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
 
     return ret;
 }
@@ -3743,9 +3743,9 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
                virDomainObjIsActive(vm)) {
         if ((ret == 0) && (flags & VIR_DUMP_RESET)) {
             priv =  vm->privateData;
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
             ret = qemuMonitorSystemReset(priv->mon);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 ret = -1;
         }
 
@@ -3840,12 +3840,12 @@ qemuDomainScreenshot(virDomainPtr dom,
 
     virSecurityManagerSetSavedStateLabel(driver->securityManager, vm->def, tmp);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorScreendump(priv->mon, tmp) < 0) {
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         goto endjob;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
 
     if (VIR_CLOSE(tmp_fd) < 0) {
@@ -4346,9 +4346,9 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver,
     VIR_DEBUG("process NIC_RX_FILTER_CHANGED event for network "
               "device %s in domain %s", def->info.alias, vm->def->name);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorQueryRxFilter(priv->mon, devAlias, &guestFilter);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     if (ret < 0)
         goto endjob;
@@ -4630,7 +4630,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (newhotplug) {
         rc = qemuMonitorAddDeviceArgs(qemuDomainGetMonitor(vm), vcpuprops);
@@ -4639,7 +4639,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,
         rc = qemuMonitorSetCPU(qemuDomainGetMonitor(vm), vcpu, true);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditVcpu(vm, oldvcpus, oldvcpus + nvcpus, "update", rc == 0);
@@ -5592,9 +5592,9 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver,
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     niothreads = qemuMonitorGetIOThreads(priv->mon, &iothreads);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
     if (niothreads < 0)
         goto endjob;
@@ -5878,8 +5878,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
 }
 
 static int
-qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
-                             virDomainObjPtr vm,
+qemuDomainHotplugAddIOThread(virDomainObjPtr vm,
                              unsigned int iothread_id)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -5903,7 +5902,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
     if (virAsprintf(&alias, "iothread%u", iothread_id) < 0)
         return -1;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     rc = qemuMonitorAddObject(priv->mon, "iothread", alias, NULL);
     exp_niothreads++;
@@ -5918,7 +5917,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
                                                   &new_iothreads)) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if (new_niothreads != exp_niothreads) {
@@ -5969,13 +5968,12 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
     return ret;
 
  exit_monitor:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto cleanup;
 }
 
 static int
-qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver,
-                             virDomainObjPtr vm,
+qemuDomainHotplugDelIOThread(virDomainObjPtr vm,
                              unsigned int iothread_id)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -6006,7 +6004,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver,
     if (virAsprintf(&alias, "iothread%u", iothread_id) < 0)
         return -1;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     rc = qemuMonitorDelObject(priv->mon, alias);
     exp_niothreads--;
@@ -6017,7 +6015,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver,
                                                   &new_iothreads)) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if (new_niothreads != exp_niothreads) {
@@ -6050,7 +6048,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver,
     return ret;
 
  exit_monitor:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto cleanup;
 }
 
@@ -6091,10 +6089,10 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
         }
 
         if (add) {
-            if (qemuDomainHotplugAddIOThread(driver, vm, iothread_id) < 0)
+            if (qemuDomainHotplugAddIOThread(vm, iothread_id) < 0)
                 goto endjob;
         } else {
-            if (qemuDomainHotplugDelIOThread(driver, vm, iothread_id) < 0)
+            if (qemuDomainHotplugDelIOThread(vm, iothread_id) < 0)
                 goto endjob;
         }
 
@@ -7543,7 +7541,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
         break;
 
     case VIR_DOMAIN_DEVICE_CONTROLLER:
-        ret = qemuDomainAttachControllerDevice(driver, vm, dev->data.controller);
+        ret = qemuDomainAttachControllerDevice(vm, dev->data.controller);
         if (!ret) {
             alias = dev->data.controller->info.alias;
             dev->data.controller = NULL;
@@ -7612,8 +7610,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
         break;
 
     case VIR_DOMAIN_DEVICE_SHMEM:
-        ret = qemuDomainAttachShmemDevice(driver, vm,
-                                          dev->data.shmem);
+        ret = qemuDomainAttachShmemDevice(vm, dev->data.shmem);
         if (!ret) {
             alias = dev->data.shmem->info.alias;
             dev->data.shmem = NULL;
@@ -7820,7 +7817,7 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn,
         ret = qemuDomainChangeGraphics(driver, vm, dev->data.graphics);
         break;
     case VIR_DOMAIN_DEVICE_NET:
-        ret = qemuDomainChangeNet(driver, vm, dev);
+        ret = qemuDomainChangeNet(vm, dev);
         break;
     case VIR_DOMAIN_DEVICE_FS:
     case VIR_DOMAIN_DEVICE_INPUT:
@@ -10718,12 +10715,12 @@ qemuDomainBlockResize(virDomainPtr dom,
     if (!(device = qemuAliasFromDisk(disk)))
         goto endjob;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorBlockResize(priv->mon, device, size) < 0) {
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         goto endjob;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
 
     ret = 0;
@@ -10775,8 +10772,7 @@ qemuDomainBlockStatsGatherTotals(void *payload,
  * Returns -1 on error; number of filled block statistics on success.
  */
 static int
-qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
-                            virDomainObjPtr vm,
+qemuDomainBlocksStatsGather(virDomainObjPtr vm,
                             const char *path,
                             qemuBlockStatsPtr *retstats)
 {
@@ -10804,9 +10800,9 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, false);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || nstats < 0)
         goto cleanup;
 
     if (VIR_ALLOC(*retstats) < 0)
@@ -10862,7 +10858,7 @@ qemuDomainBlockStats(virDomainPtr dom,
         goto endjob;
     }
 
-    if (qemuDomainBlocksStatsGather(driver, vm, path, &blockstats) < 0)
+    if (qemuDomainBlocksStatsGather(vm, path, &blockstats) < 0)
         goto endjob;
 
     stats->rd_req = blockstats->rd_req;
@@ -10919,8 +10915,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
         goto endjob;
     }
 
-    if ((nstats = qemuDomainBlocksStatsGather(driver, vm, path,
-                                              &blockstats)) < 0)
+    if ((nstats = qemuDomainBlocksStatsGather(vm, path, &blockstats)) < 0)
         goto endjob;
 
     /* return count of supported stats */
@@ -11320,8 +11315,7 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom,
 
 /* This functions assumes that job QEMU_JOB_QUERY is started by a caller */
 static int
-qemuDomainMemoryStatsInternal(virQEMUDriverPtr driver,
-                              virDomainObjPtr vm,
+qemuDomainMemoryStatsInternal(virDomainObjPtr vm,
                               virDomainMemoryStatPtr stats,
                               unsigned int nr_stats)
 
@@ -11337,10 +11331,10 @@ qemuDomainMemoryStatsInternal(virQEMUDriverPtr driver,
 
     if (vm->def->memballoon &&
         vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) {
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorGetMemoryStats(qemuDomainGetMonitor(vm),
                                         vm->def->memballoon, stats, nr_stats);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
 
         if (ret < 0 || ret >= nr_stats)
@@ -11382,7 +11376,7 @@ qemuDomainMemoryStats(virDomainPtr dom,
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
         goto cleanup;
 
-    ret = qemuDomainMemoryStatsInternal(driver, vm, stats, nr_stats);
+    ret = qemuDomainMemoryStatsInternal(vm, stats, nr_stats);
 
     qemuDomainObjEndJob(driver, vm);
 
@@ -11493,19 +11487,19 @@ qemuDomainMemoryPeek(virDomainPtr dom,
     virSecurityManagerSetSavedStateLabel(driver->securityManager, vm->def, tmp);
 
     priv = vm->privateData;
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (flags == VIR_MEMORY_VIRTUAL) {
         if (qemuMonitorSaveVirtualMemory(priv->mon, offset, size, tmp) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             goto endjob;
         }
     } else {
         if (qemuMonitorSavePhysicalMemory(priv->mon, offset, size, tmp) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             goto endjob;
         }
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
 
     /* Read the memory file into buffer. */
@@ -11734,14 +11728,14 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorGetAllBlockStatsInfo(qemuDomainGetMonitor(vm),
                                          &stats, false);
     if (rc >= 0)
         rc = qemuMonitorBlockStatsUpdateCapacity(qemuDomainGetMonitor(vm),
                                                  stats, false);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rc < 0)
         goto endjob;
 
     if (!(entry = virHashLookup(stats, alias))) {
@@ -13142,9 +13136,9 @@ static int qemuDomainAbortJob(virDomainPtr dom)
 
     VIR_DEBUG("Cancelling job at client request");
     qemuDomainObjAbortAsyncJob(vm);
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorMigrateCancel(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -13186,9 +13180,9 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
     priv = vm->privateData;
 
     VIR_DEBUG("Setting migration downtime to %llums", downtime);
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorSetMigrationDowntime(priv->mon, downtime);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -13228,7 +13222,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     ret = qemuMonitorGetMigrationCapability(
                 priv->mon,
@@ -13242,7 +13236,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
         ret = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -13282,7 +13276,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     ret = qemuMonitorGetMigrationCapability(
                 priv->mon,
@@ -13297,7 +13291,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
         ret = qemuMonitorSetMigrationCacheSize(priv->mon, cacheSize);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -13346,9 +13340,9 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
         }
 
         VIR_DEBUG("Setting migration bandwidth to %luMbs", bandwidth);
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
 
         if (ret == 0)
@@ -13437,9 +13431,9 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
     }
 
     VIR_DEBUG("Starting post-copy");
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorMigrateStartPostCopy(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -13665,7 +13659,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
     }
 
     ret = qemuMonitorCreateSnapshot(priv->mon, snap->def->name);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     if (ret < 0)
         goto cleanup;
@@ -14187,7 +14181,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
     ret = rc = qemuMonitorDiskSnapshot(priv->mon, actions, device, source,
                                        formatStr, reuse);
     if (!actions) {
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
     }
 
@@ -14325,7 +14319,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
         if (ret == 0 && do_transaction) {
             if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
                 ret = qemuMonitorTransaction(priv->mon, actions);
-                if (qemuDomainObjExitMonitor(driver, vm) < 0)
+                if (qemuDomainObjExitMonitor(vm) < 0)
                     ret = -1;
             } else {
                 /* failed to enter monitor, clean stuff up and quit */
@@ -15403,7 +15397,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
                                                QEMU_ASYNC_JOB_START) < 0)
                 goto endjob;
             rc = qemuMonitorLoadSnapshot(priv->mon, snap->def->name);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto endjob;
             if (rc < 0) {
                 /* XXX resume domain if it was running before the
@@ -15773,9 +15767,9 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
 
     hmp = !!(flags & VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorArbitraryCommand(priv->mon, cmd, result, hmp);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -16061,9 +16055,9 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
 
     /* Probe the status, if needed.  */
     if (!disk->mirrorState) {
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         rc = qemuMonitorGetBlockJobInfo(priv->mon, disk->info.alias, &info);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
         if (rc < 0)
             goto cleanup;
@@ -16122,9 +16116,9 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
      * that pivot failed, we need to reflect that failure into the
      * overall return value.  */
     disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT;
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorDrivePivot(priv->mon, device);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         ret = -1;
         goto cleanup;
     }
@@ -16248,14 +16242,14 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
         speed <<= 20;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (baseSource)
         basePath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src,
                                              baseSource);
     if (!baseSource || basePath)
         ret = qemuMonitorBlockStream(priv->mon, device, basePath, backingPath,
                                      speed, modern);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret < 0)
@@ -16338,9 +16332,9 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
             save = true;
         }
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device, modern);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+        if (qemuDomainObjExitMonitor(vm) < 0) {
             ret = -1;
             goto endjob;
         }
@@ -16479,10 +16473,10 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm),
                                      disk->info.alias, &rawInfo);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     if (ret <= 0)
         goto endjob;
@@ -16567,12 +16561,12 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
     if (!(device = qemuAliasFromDisk(disk)))
         goto endjob;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm),
                                       device,
                                       speed,
                                       modern);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -16745,11 +16739,11 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
     }
 
     /* Actually start the mirroring */
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorDriveMirror(priv->mon, device, mirror->path, format,
                                  bandwidth, granularity, buf_size, flags);
     virDomainAuditDisk(vm, NULL, mirror, "mirror", ret >= 0);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     if (ret < 0) {
         qemuDomainDiskChainElementRevoke(driver, vm, mirror);
@@ -17138,7 +17132,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
         disk->mirror = mirror;
         disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT;
     }
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     basePath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src,
                                          baseSource);
     topPath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src,
@@ -17147,7 +17141,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
         ret = qemuMonitorBlockCommit(priv->mon, device,
                                      topPath, basePath, backingPath,
                                      speed);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         ret = -1;
         goto endjob;
     }
@@ -17243,10 +17237,10 @@ qemuDomainOpenGraphics(virDomainPtr dom,
                                           fd) < 0)
         goto endjob;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
                                   (flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -17315,10 +17309,10 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom,
 
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorOpenGraphics(priv->mon, protocol, pair[1], "graphicsfd",
                                   (flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH));
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     qemuDomainObjEndJob(driver, vm);
     if (ret < 0)
@@ -17650,11 +17644,11 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
          /* NB: Let's let QEMU decide how to handle issues with _length
           * via the JSON error code from the block_set_io_throttle call */
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorSetBlockIoThrottle(priv->mon, device,
                                             &info, supportMaxOptions,
                                             supportMaxLengthOptions);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
         if (ret < 0)
             goto endjob;
@@ -17775,9 +17769,9 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
 
         if (!(device = qemuAliasFromDisk(disk)))
             goto endjob;
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto endjob;
         if (ret < 0)
             goto endjob;
@@ -17878,9 +17872,9 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     table = qemuMonitorGetBlockInfo(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
     if (!table)
         goto endjob;
@@ -18156,9 +18150,9 @@ qemuDomainPMWakeup(virDomainPtr dom,
        goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorSystemWakeup(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
  endjob:
@@ -18587,9 +18581,9 @@ qemuDomainSetTime(virDomainPtr dom,
 
     /* Don't try to call rtc-reset-reinjection if it's not available */
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         rv = qemuMonitorRTCResetReinjection(priv->mon);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto endjob;
 
         if (rv < 0)
@@ -18898,7 +18892,7 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
 }
 
 static int
-qemuDomainGetStatsBalloon(virQEMUDriverPtr driver,
+qemuDomainGetStatsBalloon(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
                           virDomainObjPtr dom,
                           virDomainStatsRecordPtr record,
                           int *maxparams,
@@ -18936,7 +18930,7 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver,
     if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom))
         return 0;
 
-    nr_stats = qemuDomainMemoryStatsInternal(driver, dom, stats,
+    nr_stats = qemuDomainMemoryStatsInternal(dom, stats,
                                              VIR_DOMAIN_MEMORY_STAT_NR);
     if (nr_stats < 0)
         return 0;
@@ -19342,13 +19336,13 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
     bool visitBacking = !!(privflags & QEMU_DOMAIN_STATS_BACKING);
 
     if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) {
-        qemuDomainObjEnterMonitor(driver, dom);
+        qemuDomainObjEnterMonitor(dom);
         rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
                                              visitBacking);
         if (rc >= 0)
             ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
                                                              visitBacking));
-        if (qemuDomainObjExitMonitor(driver, dom) < 0)
+        if (qemuDomainObjExitMonitor(dom) < 0)
             goto cleanup;
 
         /* failure to retrieve stats is fine at this point */
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5038ce1..ed08313 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -146,8 +146,7 @@ qemuDomainPrepareDisk(virQEMUDriverPtr driver,
 
 
 static int
-qemuHotplugWaitForTrayEject(virQEMUDriverPtr driver,
-                            virDomainObjPtr vm,
+qemuHotplugWaitForTrayEject(virDomainObjPtr vm,
                             virDomainDiskDefPtr disk,
                             const char *driveAlias)
 {
@@ -173,9 +172,9 @@ qemuHotplugWaitForTrayEject(virQEMUDriverPtr driver,
     }
 
     /* re-issue ejection command to pop out the media */
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorEjectMedia(qemuDomainGetMonitor(vm), driveAlias, false);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rc < 0)
         return -1;
 
     return 0;
@@ -231,15 +230,15 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
     if (!(driveAlias = qemuAliasFromDisk(disk)))
         goto error;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorEjectMedia(priv->mon, driveAlias, force);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     /* If the tray is present and tray change event is supported wait for it to open. */
     if (!force && diskPriv->tray &&
         virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_TRAY_MOVED)) {
-        rc = qemuHotplugWaitForTrayEject(driver, vm, disk, driveAlias);
+        rc = qemuHotplugWaitForTrayEject(vm, disk, driveAlias);
         if (rc < 0)
             goto error;
     } else  {
@@ -260,12 +259,12 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
                     format = virStorageFileFormatTypeToString(disk->src->format);
             }
         }
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         rc = qemuMonitorChangeMedia(priv->mon,
                                     driveAlias,
                                     sourcestr,
                                     format);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
     }
 
@@ -378,7 +377,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
     if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
         goto error;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (secobjProps) {
         rv = qemuMonitorAddObject(priv->mon, "secret", secinfo->s.aes.alias,
@@ -405,7 +404,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         releaseaddr = false;
         goto error;
     }
@@ -441,7 +440,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
         virFreeError(orig_err);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         releaseaddr = false;
 
     virDomainAuditDisk(vm, NULL, disk->src, "attach", false);
@@ -455,8 +454,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
 }
 
 
-int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
-                                     virDomainObjPtr vm,
+int qemuDomainAttachControllerDevice(virDomainObjPtr vm,
                                      virDomainControllerDefPtr controller)
 {
     int ret = -1;
@@ -523,9 +521,9 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
     if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0)
         goto cleanup;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorAddDevice(priv->mon, devstr);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         releaseaddr = false;
         ret = -1;
         goto cleanup;
@@ -547,8 +545,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
 }
 
 static virDomainControllerDefPtr
-qemuDomainFindOrCreateSCSIDiskController(virQEMUDriverPtr driver,
-                                         virDomainObjPtr vm,
+qemuDomainFindOrCreateSCSIDiskController(virDomainObjPtr vm,
                                          int controller)
 {
     size_t i;
@@ -573,8 +570,7 @@ qemuDomainFindOrCreateSCSIDiskController(virQEMUDriverPtr driver,
     cont->model = -1;
 
     VIR_INFO("No SCSI controller present, hotplugging one");
-    if (qemuDomainAttachControllerDevice(driver,
-                                         vm, cont) < 0) {
+    if (qemuDomainAttachControllerDevice(vm, cont) < 0) {
         VIR_FREE(cont);
         return NULL;
     }
@@ -634,7 +630,7 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
      * exist; there must not be any missing index in between.
      */
     for (i = 0; i <= disk->info.addr.drive.controller; i++) {
-        if (!qemuDomainFindOrCreateSCSIDiskController(driver, vm, i))
+        if (!qemuDomainFindOrCreateSCSIDiskController(vm, i))
             goto error;
     }
 
@@ -667,7 +663,7 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
     if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
         goto error;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (secobjProps) {
         rv = qemuMonitorAddObject(priv->mon, "secret", secinfo->s.aes.alias,
@@ -694,7 +690,7 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto error;
 
     virDomainAuditDisk(vm, NULL, disk->src, "attach", true);
@@ -727,7 +723,7 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
         virFreeError(orig_err);
     }
 
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
 
     virDomainAuditDisk(vm, NULL, disk->src, "attach", false);
 
@@ -784,7 +780,7 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
     if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
         goto error;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (qemuMonitorAddDrive(priv->mon, drivestr) < 0)
         goto exit_monitor;
@@ -793,7 +789,7 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto error;
 
     virDomainAuditDisk(vm, NULL, disk->src, "attach", true);
@@ -821,7 +817,7 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
         virFreeError(orig_err);
     }
 
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     virDomainAuditDisk(vm, NULL, disk->src, "attach", false);
 
  error:
@@ -1183,11 +1179,11 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
         if (qemuMonitorAttachCharDev(priv->mon, charDevAlias, net->data.vhostuser) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             virDomainAuditNet(vm, NULL, net, "attach", false);
             goto cleanup;
         }
@@ -1198,7 +1194,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
         if (qemuMonitorAddNetdev(priv->mon, netstr,
                                  tapfd, tapfdName, tapfdSize,
                                  vhostfd, vhostfdName, vhostfdSize) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             virDomainAuditNet(vm, NULL, net, "attach", false);
             goto try_remove;
         }
@@ -1207,14 +1203,14 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
         if (qemuMonitorAddHostNetwork(priv->mon, netstr,
                                       tapfd, tapfdName, tapfdSize,
                                       vhostfd, vhostfdName, vhostfdSize) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             virDomainAuditNet(vm, NULL, net, "attach", false);
             goto try_remove;
         }
         hostPlugged = true;
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     for (i = 0; i < tapfdSize; i++)
@@ -1226,13 +1222,13 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
                                       vhostfdSize, priv->qemuCaps)))
         goto try_remove;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorAddDevice(priv->mon, nicstr) < 0) {
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         virDomainAuditNet(vm, NULL, net, "attach", false);
         goto try_remove;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     /* set link state */
@@ -1241,11 +1237,11 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
             virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                            _("device alias not found: cannot set link state to down"));
         } else {
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
 
             if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
                 if (qemuMonitorSetLink(priv->mon, net->info.alias, VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) < 0) {
-                    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+                    ignore_value(qemuDomainObjExitMonitor(vm));
                     virDomainAuditNet(vm, NULL, net, "attach", false);
                     goto try_remove;
                 }
@@ -1254,7 +1250,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
                                _("setting of link state not supported: Link is up"));
             }
 
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto cleanup;
         }
         /* link set to down */
@@ -1331,7 +1327,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
         if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
             char *netdev_name;
             if (virAsprintf(&netdev_name, "host%s", net->info.alias) >= 0) {
-                qemuDomainObjEnterMonitor(driver, vm);
+                qemuDomainObjEnterMonitor(vm);
                 if (charDevPlugged &&
                     qemuMonitorDetachCharDev(priv->mon, charDevAlias) < 0)
                     VIR_WARN("Failed to remove associated chardev %s", charDevAlias);
@@ -1339,7 +1335,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
                     qemuMonitorRemoveNetdev(priv->mon, netdev_name) < 0)
                     VIR_WARN("Failed to remove network backend for netdev %s",
                              netdev_name);
-                ignore_value(qemuDomainObjExitMonitor(driver, vm));
+                ignore_value(qemuDomainObjExitMonitor(vm));
                 VIR_FREE(netdev_name);
             }
         } else {
@@ -1348,12 +1344,12 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
     } else {
         char *hostnet_name;
         if (virAsprintf(&hostnet_name, "host%s", net->info.alias) >= 0) {
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
             if (hostPlugged &&
                 qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0)
                 VIR_WARN("Failed to remove network backend for vlan %d, net %s",
                          vlan, hostnet_name);
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             VIR_FREE(hostnet_name);
         }
     }
@@ -1464,10 +1460,10 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver,
                                              configfd_name, priv->qemuCaps)))
         goto error;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorAddDeviceWithFd(priv->mon, devstr,
                                      configfd, configfd_name);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto error;
 
     virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
@@ -1593,7 +1589,7 @@ int qemuDomainAttachRedirdevDevice(virConnectPtr conn,
                                        &secProps, &secAlias) < 0)
         goto cleanup;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (secAlias) {
         rc = qemuMonitorAddObject(priv->mon, "secret",
@@ -1622,7 +1618,7 @@ int qemuDomainAttachRedirdevDevice(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto audit;
 
     def->redirdevs[def->nredirdevs++] = redirdev;
@@ -1652,7 +1648,7 @@ int qemuDomainAttachRedirdevDevice(virConnectPtr conn,
         virSetError(orig_err);
         virFreeError(orig_err);
     }
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto audit;
 }
 
@@ -1874,7 +1870,7 @@ int qemuDomainAttachChrDevice(virConnectPtr conn,
                                        &secProps, &secAlias) < 0)
         goto cleanup;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (secAlias) {
         rc = qemuMonitorAddObject(priv->mon, "secret",
                                   secAlias, secProps);
@@ -1900,7 +1896,7 @@ int qemuDomainAttachChrDevice(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto audit;
 
     qemuDomainChrInsertPreAlloced(vmdef, chr);
@@ -1939,7 +1935,7 @@ int qemuDomainAttachChrDevice(virConnectPtr conn,
         virFreeError(orig_err);
     }
 
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto audit;
 }
 
@@ -2037,7 +2033,7 @@ qemuDomainAttachRNGDevice(virConnectPtr conn,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (secAlias) {
         rv = qemuMonitorAddObject(priv->mon, "secret",
@@ -2072,7 +2068,7 @@ qemuDomainAttachRNGDevice(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         releaseaddr = false;
         goto cleanup;
     }
@@ -2118,7 +2114,7 @@ qemuDomainAttachRNGDevice(virConnectPtr conn,
         virFreeError(orig_err);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         releaseaddr = false;
     goto audit;
 }
@@ -2189,7 +2185,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
         goto removedef;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rv = qemuMonitorAddObject(priv->mon, backendType, objalias, props);
     props = NULL; /* qemuMonitorAddObject consumes */
     if (rv < 0)
@@ -2199,7 +2195,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         /* we shouldn't touch mem now, as the def might be freed */
         mem = NULL;
         goto audit;
@@ -2237,7 +2233,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
         virSetError(orig_err);
         virFreeError(orig_err);
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         mem = NULL;
         goto audit;
     }
@@ -2299,9 +2295,9 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver,
     if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs+1) < 0)
         goto cleanup;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorAddDevice(priv->mon, devstr);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         ret = -1;
         goto cleanup;
     }
@@ -2361,7 +2357,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
      * exist; there must not be any missing index in between.
      */
     for (i = 0; i <= hostdev->info->addr.drive.controller; i++) {
-        if (!qemuDomainFindOrCreateSCSIDiskController(driver, vm, i))
+        if (!qemuDomainFindOrCreateSCSIDiskController(vm, i))
             return -1;
     }
 
@@ -2410,7 +2406,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
     if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
         goto cleanup;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (qemuMonitorAddDrive(priv->mon, drvstr) < 0)
         goto exit_monitor;
@@ -2419,7 +2415,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
     if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditHostdev(vm, hostdev, "attach", true);
@@ -2456,7 +2452,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
         virFreeError(orig_err);
     }
 
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     virDomainAuditHostdev(vm, hostdev, "attach", false);
 
     goto cleanup;
@@ -2510,8 +2506,7 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
 
 
 int
-qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
-                            virDomainObjPtr vm,
+qemuDomainAttachShmemDevice(virDomainObjPtr vm,
                             virDomainShmemDefPtr shmem)
 {
     int ret = -1;
@@ -2567,7 +2562,7 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (shmem->server.enabled) {
         if (qemuMonitorAttachCharDev(priv->mon, charAlias,
@@ -2587,7 +2582,7 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
     if (qemuMonitorAddDevice(priv->mon, shmstr) < 0)
         goto exit_monitor;
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
+    if (qemuDomainObjExitMonitor(vm) < 0) {
         release_address = false;
         goto cleanup;
     }
@@ -2627,7 +2622,7 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
         virFreeError(orig_err);
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         release_address = false;
 
     goto audit;
@@ -2725,8 +2720,7 @@ qemuDomainChangeNetFilter(virDomainObjPtr vm,
     return 0;
 }
 
-int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
-                                 virDomainObjPtr vm,
+int qemuDomainChangeNetLinkState(virDomainObjPtr vm,
                                  virDomainNetDefPtr dev,
                                  int linkstate)
 {
@@ -2741,7 +2735,7 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
 
     VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate);
     if (ret < 0)
@@ -2751,15 +2745,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
     dev->linkstate = linkstate;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     return ret;
 }
 
 int
-qemuDomainChangeNet(virQEMUDriverPtr driver,
-                    virDomainObjPtr vm,
+qemuDomainChangeNet(virDomainObjPtr vm,
                     virDomainDeviceDefPtr dev)
 {
     virDomainNetDefPtr newdev = dev->data.net;
@@ -3096,7 +3089,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     }
 
     if (needLinkStateChange &&
-        qemuDomainChangeNetLinkState(driver, vm, olddev, newdev->linkstate) < 0) {
+        qemuDomainChangeNetLinkState(vm, olddev, newdev->linkstate) < 0) {
         goto cleanup;
     }
 
@@ -3433,7 +3426,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
         }
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     qemuMonitorDriveDel(priv->mon, drivestr);
     VIR_FREE(drivestr);
@@ -3448,7 +3441,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
         ignore_value(qemuMonitorDelObject(priv->mon, encAlias));
     VIR_FREE(encAlias);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     virDomainAuditDisk(vm, disk->src, NULL, "detach", true);
@@ -3535,9 +3528,9 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
     if (virAsprintf(&backendAlias, "mem%s", mem->info.alias) < 0)
         return -1;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorDelObject(priv->mon, backendAlias);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         rc = -1;
 
     VIR_FREE(backendAlias);
@@ -3613,9 +3606,9 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
         if (!(drivealias = qemuAliasFromHostdev(hostdev)))
             goto cleanup;
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         qemuMonitorDriveDel(priv->mon, drivealias);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
     }
 
@@ -3714,10 +3707,10 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
         goto cleanup;
 
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
         if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto cleanup;
             virDomainAuditNet(vm, net, NULL, "detach", false);
             goto cleanup;
@@ -3730,7 +3723,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
                 virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                                _("unable to determine original VLAN"));
             }
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto cleanup;
             virDomainAuditNet(vm, net, NULL, "detach", false);
             goto cleanup;
@@ -3747,7 +3740,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
         }
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditNet(vm, net, NULL, "detach", true);
@@ -3838,7 +3831,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
 
     if (rc == 0) {
@@ -3848,7 +3841,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
             ignore_value(qemuMonitorDelObject(priv->mon, secAlias));
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditChardev(vm, chr, NULL, "detach", rc == 0);
@@ -3914,7 +3907,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
             goto cleanup;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     rc = qemuMonitorDelObject(priv->mon, objAlias);
 
@@ -3926,7 +3919,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
             ignore_value(qemuMonitorDelObject(priv->mon, secAlias));
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditRNG(vm, rng, NULL, "detach", rc == 0);
@@ -3980,14 +3973,14 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver,
             return -1;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     if (shmem->server.enabled)
         rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
     else
         rc = qemuMonitorDelObject(priv->mon, memAlias);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     virDomainAuditShmem(vm, shmem, "detach", rc == 0);
@@ -4211,14 +4204,14 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
         virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
         goto cleanup;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -4242,14 +4235,14 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
         virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
         goto cleanup;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -4419,12 +4412,12 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         goto cleanup;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -4436,8 +4429,7 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
 }
 
 static int
-qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
-                              virDomainObjPtr vm,
+qemuDomainDetachHostPCIDevice(virDomainObjPtr vm,
                               virDomainHostdevDefPtr detach)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -4461,17 +4453,16 @@ qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     return ret;
 }
 
 static int
-qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
-                              virDomainObjPtr vm,
+qemuDomainDetachHostUSBDevice(virDomainObjPtr vm,
                               virDomainHostdevDefPtr detach)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -4485,17 +4476,16 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     return ret;
 }
 
 static int
-qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
-                               virDomainObjPtr vm,
+qemuDomainDetachHostSCSIDevice(virDomainObjPtr vm,
                                virDomainHostdevDefPtr detach)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -4509,10 +4499,10 @@ qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     return ret;
@@ -4532,13 +4522,13 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
 
     switch (detach->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
-        ret = qemuDomainDetachHostPCIDevice(driver, vm, detach);
+        ret = qemuDomainDetachHostPCIDevice(vm, detach);
         break;
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
-        ret = qemuDomainDetachHostUSBDevice(driver, vm, detach);
+        ret = qemuDomainDetachHostUSBDevice(vm, detach);
         break;
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
-        ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach);
+        ret = qemuDomainDetachHostSCSIDevice(vm, detach);
         break;
     default:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -4668,11 +4658,11 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
     }
 
     qemuDomainMarkDeviceForRemoval(vm, &shmem->info);
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     ret = qemuMonitorDelDevice(priv->mon, shmem->info.alias);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret == 0) {
@@ -4750,14 +4740,14 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
         virDomainAuditNet(vm, detach, NULL, "detach", false);
         goto cleanup;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -4835,7 +4825,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
     }
 
  end_job:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
  cleanup:
     VIR_FREE(validTo);
@@ -4915,12 +4905,12 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         goto cleanup;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) {
@@ -4962,9 +4952,9 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &tmpRNG->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorDelDevice(priv->mon, tmpRNG->info.alias);
-    if (qemuDomainObjExitMonitor(driver, vm) || rc < 0)
+    if (qemuDomainObjExitMonitor(vm) || rc < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -5005,9 +4995,9 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceForRemoval(vm, &mem->info);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorDelDevice(priv->mon, mem->info.alias);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rc < 0)
         goto cleanup;
 
     if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
@@ -5103,11 +5093,11 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
 
     qemuDomainMarkDeviceAliasForRemoval(vm, vcpupriv->alias);
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     rc = qemuMonitorDelDevice(qemuDomainGetMonitor(vm), vcpupriv->alias);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     if (rc < 0) {
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index 85ec724..7f0bca7 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -33,8 +33,7 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
                                    virDomainDiskDefPtr disk,
                                    virStorageSourcePtr newsrc,
                                    bool force);
-int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
-                                     virDomainObjPtr vm,
+int qemuDomainAttachControllerDevice(virDomainObjPtr vm,
                                      virDomainControllerDefPtr controller);
 int qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
                                    virQEMUDriverPtr driver,
@@ -51,8 +50,7 @@ int qemuDomainAttachHostDevice(virConnectPtr conn,
                                virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainHostdevDefPtr hostdev);
-int qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
-                                virDomainObjPtr vm,
+int qemuDomainAttachShmemDevice(virDomainObjPtr vm,
                                 virDomainShmemDefPtr shmem);
 int qemuDomainFindGraphicsIndex(virDomainDefPtr def,
                                 virDomainGraphicsDefPtr dev);
@@ -71,11 +69,9 @@ int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
                                       virDomainGraphicsAuthDefPtr auth,
                                       const char *defaultPasswd,
                                       int asyncJob);
-int qemuDomainChangeNet(virQEMUDriverPtr driver,
-                        virDomainObjPtr vm,
+int qemuDomainChangeNet(virDomainObjPtr vm,
                         virDomainDeviceDefPtr dev);
-int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
-                                 virDomainObjPtr vm,
+int qemuDomainChangeNetLinkState(virDomainObjPtr vm,
                                  virDomainNetDefPtr dev,
                                  int linkstate);
 int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b029319..36ddfa0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -615,7 +615,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
                                                priv->job.asyncJob) < 0)
                 goto cleanup;
             rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats, false);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto cleanup;
             if (rc < 0)
                 goto cleanup;
@@ -1791,7 +1791,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
 
         if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, true) < 0)
             goto exit_monitor;
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
     }
 
@@ -1805,7 +1805,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
     return ret;
 
  exit_monitor:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto cleanup;
 }
 
@@ -1826,7 +1826,7 @@ qemuMigrationStopNBDServer(virQEMUDriverPtr driver,
 
     if (qemuMonitorNBDServerStop(priv->mon) < 0)
         VIR_WARN("Unable to stop NBD server");
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
@@ -1996,7 +1996,7 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
 
     rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias, true);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rv < 0)
         goto cleanup;
 
     ret = 0;
@@ -2179,7 +2179,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
         VIR_FREE(diskAlias);
         VIR_FREE(nbd_dest);
 
-        if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0) {
+        if (qemuDomainObjExitMonitor(vm) < 0 || mon_ret < 0) {
             qemuBlockJobSyncEnd(driver, vm, disk);
             goto cleanup;
         }
@@ -2508,7 +2508,7 @@ qemuMigrationSetOption(virQEMUDriverPtr driver,
     ret = qemuMonitorSetMigrationCapability(priv->mon, capability, state);
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     return ret;
 }
@@ -2595,7 +2595,7 @@ qemuMigrationFetchJobStatus(virQEMUDriverPtr driver,
     memset(&jobInfo->stats, 0, sizeof(jobInfo->stats));
     rv = qemuMonitorGetMigrationStats(priv->mon, &jobInfo->stats);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rv < 0)
         return -1;
 
     qemuMigrationUpdateJobType(jobInfo);
@@ -2929,7 +2929,7 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver,
         ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
                                           port, tlsPort, tlsSubject);
         priv->job.spiceMigration = !ret;
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
     }
 
@@ -3033,7 +3033,7 @@ qemuMigrationRunIncoming(virQEMUDriverPtr driver,
 
     rv = qemuMonitorMigrateIncoming(priv->mon, uri);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rv < 0)
         goto cleanup;
 
     if (asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) {
@@ -3494,7 +3494,7 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
     ret = 0;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     return ret;
@@ -3565,7 +3565,7 @@ qemuMigrationSetParams(virQEMUDriverPtr driver,
     ret = 0;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     return ret;
@@ -4765,7 +4765,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         /* explicitly do this *after* we entered the monitor,
          * as this is a critical section so we are guaranteed
          * priv->job.abortJob will not change */
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
         priv->job.current->type = VIR_DOMAIN_JOB_CANCELLED;
         virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
                        qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
@@ -4819,7 +4819,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         VIR_FORCE_CLOSE(spec->dest.fd.qemu);
         break;
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     if (ret < 0)
         goto cleanup;
@@ -4948,7 +4948,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
     return ret;
 
  exit_monitor:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     goto cleanup;
 
  cancel:
@@ -4958,7 +4958,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         if (qemuDomainObjEnterMonitorAsync(driver, vm,
                                            QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
             qemuMonitorMigrateCancel(priv->mon);
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
         }
     }
     goto cleanup;
@@ -6466,7 +6466,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
         qemuMonitorSetMigrationSpeed(priv->mon,
                                      QEMU_DOMAIN_MIG_BANDWIDTH_MAX);
         priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             return -1;
     }
 
@@ -6514,11 +6514,11 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
         if (virSetCloseExec(pipeFD[1]) < 0) {
             virReportSystemError(errno, "%s",
                                  _("Unable to set cloexec flag"));
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             goto cleanup;
         }
         if (virCommandRunAsync(cmd, NULL) < 0) {
-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
+            ignore_value(qemuDomainObjExitMonitor(vm));
             goto cleanup;
         }
         rc = qemuMonitorMigrateToFd(priv->mon,
@@ -6528,7 +6528,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
             VIR_CLOSE(pipeFD[1]) < 0)
             VIR_WARN("failed to close intermediate pipe");
     }
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
     if (rc < 0)
         goto cleanup;
@@ -6542,7 +6542,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
             if (virDomainObjIsActive(vm) &&
                 qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
                 qemuMonitorMigrateCancel(priv->mon);
-                ignore_value(qemuDomainObjExitMonitor(driver, vm));
+                ignore_value(qemuDomainObjExitMonitor(vm));
             }
         }
         goto cleanup;
@@ -6563,7 +6563,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
         qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
         qemuMonitorSetMigrationSpeed(priv->mon, saveMigBandwidth);
         priv->migMaxBandwidth = saveMigBandwidth;
-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+        ignore_value(qemuDomainObjExitMonitor(vm));
     }
 
     VIR_FORCE_CLOSE(pipeFD[0]);
@@ -6604,13 +6604,13 @@ qemuMigrationCancel(virQEMUDriverPtr driver,
         }
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
 
     ignore_value(qemuMonitorMigrateCancel(priv->mon));
     if (storage)
         blockJobs = qemuMonitorGetAllBlockJobInfo(priv->mon);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || (storage && !blockJobs))
+    if (qemuDomainObjExitMonitor(vm) < 0 || (storage && !blockJobs))
         goto endsyncjob;
 
     if (!storage) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d9776c4..2bf69d5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -533,10 +533,10 @@ qemuProcessFakeReboot(void *opaque)
         goto endjob;
     }
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     rc = qemuMonitorSystemReset(priv->mon);
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto endjob;
 
     if (rc < 0)
@@ -1738,7 +1738,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
     ret = 0;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     return ret;
 }
@@ -1976,7 +1976,7 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
         goto cleanup;
 
     ret = qemuMonitorGetChardevInfo(priv->mon, &info);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret < 0)
@@ -1990,8 +1990,7 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
 }
 
 static void
-qemuRefreshRTC(virQEMUDriverPtr driver,
-               virDomainObjPtr vm)
+qemuRefreshRTC(virDomainObjPtr vm)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     time_t now, then;
@@ -2003,10 +2002,10 @@ qemuRefreshRTC(virQEMUDriverPtr driver,
         return;
 
     memset(&thenbits, 0, sizeof(thenbits));
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     now = time(NULL);
     rv = qemuMonitorGetRTCTime(priv->mon, &thenbits);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         rv = -1;
 
     if (rv < 0)
@@ -2045,7 +2044,7 @@ qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
         return -1;
 
     rc = qemuMonitorGetBalloonInfo(qemuDomainGetMonitor(vm), &balloon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0 || rc < 0)
         return -1;
 
     vm->def->mem.cur_balloon = balloon;
@@ -2078,7 +2077,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
         goto cleanup;
     ret = qemuMonitorGetChardevInfo(priv->mon, &info);
     VIR_DEBUG("qemuMonitorGetChardevInfo returned %i", ret);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret == 0) {
@@ -2146,7 +2145,7 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
         goto cleanup;
     niothreads = qemuMonitorGetIOThreads(priv->mon, &iothreads);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto cleanup;
     if (niothreads < 0)
         goto cleanup;
@@ -2294,7 +2293,7 @@ qemuProcessSetLinkStates(virQEMUDriverPtr driver,
     ret = 0;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     return ret;
 }
@@ -2477,7 +2476,7 @@ qemuProcessInitPasswords(virConnectPtr conn,
         if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
             goto cleanup;
         ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             ret = -1;
         if (ret < 0)
             goto cleanup;
@@ -2601,7 +2600,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver,
 
     }
 
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     cfg = virQEMUDriverGetConfig(driver);
@@ -2611,7 +2610,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver,
     return ret;
 
  error:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
     return -1;
 }
 
@@ -2732,7 +2731,7 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
         goto release;
 
     ret = qemuMonitorStartCPUs(priv->mon, conn);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret < 0)
@@ -2766,7 +2765,7 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver,
         goto cleanup;
 
     ret = qemuMonitorStopCPUs(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
 
     if (ret < 0)
@@ -2827,7 +2826,7 @@ qemuProcessFiltersInstantiate(virDomainDefPtr def)
 }
 
 static int
-qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
+qemuProcessUpdateState(virDomainObjPtr vm)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainState state;
@@ -2839,9 +2838,9 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
     char *msg = NULL;
     int ret;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     ret = qemuMonitorGetStatus(priv->mon, &running, &reason);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         return -1;
 
     if (ret < 0)
@@ -3068,9 +3067,9 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver,
     case QEMU_ASYNC_JOB_SAVE:
     case QEMU_ASYNC_JOB_DUMP:
     case QEMU_ASYNC_JOB_SNAPSHOT:
-        qemuDomainObjEnterMonitor(driver, vm);
+        qemuDomainObjEnterMonitor(vm);
         ignore_value(qemuMonitorMigrateCancel(priv->mon));
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             return -1;
         /* resume the domain but only if it was paused as a result of
          * running a migration-to-file operation.  Although we are
@@ -3332,7 +3331,7 @@ qemuProcessReconnect(void *opaque)
             goto error;
     }
 
-    if (qemuProcessUpdateState(driver, obj) < 0)
+    if (qemuProcessUpdateState(obj) < 0)
         goto error;
 
     state = virDomainObjGetState(obj, &reason);
@@ -3395,7 +3394,7 @@ qemuProcessReconnect(void *opaque)
         goto error;
 
     /* If querying of guest's RTC failed, report error, but do not kill the domain. */
-    qemuRefreshRTC(driver, obj);
+    qemuRefreshRTC(obj);
 
     if (qemuProcessRefreshBalloonState(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
         goto error;
@@ -3702,7 +3701,7 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver,
         if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
             return false;
         rc = qemuMonitorGetGuestCPU(priv->mon, arch, &guestcpu);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             return false;
 
         if (rc < 0) {
@@ -4351,7 +4350,7 @@ qemuProcessSetupBalloon(virQEMUDriverPtr driver,
     ret = 0;
 
  cleanup:
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         ret = -1;
     return ret;
 }
@@ -4995,7 +4994,7 @@ qemuProcessSetupHotpluggableVcpus(virQEMUDriverPtr driver,
         rc = qemuMonitorAddDeviceArgs(qemuDomainGetMonitor(vm), vcpuprops);
         vcpuprops = NULL;
 
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
 
         if (rc < 0)
@@ -6367,14 +6366,14 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
         goto error;
 
     VIR_DEBUG("Getting initial memory amount");
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorGetBalloonInfo(priv->mon, &vm->def->mem.cur_balloon) < 0)
         goto exit_monitor;
     if (qemuMonitorGetStatus(priv->mon, &running, &reason) < 0)
         goto exit_monitor;
     if (qemuMonitorGetVirtType(priv->mon, &vm->def->virtType) < 0)
         goto exit_monitor;
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+    if (qemuDomainObjExitMonitor(vm) < 0)
         goto error;
 
     if (running) {
@@ -6383,10 +6382,10 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
         if (vm->def->memballoon &&
             vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO &&
             vm->def->memballoon->period) {
-            qemuDomainObjEnterMonitor(driver, vm);
+            qemuDomainObjEnterMonitor(vm);
             qemuMonitorSetMemoryStatsPeriod(priv->mon, vm->def->memballoon,
                                             vm->def->memballoon->period);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            if (qemuDomainObjExitMonitor(vm) < 0)
                 goto error;
         }
     } else {
@@ -6423,7 +6422,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
     return 0;
 
  exit_monitor:
-    ignore_value(qemuDomainObjExitMonitor(driver, vm));
+    ignore_value(qemuDomainObjExitMonitor(vm));
  error:
     /* We jump here if we failed to attach to the VM for any reason.
      * Leave the domain running, but pretend we never attempted to
@@ -6534,7 +6533,7 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver,
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
         table = qemuMonitorGetBlockInfo(priv->mon);
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+        if (qemuDomainObjExitMonitor(vm) < 0)
             goto cleanup;
     }
 
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 89e870c..61d942c 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -123,7 +123,7 @@ testQemuHotplugAttach(virDomainObjPtr vm,
         ret = qemuDomainAttachChrDevice(NULL, &driver, vm, dev->data.chr);
         break;
     case VIR_DOMAIN_DEVICE_SHMEM:
-        ret = qemuDomainAttachShmemDevice(&driver, vm, dev->data.shmem);
+        ret = qemuDomainAttachShmemDevice(vm, dev->data.shmem);
         break;
     default:
         VIR_TEST_VERBOSE("device type '%s' cannot be attached\n",
-- 
1.8.3.1

--
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]
  Powered by Linux