mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
qemu: do not check return value of qemuDomainObjExitMonitor
Remove the check from conditions where it's coupled with some other checks. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
d7b23755ef
commit
57d665b390
@ -474,7 +474,8 @@ qemuBackupDiskPrepareOneStorage(virDomainObj *vm,
|
||||
|
||||
rc = qemuBlockStorageSourceAttachApply(priv->mon, dd->crdata->srcdata[0]);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -888,7 +889,8 @@ qemuBackupBegin(virDomainObj *vm,
|
||||
if (rc == 0)
|
||||
rc = qemuMonitorTransaction(priv->mon, &actions);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
job_started = true;
|
||||
@ -1158,7 +1160,8 @@ qemuBackupGetJobInfoStats(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorGetJobInfo(priv->mon, &blockjobs, &nblockjobs);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* count in completed jobs */
|
||||
|
@ -326,7 +326,9 @@ qemuBlockNodeNamesDetect(virQEMUDriver *driver,
|
||||
data = qemuMonitorQueryNamedBlockNodes(qemuDomainGetMonitor(vm));
|
||||
blockstats = qemuMonitorQueryBlockstats(qemuDomainGetMonitor(vm));
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !data || !blockstats)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (!data || !blockstats)
|
||||
return -1;
|
||||
|
||||
if (!(disktable = qemuBlockNodeNameGetBackingChain(data, blockstats)))
|
||||
@ -2711,7 +2713,8 @@ qemuBlockStorageSourceCreateGeneric(virDomainObj *vm,
|
||||
rc = qemuMonitorBlockdevCreate(priv->mon, job->name, props);
|
||||
props = NULL;
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
qemuBlockJobStarted(job, vm);
|
||||
@ -2857,7 +2860,8 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
|
||||
|
||||
rc = qemuBlockStorageSourceAttachApplyStorageDeps(priv->mon, data);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuBlockStorageSourceCreateStorage(vm, src, chain, asyncJob) < 0)
|
||||
@ -2871,7 +2875,8 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
|
||||
if (rc == 0)
|
||||
rc = qemuBlockStorageSourceAttachApplyFormatDeps(priv->mon, data);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuBlockStorageSourceCreateFormat(vm, src, backingStore, chain,
|
||||
@ -2889,7 +2894,8 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
|
||||
|
||||
rc = qemuBlockStorageSourceAttachApplyFormat(priv->mon, data);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -3021,7 +3027,9 @@ qemuBlockGetNamedNodeData(virDomainObj *vm,
|
||||
|
||||
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon, supports_flat);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockNamedNodeData)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (!blockNamedNodeData)
|
||||
return NULL;
|
||||
|
||||
return g_steal_pointer(&blockNamedNodeData);
|
||||
@ -3377,7 +3385,8 @@ qemuBlockReopenFormat(virDomainObj *vm,
|
||||
|
||||
rc = qemuBlockReopenFormatMon(priv->mon, src);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
@ -507,7 +507,8 @@ qemuBlockJobRefreshJobs(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorGetJobInfo(priv->mon, &jobinfo, &njobinfo);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; i < njobinfo; i++) {
|
||||
|
@ -524,7 +524,8 @@ qemuCheckpointCreate(virQEMUDriver *driver,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorTransaction(qemuDomainGetMonitor(vm), &actions);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) {
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0) {
|
||||
qemuCheckpointRollbackMetadata(vm, chk);
|
||||
return NULL;
|
||||
}
|
||||
@ -734,7 +735,8 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm,
|
||||
if (rc == 0)
|
||||
rc = qemuMonitorTransaction(priv->mon, &mergeactions);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
/* now do a final refresh */
|
||||
@ -746,7 +748,8 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm,
|
||||
|
||||
rc = qemuMonitorTransaction(priv->mon, &cleanupactions);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
/* update disks */
|
||||
|
@ -9628,7 +9628,9 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver,
|
||||
QEMU_CAPS_QUERY_CPUS_FAST);
|
||||
haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus,
|
||||
fast);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !haltedmap)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (!haltedmap)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < maxvcpus; i++) {
|
||||
|
@ -2391,7 +2391,8 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
priv = vm->privateData;
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
r = qemuMonitorSetBalloon(priv->mon, newmem);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || r < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (r < 0)
|
||||
goto endjob;
|
||||
|
||||
/* Lack of balloon support is a fatal error */
|
||||
@ -3129,7 +3130,8 @@ qemuDumpToFd(virQEMUDriver *driver,
|
||||
|
||||
ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, detach);
|
||||
|
||||
if ((qemuDomainObjExitMonitor(driver, vm) < 0) || ret < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
if (detach)
|
||||
@ -10004,7 +10006,9 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver,
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats);
|
||||
}
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (nstats < 0 || rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
*retstats = g_new0(qemuBlockStats, 1);
|
||||
@ -12576,7 +12580,8 @@ qemuDomainGetJobInfoDumpStats(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorQueryDump(priv->mon, &stats);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
jobInfo->stats.dump = stats;
|
||||
@ -12912,7 +12917,8 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
|
||||
} else {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorSetMigrationDowntime(priv->mon, downtime);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -13027,7 +13033,8 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
|
||||
} else {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -13092,7 +13099,8 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
|
||||
} else {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorSetMigrationCacheSize(priv->mon, cacheSize);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -13180,7 +13188,8 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -14666,7 +14675,9 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
blockjobstats = qemuMonitorGetAllBlockJobInfo(qemuDomainGetMonitor(vm), true);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockjobstats)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (!blockjobstats)
|
||||
goto endjob;
|
||||
|
||||
rawInfo = g_hash_table_lookup(blockjobstats, job->name);
|
||||
@ -15590,10 +15601,10 @@ qemuDomainBlockCommit(virDomainPtr dom,
|
||||
topPath, nodetop, basePath, nodebase,
|
||||
backingPath, speed);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || ret < 0) {
|
||||
ret = -1;
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (ret < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (mirror) {
|
||||
disk->mirror = g_steal_pointer(&mirror);
|
||||
@ -16613,8 +16624,8 @@ qemuDomainProbeQMPCurrentMachine(virQEMUDriver *driver,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rv = qemuMonitorGetCurrentMachineInfo(priv->mon, &info);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 ||
|
||||
rv < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rv < 0)
|
||||
return -1;
|
||||
|
||||
*wakeupSupported = info.wakeupSuspendSupport;
|
||||
@ -19687,7 +19698,8 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorSetBlockThreshold(priv->mon, nodename, threshold);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
/* we need to remember whether the threshold was registered with an explicit
|
||||
@ -19802,7 +19814,8 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *vm,
|
||||
QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
|
||||
QEMU_MONITOR_ACTION_PANIC_KEEP);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
@ -280,7 +280,8 @@ qemuDomainChangeMediaLegacy(virQEMUDriver *driver,
|
||||
/* re-issue ejection command to pop out the media */
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorEjectMedia(priv->mon, driveAlias, false);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
} else {
|
||||
@ -432,7 +433,8 @@ qemuHotplugAttachManagedPR(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorAddObject(priv->mon, &props, NULL);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -529,7 +531,8 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
|
||||
if (diskPriv->tray && disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorBlockdevTrayOpen(priv->mon, diskPriv->qomName, force);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (!force && qemuHotplugWaitForTrayEject(vm, disk) < 0)
|
||||
@ -567,7 +570,8 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
|
||||
if (rc < 0 && newbackend)
|
||||
qemuBlockStorageSourceChainDetach(priv->mon, newbackend);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -2779,7 +2783,8 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriver *driver,
|
||||
ignore_value(qemuMonitorCloseFileHandle(priv->mon, vhostfdName));
|
||||
if (removeextension)
|
||||
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, hostdev->info));
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || ret < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (ret < 0)
|
||||
goto audit;
|
||||
|
||||
vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
|
||||
|
@ -750,7 +750,8 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriver *driver,
|
||||
* consistency on the destination so that we can force cancel the mirror */
|
||||
rv = qemuMonitorBlockJobCancel(priv->mon, job->name, abortMigration);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rv < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -963,7 +964,8 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriver *driver,
|
||||
if (mon_ret != 0)
|
||||
qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), data);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (mon_ret < 0)
|
||||
return -1;
|
||||
|
||||
diskPriv->migrSource = g_steal_pointer(©src);
|
||||
@ -1004,7 +1006,8 @@ qemuMigrationSrcNBDStorageCopyDriveMirror(virQEMUDriver *driver,
|
||||
diskAlias, nbd_dest, "raw",
|
||||
mirror_speed, 0, 0, mirror_shallow, true);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (mon_ret < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -1673,7 +1676,8 @@ qemuMigrationAnyFetchStats(virQEMUDriver *driver,
|
||||
|
||||
rv = qemuMonitorGetMigrationStats(priv->mon, &stats, error);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rv < 0)
|
||||
return -1;
|
||||
|
||||
jobInfo->stats.mig = stats;
|
||||
@ -2140,7 +2144,8 @@ qemuMigrationDstRun(virQEMUDriver *driver,
|
||||
rv = qemuMonitorMigrateIncoming(priv->mon, uri);
|
||||
|
||||
exit_monitor:
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rv < 0)
|
||||
return -1;
|
||||
|
||||
if (asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) {
|
||||
@ -3930,7 +3935,8 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObj *vm,
|
||||
|
||||
rc = qemuMonitorTransaction(priv->mon, &actions);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
jobPriv->migTempBitmaps = g_steal_pointer(&tmpbitmaps);
|
||||
@ -4240,7 +4246,8 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
break;
|
||||
}
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
goto error;
|
||||
|
||||
/* From this point onwards we *must* call cancel to abort the
|
||||
@ -6247,7 +6254,8 @@ qemuMigrationSrcFetchMirrorStats(virQEMUDriver *driver,
|
||||
|
||||
blockinfo = qemuMonitorGetAllBlockJobInfo(priv->mon, false);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockinfo)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (!blockinfo)
|
||||
return -1;
|
||||
|
||||
memset(stats, 0, sizeof(*stats));
|
||||
|
@ -496,7 +496,8 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
|
||||
else
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < vm->def->ndisks; i++) {
|
||||
|
@ -1079,7 +1079,8 @@ qemuMigrationParamsFetch(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorGetMigrationParams(priv->mon, &jsonParams);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (!(*migParams = qemuMigrationParamsFromJSON(jsonParams)))
|
||||
@ -1379,7 +1380,8 @@ qemuMigrationCapsCheck(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorGetMigrationCapabilities(priv->mon, &caps);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (!caps)
|
||||
|
@ -2372,7 +2372,8 @@ qemuProcessRefreshBalloonState(virQEMUDriver *driver,
|
||||
return -1;
|
||||
|
||||
rc = qemuMonitorGetBalloonInfo(qemuDomainGetMonitor(vm), &balloon);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
/* We want the balloon size stored in domain definition to
|
||||
@ -4457,7 +4458,8 @@ qemuProcessFetchCPUDefinitions(virQEMUDriver *driver,
|
||||
|
||||
rc = virQEMUCapsFetchCPUModels(priv->mon, vm->def->os.arch, &models);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
*cpuModels = g_steal_pointer(&models);
|
||||
@ -7127,7 +7129,8 @@ qemuProcessSetupDisksTransientHotplug(virDomainObj *vm,
|
||||
|
||||
rc = qemuMonitorSystemReset(priv->mon);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -7178,7 +7181,8 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
|
||||
QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
|
||||
QEMU_MONITOR_ACTION_PANIC_KEEP);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(priv->driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -8390,7 +8394,8 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *driver,
|
||||
|
||||
rc = qemuMonitorGetCPUMigratable(priv->mon, &migratable);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (rc == 1)
|
||||
@ -8547,7 +8552,9 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriver *driver,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
blockJobs = qemuMonitorGetAllBlockJobInfo(qemuDomainGetMonitor(vm), true);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockJobs)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (!blockJobs)
|
||||
goto cleanup;
|
||||
|
||||
if (virHashForEach(blockJobs, qemuProcessRefreshLegacyBlockjob, vm) < 0)
|
||||
|
@ -1032,7 +1032,8 @@ qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriver *driver,
|
||||
rc = qemuBlockStorageSourceAttachApply(qemuDomainGetMonitor(vm),
|
||||
dd->crdata->srcdata[0]);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
} else {
|
||||
if (qemuBlockStorageSourceCreateDetectSize(blockNamedNodeData,
|
||||
|
Loading…
Reference in New Issue
Block a user