qemu: Replace virDomainObjWait with qemuDomainObjWait

The qemu code will need to check other qemu-private conditions when
reporting success for waiting. Thus we must replace all use of it with a
qemu-specific helper. For now the helper forwards directly to
virDomainObjWait.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-08-10 15:35:54 +02:00
parent d3ddd432e2
commit b2f1daa36d
5 changed files with 19 additions and 9 deletions

View File

@ -2711,7 +2711,7 @@ qemuBlockStorageSourceCreateGeneric(virDomainObj *vm,
qemuBlockJobUpdate(vm, job, asyncJob);
while (qemuBlockJobIsRunning(job)) {
if (virDomainObjWait(vm) < 0)
if (qemuDomainObjWait(vm) < 0)
goto cleanup;
qemuBlockJobUpdate(vm, job, asyncJob);
}

View File

@ -11775,3 +11775,10 @@ qemuDomainRemoveLogs(virQEMUDriver *driver,
return 0;
}
int
qemuDomainObjWait(virDomainObj *vm)
{
return virDomainObjWait(vm);
}

View File

@ -1101,3 +1101,6 @@ qemuDomainDeviceBackendChardevForeach(virDomainDef *def,
int
qemuDomainRemoveLogs(virQEMUDriver *driver,
const char *name);
int
qemuDomainObjWait(virDomainObj *vm);

View File

@ -3020,7 +3020,7 @@ qemuDumpWaitForCompletion(virDomainObj *vm)
VIR_DEBUG("Waiting for dump completion");
while (!jobPriv->dumpCompleted && !priv->job.abortJob) {
if (virDomainObjWait(vm) < 0)
if (qemuDomainObjWait(vm) < 0)
return -1;
}
@ -14650,7 +14650,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
if (!async) {
qemuBlockJobUpdate(vm, job, VIR_ASYNC_JOB_NONE);
while (qemuBlockJobIsRunning(job)) {
if (virDomainObjWait(vm) < 0) {
if (qemuDomainObjWait(vm) < 0) {
ret = -1;
goto endjob;
}

View File

@ -927,7 +927,7 @@ qemuMigrationSrcNBDCopyCancel(virDomainObj *vm,
if (failed && !err)
virErrorPreserveLast(&err);
if (virDomainObjWait(vm) < 0)
if (qemuDomainObjWait(vm) < 0)
goto cleanup;
}
@ -1308,7 +1308,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
return -1;
}
if (virDomainObjWait(vm) < 0)
if (qemuDomainObjWait(vm) < 0)
return -1;
}
@ -1784,7 +1784,7 @@ qemuMigrationSrcWaitForSpice(virDomainObj *vm)
VIR_DEBUG("Waiting for SPICE to finish migration");
while (!jobPriv->spiceMigrated && !priv->job.abortJob) {
if (virDomainObjWait(vm) < 0)
if (qemuDomainObjWait(vm) < 0)
return -1;
}
return 0;
@ -2077,7 +2077,7 @@ qemuMigrationSrcWaitForCompletion(virDomainObj *vm,
if (rv < 0)
return rv;
if (virDomainObjWait(vm) < 0) {
if (qemuDomainObjWait(vm) < 0) {
if (virDomainObjIsActive(vm))
jobData->status = VIR_DOMAIN_JOB_STATUS_FAILED;
return -2;
@ -2114,7 +2114,7 @@ qemuMigrationDstWaitForCompletion(virDomainObj *vm,
flags = QEMU_MIGRATION_COMPLETED_POSTCOPY;
while ((rv = qemuMigrationAnyCompleted(vm, asyncJob, NULL, flags)) != 1) {
if (rv < 0 || virDomainObjWait(vm) < 0)
if (rv < 0 || qemuDomainObjWait(vm) < 0)
return -1;
}
@ -4951,7 +4951,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
*/
while (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
priv->signalStop = true;
rc = virDomainObjWait(vm);
rc = qemuDomainObjWait(vm);
priv->signalStop = false;
if (rc < 0)
goto error;