[[RFC] 5/8] Events: Plumb event handling calls before a domain's APIs complete.

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

 



Signed-off-by: Prerna Saxena <saxenap.ltc@xxxxxxxxx>
---
 src/qemu/qemu_driver.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 128 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8a005d0..b249347 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1900,6 +1900,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
 
     qemuDomainEventQueue(driver, event);
@@ -1967,6 +1968,7 @@ static int qemuDomainResume(virDomainPtr dom)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     qemuDomainEventQueue(driver, event);
     virObjectUnref(cfg);
@@ -2057,6 +2059,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2159,6 +2162,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2206,6 +2210,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2294,6 +2299,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     qemuDomainEventQueue(driver, event);
     return ret;
@@ -2307,6 +2313,7 @@ qemuDomainDestroy(virDomainPtr dom)
 
 static char *qemuDomainGetOSType(virDomainPtr dom) {
     virDomainObjPtr vm;
+    virQEMUDriverPtr driver = dom->conn->privateData;
     char *type = NULL;
 
     if (!(vm = qemuDomObjFromDomain(dom)))
@@ -2318,6 +2325,7 @@ static char *qemuDomainGetOSType(virDomainPtr dom) {
     ignore_value(VIR_STRDUP(type, virDomainOSTypeToString(vm->def->os.type)));
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return type;
 }
@@ -2328,6 +2336,7 @@ qemuDomainGetMaxMemory(virDomainPtr dom)
 {
     virDomainObjPtr vm;
     unsigned long long ret = 0;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     if (!(vm = qemuDomObjFromDomain(dom)))
         goto cleanup;
@@ -2338,6 +2347,7 @@ qemuDomainGetMaxMemory(virDomainPtr dom)
     ret = virDomainDefGetMemoryTotal(vm->def);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2455,6 +2465,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -2543,6 +2554,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -2583,6 +2595,7 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2646,6 +2659,7 @@ static int qemuDomainSendKey(virDomainPtr domain,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2702,6 +2716,7 @@ qemuDomainGetInfo(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -2739,6 +2754,7 @@ qemuDomainGetControlInfo(virDomainPtr dom,
     virDomainObjPtr vm;
     qemuDomainObjPrivatePtr priv;
     int ret = -1;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(0, -1);
 
@@ -2788,6 +2804,7 @@ qemuDomainGetControlInfo(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -3577,6 +3594,7 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
                                  compressedpath, dxml, flags);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(compressedpath);
     virObjectUnref(cfg);
@@ -3653,6 +3671,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
         vm->hasManagedSave = true;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(name);
     VIR_FREE(compressedpath);
@@ -3689,7 +3708,7 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
 {
     virDomainObjPtr vm = NULL;
     int ret = -1;
-
+    virQEMUDriverPtr driver = dom->conn->privateData;
     virCheckFlags(0, -1);
 
     if (!(vm = qemuDomObjFromDomain(dom)))
@@ -3701,6 +3720,7 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
     ret = vm->hasManagedSave;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -3736,6 +3756,7 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
 
  cleanup:
     VIR_FREE(name);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -3976,6 +3997,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
         qemuDomainRemoveInactiveJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     qemuDomainEventQueue(driver, event);
     return ret;
@@ -4078,6 +4100,7 @@ qemuDomainScreenshot(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -4832,6 +4855,7 @@ static void qemuProcessEventHandler(void *data, void *opaque)
         break;
     }
 
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(processEvent);
 }
@@ -4973,6 +4997,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -5144,6 +5169,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virBitmapFree(pcpumap);
     virObjectUnref(cfg);
@@ -5172,6 +5198,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
     bool live;
     int ret = -1;
     virBitmapPtr autoCpuset = NULL;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -5191,6 +5218,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
     ret = virDomainDefGetVcpuPinInfoHelper(def, maplen, ncpumaps, cpumaps,
                                            virHostCPUGetCount(), autoCpuset);
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -5302,6 +5330,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
     qemuDomainEventQueue(driver, event);
     VIR_FREE(str);
     virBitmapFree(pcpumap);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -5321,6 +5350,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
     virBitmapPtr cpumask = NULL;
     virBitmapPtr bitmap = NULL;
     virBitmapPtr autoCpuset = NULL;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -5359,6 +5389,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
     ret = 1;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virBitmapFree(bitmap);
     return ret;
@@ -5373,6 +5404,7 @@ qemuDomainGetVcpus(virDomainPtr dom,
 {
     virDomainObjPtr vm;
     int ret = -1;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     if (!(vm = qemuDomObjFromDomain(dom)))
         goto cleanup;
@@ -5390,6 +5422,7 @@ qemuDomainGetVcpus(virDomainPtr dom,
                                    NULL);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -5465,6 +5498,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
 
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(cpuinfo);
     return ret;
@@ -5649,6 +5683,7 @@ qemuDomainGetIOThreadInfo(virDomainPtr dom,
         ret = qemuDomainGetIOThreadsConfig(targetDef, info);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -5785,6 +5820,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
     qemuDomainEventQueue(driver, event);
     VIR_FREE(str);
     virBitmapFree(pcpumap);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -6098,6 +6134,7 @@ qemuDomainAddIOThread(virDomainPtr dom,
     ret = qemuDomainChgIOThread(driver, vm, iothread_id, true, flags);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -6130,6 +6167,7 @@ qemuDomainDelIOThread(virDomainPtr dom,
     ret = qemuDomainChgIOThread(driver, vm, iothread_id, false, flags);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -6178,6 +6216,7 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -6240,6 +6279,7 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
     }
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -6738,6 +6778,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
     virFileWrapperFdFree(wrapperFd);
     if (vm && ret < 0)
         qemuDomainRemoveInactiveJob(driver, vm);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virNWFilterUnlockFilterUpdates();
     return ret;
@@ -6893,6 +6934,7 @@ qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, unsigned int flags)
     virQEMUSaveDataFree(data);
     virDomainDefFree(def);
     VIR_FORCE_CLOSE(fd);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(path);
     return ret;
@@ -7045,6 +7087,8 @@ static char
     ret = qemuDomainFormatXML(driver, vm, flags);
 
  cleanup:
+    if (vm)
+        virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -7327,6 +7371,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
     qemuProcessEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virNWFilterUnlockFilterUpdates();
     return ret;
@@ -7421,6 +7466,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
  cleanup:
     virDomainDefFree(oldDef);
     virDomainDefFree(def);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     qemuDomainEventQueue(driver, event);
     virObjectUnref(caps);
@@ -7548,6 +7594,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(name);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     qemuDomainEventQueue(driver, event);
     virObjectUnref(cfg);
@@ -8471,6 +8518,7 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virNWFilterUnlockFilterUpdates();
     return ret;
@@ -8586,6 +8634,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
     if (dev != dev_copy)
         virDomainDeviceDefFree(dev_copy);
     virDomainDeviceDefFree(dev);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(caps);
     virObjectUnref(cfg);
@@ -8710,6 +8759,7 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -8725,7 +8775,7 @@ static int qemuDomainGetAutostart(virDomainPtr dom,
 {
     virDomainObjPtr vm;
     int ret = -1;
-
+    virQEMUDriverPtr driver = dom->conn->privateData;
     if (!(vm = qemuDomObjFromDomain(dom)))
         goto cleanup;
 
@@ -8736,6 +8786,7 @@ static int qemuDomainGetAutostart(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -8811,6 +8862,7 @@ static int qemuDomainSetAutostart(virDomainPtr dom,
  cleanup:
     VIR_FREE(configFile);
     VIR_FREE(autostartLink);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -8863,6 +8915,7 @@ static char *qemuDomainGetSchedulerType(virDomainPtr dom,
     ignore_value(VIR_STRDUP(ret, "posix"));
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -9258,6 +9311,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -9351,6 +9405,7 @@ qemuDomainGetBlkioParameters(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -9495,6 +9550,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -9582,6 +9638,7 @@ qemuDomainGetMemoryParameters(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -9772,6 +9829,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
 
  cleanup:
     virBitmapFree(nodeset);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -9792,6 +9850,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
     virDomainDefPtr def = NULL;
     bool live = false;
     virBitmapPtr autoNodeset = NULL;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG |
@@ -9852,6 +9911,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(nodeset);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -9969,6 +10029,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -10035,6 +10096,7 @@ qemuDomainGetPerfEvents(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virTypedParamsFree(par, npar);
     return ret;
@@ -10449,6 +10511,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
 
  cleanup:
     virDomainDefFree(persistentDefCopy);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     if (eventNparams)
         virTypedParamsFree(eventParams, eventNparams);
@@ -10694,6 +10757,7 @@ qemuDomainGetSchedulerParametersFlags(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -10793,6 +10857,7 @@ qemuDomainBlockResize(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(device);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -10938,6 +11003,7 @@ qemuDomainBlockStats(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     VIR_FREE(blockstats);
     return ret;
@@ -11024,6 +11090,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(blockstats);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -11033,6 +11100,7 @@ qemuDomainInterfaceStats(virDomainPtr dom,
                          const char *path,
                          virDomainInterfaceStatsPtr stats)
 {
+    virQEMUDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainNetDefPtr net = NULL;
     int ret = -1;
@@ -11066,6 +11134,7 @@ qemuDomainInterfaceStats(virDomainPtr dom,
 
     ret = 0;
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -11263,6 +11332,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
  cleanup:
     virNetDevBandwidthFree(bandwidth);
     virNetDevBandwidthFree(newBandwidth);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -11279,6 +11349,7 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom,
     virDomainObjPtr vm = NULL;
     virDomainDefPtr def = NULL;
     virDomainNetDefPtr net = NULL;
+    virQEMUDriverPtr driver = dom->conn->privateData;
     int ret = -1;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
@@ -11377,6 +11448,7 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom,
     ret = 0;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -11450,6 +11522,7 @@ qemuDomainMemoryStats(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -11598,6 +11671,7 @@ qemuDomainMemoryPeek(virDomainPtr dom,
     if (tmp)
         unlink(tmp);
     VIR_FREE(tmp);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -11898,6 +11972,7 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
  cleanup:
     VIR_FREE(alias);
     virHashFree(stats);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -13187,6 +13262,7 @@ qemuDomainGetJobInfo(virDomainPtr dom,
     ret = qemuDomainJobInfoToInfo(&jobInfo, info);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13232,6 +13308,7 @@ qemuDomainGetJobStats(virDomainPtr dom,
         VIR_FREE(priv->job.completed);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13295,6 +13372,7 @@ static int qemuDomainAbortJob(virDomainPtr dom)
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13339,6 +13417,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13393,6 +13472,7 @@ qemuDomainMigrateGetMaxDowntime(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13448,6 +13528,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13503,6 +13584,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13561,6 +13643,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
     }
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -13645,6 +13728,7 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -15142,6 +15226,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
     qemuDomainObjEndAsyncJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virDomainSnapshotDefFree(def);
     VIR_FREE(xml);
@@ -15209,6 +15294,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain,
 {
     virDomainObjPtr vm = NULL;
     int n = -1;
+    virQEMUDriverPtr driver = domain->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS |
                   VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1);
@@ -15222,6 +15308,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain,
     n = virDomainListSnapshots(vm->snapshots, NULL, domain, snaps, flags);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return n;
 }
@@ -15407,7 +15494,7 @@ qemuDomainSnapshotCurrent(virDomainPtr domain,
 {
     virDomainObjPtr vm;
     virDomainSnapshotPtr snapshot = NULL;
-
+    virQEMUDriverPtr driver = domain->conn->privateData;
     virCheckFlags(0, NULL);
 
     if (!(vm = qemuDomObjFromDomain(domain)))
@@ -15425,6 +15512,7 @@ qemuDomainSnapshotCurrent(virDomainPtr domain,
     snapshot = virGetDomainSnapshot(domain, vm->current_snapshot->def->name);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return snapshot;
 }
@@ -15459,6 +15547,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
                                      0);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return xml;
 }
@@ -15926,6 +16015,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
         qemuDomainEventQueue(driver, event);
         qemuDomainEventQueue(driver, event2);
     }
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(caps);
     virObjectUnref(cfg);
@@ -16087,6 +16177,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
@@ -16133,6 +16224,7 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -16241,6 +16333,7 @@ qemuDomainOpenConsole(virDomainPtr dom,
     size_t i;
     virDomainChrDefPtr chr = NULL;
     qemuDomainObjPrivatePtr priv;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_CONSOLE_SAFE |
                   VIR_DOMAIN_CONSOLE_FORCE, -1);
@@ -16307,6 +16400,7 @@ qemuDomainOpenConsole(virDomainPtr dom,
     }
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -16322,6 +16416,7 @@ qemuDomainOpenChannel(virDomainPtr dom,
     size_t i;
     virDomainChrDefPtr chr = NULL;
     qemuDomainObjPrivatePtr priv;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     virCheckFlags(VIR_DOMAIN_CHANNEL_FORCE, -1);
 
@@ -16381,6 +16476,7 @@ qemuDomainOpenChannel(virDomainPtr dom,
     }
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -16606,6 +16702,7 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
     VIR_FREE(basePath);
     VIR_FREE(backingPath);
     VIR_FREE(device);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -16836,6 +16933,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -16902,6 +17000,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
 
     return ret;
@@ -17219,6 +17318,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
     dest = NULL;
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virStorageSourceFree(dest);
     return ret;
@@ -17625,6 +17725,7 @@ qemuDomainOpenGraphics(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -17702,6 +17803,7 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom,
  cleanup:
     VIR_FORCE_CLOSE(pair[0]);
     VIR_FORCE_CLOSE(pair[1]);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18121,6 +18223,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
  cleanup:
     VIR_FREE(info.group_name);
     VIR_FREE(device);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     if (eventNparams)
         virTypedParamsFree(eventParams, eventNparams);
@@ -18282,6 +18385,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
  cleanup:
     VIR_FREE(reply.group_name);
     VIR_FREE(device);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18353,6 +18457,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virHashFree(table);
     if (ret < 0) {
@@ -18406,6 +18511,7 @@ qemuDomainSetMetadata(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virObjectUnref(caps);
     virObjectUnref(cfg);
@@ -18420,6 +18526,7 @@ qemuDomainGetMetadata(virDomainPtr dom,
 {
     virDomainObjPtr vm;
     char *ret = NULL;
+    virQEMUDriverPtr driver = dom->conn->privateData;
 
     if (!(vm = qemuDomObjFromDomain(dom)))
         return NULL;
@@ -18430,6 +18537,7 @@ qemuDomainGetMetadata(virDomainPtr dom,
     ret = virDomainObjGetMetadata(vm, type, uri, flags);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18447,6 +18555,7 @@ qemuDomainGetCPUStats(virDomainPtr domain,
     int ret = -1;
     qemuDomainObjPrivatePtr priv;
     virBitmapPtr guestvcpus = NULL;
+    virQEMUDriverPtr driver = domain->conn->privateData;
 
     virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
 
@@ -18482,6 +18591,7 @@ qemuDomainGetCPUStats(virDomainPtr domain,
                                       start_cpu, ncpus, guestvcpus);
  cleanup:
     virBitmapFree(guestvcpus);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18569,6 +18679,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18617,6 +18728,7 @@ qemuDomainPMWakeup(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -18683,6 +18795,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return result;
 }
@@ -18972,6 +19085,7 @@ qemuDomainGetTime(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -19054,6 +19168,7 @@ qemuDomainSetTime(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -19092,6 +19207,7 @@ qemuDomainFSFreeze(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -19136,6 +19252,7 @@ qemuDomainFSThaw(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20235,6 +20352,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     virDomainDefFree(def);
     virObjectUnref(caps);
@@ -20295,6 +20413,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
     }
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20443,6 +20562,7 @@ qemuDomainSetUserPassword(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20585,6 +20705,7 @@ static int qemuDomainRename(virDomainPtr dom,
     qemuDomainObjEndJob(driver, vm);
 
  cleanup:
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20698,6 +20819,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(info);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20785,6 +20907,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom,
  cleanup:
     VIR_FREE(info);
     virBitmapFree(map);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20858,6 +20981,7 @@ qemuDomainSetVcpu(virDomainPtr dom,
 
  cleanup:
     virBitmapFree(map);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
@@ -20931,6 +21055,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
 
  cleanup:
     VIR_FREE(nodename);
+    virDomainConsumeVMEvents(vm, driver);
     virDomainObjEndAPI(&vm);
     return ret;
 }
-- 
2.9.5

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