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 441bf5935..6f5b3337d 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 ddfc46dcd..5d856fb81 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 25ec464d3..44bd3ef9e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1690,6 +1690,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,
@@ -1718,6 +1740,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
.domainMigrationPass = qemuProcessHandleMigrationPass,
.domainAcpiOstInfo = qemuProcessHandleAcpiOstInfo,
.domainBlockThreshold = qemuProcessHandleBlockThreshold,
+ .domainDumpCompleted = qemuProcessHandleDumpCompleted,
};
static void
--
2.13.6