提交 6cd15482 编写于 作者: E Eric Blake

qemu: endjob returns a bool

Osier Yang pointed out that ever since commit 31cb030a, the
signature of qemuDomainObjEndJob was changed to return a bool.
While comparison against 0 or > 0 still gives the right results,
it looks fishy; we also had one place that was comparing < 0
which is effectively dead code.

* src/qemu/qemu_migration.c (qemuMigrationPrepareAny): Fix dead
code bug.
(qemuMigrationBegin): Use more canonical form of bool check.
* src/qemu/qemu_driver.c (qemuAutostartDomain)
(qemuDomainCreateXML, qemuDomainSuspend, qemuDomainResume)
(qemuDomainShutdownFlags, qemuDomainReboot, qemuDomainReset)
(qemuDomainDestroyFlags, qemuDomainSetMemoryFlags)
(qemuDomainSetMemoryStatsPeriod, qemuDomainInjectNMI)
(qemuDomainSendKey, qemuDomainGetInfo, qemuDomainScreenshot)
(qemuDomainSetVcpusFlags, qemuDomainGetVcpusFlags)
(qemuDomainRestoreFlags, qemuDomainGetXMLDesc)
(qemuDomainCreateWithFlags, qemuDomainAttachDeviceFlags)
(qemuDomainUpdateDeviceFlags, qemuDomainDetachDeviceFlags)
(qemuDomainBlockResize, qemuDomainBlockStats)
(qemuDomainBlockStatsFlags, qemuDomainMemoryStats)
(qemuDomainMemoryPeek, qemuDomainGetBlockInfo)
(qemuDomainAbortJob, qemuDomainMigrateSetMaxDowntime)
(qemuDomainMigrateGetCompressionCache)
(qemuDomainMigrateSetCompressionCache)
(qemuDomainMigrateSetMaxSpeed)
(qemuDomainSnapshotCreateActiveInternal)
(qemuDomainRevertToSnapshot, qemuDomainSnapshotDelete)
(qemuDomainQemuMonitorCommand, qemuDomainQemuAttach)
(qemuDomainBlockJobImpl, qemuDomainBlockCopy)
(qemuDomainBlockCommit, qemuDomainOpenGraphics)
(qemuDomainGetBlockIoTune, qemuDomainGetDiskErrors)
(qemuDomainPMSuspendForDuration, qemuDomainPMWakeup)
(qemuDomainQemuAgentCommand, qemuDomainFSTrim): Likewise.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 7f626e47
...@@ -293,7 +293,7 @@ qemuAutostartDomain(virDomainObjPtr vm, ...@@ -293,7 +293,7 @@ qemuAutostartDomain(virDomainObjPtr vm,
err ? err->message : _("unknown error")); err ? err->message : _("unknown error"));
} }
if (qemuDomainObjEndJob(data->driver, vm) == 0) if (!qemuDomainObjEndJob(data->driver, vm))
vm = NULL; vm = NULL;
} }
...@@ -1612,7 +1612,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, ...@@ -1612,7 +1612,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE, VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
start_flags) < 0) { start_flags) < 0) {
virDomainAuditStart(vm, "booted", false); virDomainAuditStart(vm, "booted", false);
if (qemuDomainObjEndJob(driver, vm) > 0) if (qemuDomainObjEndJob(driver, vm))
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
...@@ -1637,7 +1637,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, ...@@ -1637,7 +1637,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
if (dom) if (dom)
dom->id = vm->def->id; dom->id = vm->def->id;
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -1722,7 +1722,7 @@ static int qemuDomainSuspend(virDomainPtr dom) { ...@@ -1722,7 +1722,7 @@ static int qemuDomainSuspend(virDomainPtr dom) {
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -1787,7 +1787,7 @@ static int qemuDomainResume(virDomainPtr dom) { ...@@ -1787,7 +1787,7 @@ static int qemuDomainResume(virDomainPtr dom) {
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -1882,7 +1882,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { ...@@ -1882,7 +1882,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) {
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -1992,7 +1992,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) ...@@ -1992,7 +1992,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2035,7 +2035,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) ...@@ -2035,7 +2035,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
priv->fakeReboot = false; priv->fakeReboot = false;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2121,15 +2121,14 @@ qemuDomainDestroyFlags(virDomainPtr dom, ...@@ -2121,15 +2121,14 @@ qemuDomainDestroyFlags(virDomainPtr dom,
virDomainAuditStop(vm, "destroyed"); virDomainAuditStop(vm, "destroyed");
if (!vm->persistent) { if (!vm->persistent) {
if (qemuDomainObjEndJob(driver, vm) > 0) if (qemuDomainObjEndJob(driver, vm))
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
vm = NULL; vm = NULL;
} }
ret = 0; ret = 0;
endjob: endjob:
if (vm && if (vm && !qemuDomainObjEndJob(driver, vm))
qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2274,7 +2273,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, ...@@ -2274,7 +2273,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2348,7 +2347,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period, ...@@ -2348,7 +2347,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2396,10 +2395,8 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags) ...@@ -2396,10 +2395,8 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
goto cleanup;
}
cleanup: cleanup:
if (vm) if (vm)
...@@ -2462,7 +2459,7 @@ static int qemuDomainSendKey(virDomainPtr domain, ...@@ -2462,7 +2459,7 @@ static int qemuDomainSendKey(virDomainPtr domain,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -2518,7 +2515,7 @@ static int qemuDomainGetInfo(virDomainPtr dom, ...@@ -2518,7 +2515,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
err = qemuMonitorGetBalloonInfo(priv->mon, &balloon); err = qemuMonitorGetBalloonInfo(priv->mon, &balloon);
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
} }
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm)) {
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
} }
...@@ -3670,7 +3667,7 @@ endjob: ...@@ -3670,7 +3667,7 @@ endjob:
unlink(tmp); unlink(tmp);
VIR_FREE(tmp); VIR_FREE(tmp);
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -4225,7 +4222,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, ...@@ -4225,7 +4222,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -4919,7 +4916,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) ...@@ -4919,7 +4916,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
qemuDomainObjExitAgent(vm); qemuDomainObjExitAgent(vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
if (ncpuinfo < 0) if (ncpuinfo < 0)
...@@ -5446,7 +5443,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, ...@@ -5446,7 +5443,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
if (virFileWrapperFdClose(wrapperFd) < 0) if (virFileWrapperFdClose(wrapperFd) < 0)
VIR_WARN("Failed to close %s", path); VIR_WARN("Failed to close %s", path);
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
else if (ret < 0 && !vm->persistent) { else if (ret < 0 && !vm->persistent) {
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
...@@ -5666,7 +5663,7 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom, ...@@ -5666,7 +5663,7 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm)) {
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
} }
...@@ -6065,7 +6062,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) ...@@ -6065,7 +6062,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -6937,7 +6934,7 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, ...@@ -6937,7 +6934,7 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -7081,7 +7078,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, ...@@ -7081,7 +7078,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -7219,7 +7216,7 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, ...@@ -7219,7 +7216,7 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -8917,7 +8914,7 @@ qemuDomainBlockResize(virDomainPtr dom, ...@@ -8917,7 +8914,7 @@ qemuDomainBlockResize(virDomainPtr dom,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -8993,7 +8990,7 @@ qemuDomainBlockStats(virDomainPtr dom, ...@@ -8993,7 +8990,7 @@ qemuDomainBlockStats(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -9161,7 +9158,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, ...@@ -9161,7 +9158,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
*nparams = tmp; *nparams = tmp;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -9556,7 +9553,7 @@ qemuDomainMemoryStats(virDomainPtr dom, ...@@ -9556,7 +9553,7 @@ qemuDomainMemoryStats(virDomainPtr dom,
} }
} }
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -9699,7 +9696,7 @@ qemuDomainMemoryPeek(virDomainPtr dom, ...@@ -9699,7 +9696,7 @@ qemuDomainMemoryPeek(virDomainPtr dom,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -9848,7 +9845,7 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom, ...@@ -9848,7 +9845,7 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
ret = 0; ret = 0;
} }
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
} else { } else {
ret = 0; ret = 0;
...@@ -11145,7 +11142,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) { ...@@ -11145,7 +11142,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) {
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -11196,7 +11193,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom, ...@@ -11196,7 +11193,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -11251,7 +11248,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom, ...@@ -11251,7 +11248,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -11307,7 +11304,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom, ...@@ -11307,7 +11304,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -11355,7 +11352,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, ...@@ -11355,7 +11352,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
priv->migMaxBandwidth = bandwidth; priv->migMaxBandwidth = bandwidth;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
} else { } else {
priv->migMaxBandwidth = bandwidth; priv->migMaxBandwidth = bandwidth;
...@@ -11708,7 +11705,7 @@ cleanup: ...@@ -11708,7 +11705,7 @@ cleanup:
} }
endjob: endjob:
if (vm && qemuDomainObjEndJob(driver, vm) == 0) { if (vm && !qemuDomainObjEndJob(driver, vm)) {
/* Only possible if a transient vm quit while our locks were down, /* Only possible if a transient vm quit while our locks were down,
* in which case we don't want to save snapshot metadata. */ * in which case we don't want to save snapshot metadata. */
*vmptr = NULL; *vmptr = NULL;
...@@ -13290,7 +13287,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, ...@@ -13290,7 +13287,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) { if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) {
if (!vm->persistent) { if (!vm->persistent) {
if (qemuDomainObjEndJob(driver, vm) > 0) if (qemuDomainObjEndJob(driver, vm))
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
...@@ -13317,7 +13314,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, ...@@ -13317,7 +13314,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
virDomainAuditStart(vm, "from-snapshot", rc >= 0); virDomainAuditStart(vm, "from-snapshot", rc >= 0);
if (rc < 0) { if (rc < 0) {
if (!vm->persistent) { if (!vm->persistent) {
if (qemuDomainObjEndJob(driver, vm) > 0) if (qemuDomainObjEndJob(driver, vm))
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
...@@ -13340,7 +13337,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, ...@@ -13340,7 +13337,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
ret = 0; ret = 0;
endjob: endjob:
if (vm && qemuDomainObjEndJob(driver, vm) == 0) if (vm && !qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -13506,7 +13503,7 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, ...@@ -13506,7 +13503,7 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -13559,7 +13556,7 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd, ...@@ -13559,7 +13556,7 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm)) {
vm = NULL; vm = NULL;
} }
...@@ -13641,7 +13638,7 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn, ...@@ -13641,7 +13638,7 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn,
if (qemuProcessAttach(conn, driver, vm, pid, if (qemuProcessAttach(conn, driver, vm, pid,
pidfile, monConfig, monJSON) < 0) { pidfile, monConfig, monJSON) < 0) {
if (qemuDomainObjEndJob(driver, vm) > 0) if (qemuDomainObjEndJob(driver, vm))
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
vm = NULL; vm = NULL;
monConfig = NULL; monConfig = NULL;
...@@ -13654,7 +13651,7 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn, ...@@ -13654,7 +13651,7 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn,
if (dom) if (dom)
dom->id = vm->def->id; dom->id = vm->def->id;
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -14149,7 +14146,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, ...@@ -14149,7 +14146,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
} }
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm)) {
vm = NULL; vm = NULL;
goto cleanup; goto cleanup;
} }
...@@ -14380,10 +14377,8 @@ endjob: ...@@ -14380,10 +14377,8 @@ endjob:
if (ret < 0) if (ret < 0)
disk->mirrorFormat = VIR_STORAGE_FILE_NONE; disk->mirrorFormat = VIR_STORAGE_FILE_NONE;
VIR_FREE(mirror); VIR_FREE(mirror);
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
goto cleanup;
}
cleanup: cleanup:
VIR_FREE(device); VIR_FREE(device);
...@@ -14572,10 +14567,8 @@ endjob: ...@@ -14572,10 +14567,8 @@ endjob:
top_parent, top_parent,
VIR_DISK_CHAIN_READ_ONLY); VIR_DISK_CHAIN_READ_ONLY);
} }
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
goto cleanup;
}
cleanup: cleanup:
VIR_FREE(device); VIR_FREE(device);
...@@ -14641,10 +14634,8 @@ qemuDomainOpenGraphics(virDomainPtr dom, ...@@ -14641,10 +14634,8 @@ qemuDomainOpenGraphics(virDomainPtr dom,
ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd", ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0); (flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
if (qemuDomainObjEndJob(driver, vm) == 0) { if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
goto cleanup;
}
cleanup: cleanup:
if (vm) if (vm)
...@@ -14956,7 +14947,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, ...@@ -14956,7 +14947,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
ret = 0; ret = 0;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -15030,7 +15021,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, ...@@ -15030,7 +15021,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
ret = n; ret = n;
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -15561,7 +15552,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, ...@@ -15561,7 +15552,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
qemuDomainObjExitAgent(vm); qemuDomainObjExitAgent(vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -15610,7 +15601,7 @@ qemuDomainPMWakeup(virDomainPtr dom, ...@@ -15610,7 +15601,7 @@ qemuDomainPMWakeup(virDomainPtr dom,
qemuDomainObjExitMonitor(driver, vm); qemuDomainObjExitMonitor(driver, vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -15696,7 +15687,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, ...@@ -15696,7 +15687,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
VIR_FREE(result); VIR_FREE(result);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
...@@ -15766,7 +15757,7 @@ qemuDomainFSTrim(virDomainPtr dom, ...@@ -15766,7 +15757,7 @@ qemuDomainFSTrim(virDomainPtr dom,
qemuDomainObjExitAgent(vm); qemuDomainObjExitAgent(vm);
endjob: endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
cleanup: cleanup:
......
...@@ -2125,7 +2125,7 @@ endjob: ...@@ -2125,7 +2125,7 @@ endjob:
if (qemuMigrationJobFinish(driver, vm) == 0) if (qemuMigrationJobFinish(driver, vm) == 0)
vm = NULL; vm = NULL;
} else { } else {
if (qemuDomainObjEndJob(driver, vm) == 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
} }
goto cleanup; goto cleanup;
...@@ -2334,7 +2334,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, ...@@ -2334,7 +2334,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
VIR_QEMU_PROCESS_START_PAUSED | VIR_QEMU_PROCESS_START_PAUSED |
VIR_QEMU_PROCESS_START_AUTODESTROY) < 0) { VIR_QEMU_PROCESS_START_AUTODESTROY) < 0) {
virDomainAuditStart(vm, "migrated", false); virDomainAuditStart(vm, "migrated", false);
if (qemuDomainObjEndJob(driver, vm) < 0) if (!qemuDomainObjEndJob(driver, vm))
vm = NULL; vm = NULL;
goto endjob; goto endjob;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册