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(a)redhat.com>
---
src/qemu/qemu_block.c | 2 +-
src/qemu/qemu_domain.c | 7 +++++++
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_migration.c | 12 ++++++------
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 9fe22f18f2..bd95fe8a1f 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -2713,7 +2713,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);
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bc5961a09f..f68b7030c5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11780,3 +11780,10 @@ qemuDomainRemoveLogs(virQEMUDriver *driver,
return 0;
}
+
+
+int
+qemuDomainObjWait(virDomainObj *vm)
+{
+ return virDomainObjWait(vm);
+}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 4680df1098..ce59c3e766 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1108,3 +1108,6 @@ qemuDomainDeviceBackendChardevForeach(virDomainDef *def,
int
qemuDomainRemoveLogs(virQEMUDriver *driver,
const char *name);
+
+int
+qemuDomainObjWait(virDomainObj *vm);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 019ec4a035..254957deba 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3033,7 +3033,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;
}
@@ -14707,7 +14707,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;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 9eda279a84..b05bbce910 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -933,7 +933,7 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriver *driver,
if (failed && !err)
virErrorPreserveLast(&err);
- if (virDomainObjWait(vm) < 0)
+ if (qemuDomainObjWait(vm) < 0)
goto cleanup;
}
@@ -1321,7 +1321,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
return -1;
}
- if (virDomainObjWait(vm) < 0)
+ if (qemuDomainObjWait(vm) < 0)
return -1;
}
@@ -1798,7 +1798,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;
@@ -2096,7 +2096,7 @@ qemuMigrationSrcWaitForCompletion(virQEMUDriver *driver,
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;
@@ -2135,7 +2135,7 @@ qemuMigrationDstWaitForCompletion(virQEMUDriver *driver,
while ((rv = qemuMigrationAnyCompleted(driver, vm, asyncJob,
NULL, flags)) != 1) {
- if (rv < 0 || virDomainObjWait(vm) < 0)
+ if (rv < 0 || qemuDomainObjWait(vm) < 0)
return -1;
}
@@ -4983,7 +4983,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;
--
2.37.1