Add a couple of booleans to mark when there's a dump completion event
waiting and when a dump completed event has been received.
To ensure the dump completed event from a non memory-only dump doesn't
cause the a dump completed event to be fired, only broadcast if there's
a completion event waiting.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_domain.c | 2 ++
src/qemu/qemu_domain.h | 2 ++
src/qemu/qemu_process.c | 23 +++++++++++++++++++++++
3 files changed, 27 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e8e03134f..41da30eb8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -334,6 +334,8 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv)
job->spiceMigration = false;
job->spiceMigrated = false;
job->postcopyEnabled = false;
+ job->dumpCompletion = false;
+ job->dumpCompleted = false;
VIR_FREE(job->current);
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index c33af3671..441edb6dd 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -164,6 +164,8 @@ struct qemuDomainJobObj {
* should wait for it to finish */
bool spiceMigrated; /* spice migration completed */
bool postcopyEnabled; /* post-copy migration was enabled */
+ bool dumpCompletion; /* waiting for dump completion */
+ bool dumpCompleted; /* dump completed */
};
typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ea70885dd..d1c4c2175 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1687,6 +1687,28 @@ qemuProcessHandleMigrationPass(qemuMonitorPtr mon
ATTRIBUTE_UNUSED,
}
+static int
+qemuProcessHandleDumpCompleted(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm,
+ qemuMonitorDumpStatus status,
+ void *opaque ATTRIBUTE_UNUSED)
+{
+ qemuDomainObjPrivatePtr priv;
+
+ virObjectLock(vm);
+
+ VIR_DEBUG("Dump completed for domain %p %s with status=%s",
+ vm, vm->def->name, qemuMonitorDumpStatusTypeToString(status));
+
+ priv = vm->privateData;
+ priv->job.dumpCompleted = true;
+ if (priv->job.dumpCompletion)
+ virDomainObjBroadcast(vm);
+ virObjectUnlock(vm);
+ return 0;
+}
+
+
static qemuMonitorCallbacks monitorCallbacks = {
.eofNotify = qemuProcessHandleMonitorEOF,
.errorNotify = qemuProcessHandleMonitorError,
@@ -1715,6 +1737,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
.domainMigrationPass = qemuProcessHandleMigrationPass,
.domainAcpiOstInfo = qemuProcessHandleAcpiOstInfo,
.domainBlockThreshold = qemuProcessHandleBlockThreshold,
+ .domainDumpCompleted = qemuProcessHandleDumpCompleted,
};
static void
--
2.13.6