Introduced in QEMU's commit of v2.6.0-rc0~74^2~6 the
DUMP_COMPLETED event is always available for all QEMU versions we
support (4.2.0, currently). Therefore, we can assume the
capability is always set and thus doesn't need to be checked for.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 56b809617a..bcdd55b089 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3033,28 +3033,21 @@ qemuDumpToFd(virQEMUDriver *driver,
const char *dumpformat)
{
qemuDomainObjPrivate *priv = vm->privateData;
- bool detach = false;
- int ret = -1;
-
- detach = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DUMP_COMPLETED);
+ int rc = -1;
if (qemuSecuritySetImageFDLabel(driver->securityManager, vm->def, fd) < 0)
return -1;
- if (detach) {
- qemuDomainJobSetStatsType(vm->job->current,
- QEMU_DOMAIN_JOB_STATS_TYPE_MEMDUMP);
- } else {
- g_clear_pointer(&vm->job->current, virDomainJobDataFree);
- }
+ qemuDomainJobSetStatsType(vm->job->current,
+ QEMU_DOMAIN_JOB_STATS_TYPE_MEMDUMP);
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
return -1;
if (dumpformat) {
- ret = qemuMonitorGetDumpGuestMemoryCapability(priv->mon, dumpformat);
+ rc = qemuMonitorGetDumpGuestMemoryCapability(priv->mon, dumpformat);
- if (ret <= 0) {
+ if (rc <= 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported dumpformat '%s' "
"for this QEMU binary"),
@@ -3064,16 +3057,13 @@ qemuDumpToFd(virQEMUDriver *driver,
}
}
- ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, detach);
+ rc = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, true);
qemuDomainObjExitMonitor(vm);
- if (ret < 0)
+ if (rc < 0)
return -1;
- if (detach)
- ret = qemuDumpWaitForCompletion(vm);
-
- return ret;
+ return qemuDumpWaitForCompletion(vm);
}
--
2.37.4