From 8f8bba115d5ced7e764074161276e89595cd6be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 8 Aug 2019 18:55:08 +0400 Subject: [PATCH] qemu-migration: prevent migration if dbus-vmstate is required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 6ff956b1f5..d1553b126a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1105,6 +1105,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, bool remote, unsigned int flags) { + qemuDomainObjPrivatePtr priv = vm->privateData; int nsnapshots; int pauseReason; size_t i; @@ -1131,7 +1132,13 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, _("cannot migrate domain with I/O error")); return false; } + } + if (virHashSize(priv->dbusVMStates) > 0 && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain requires dbus-vmstate support")); + return false; } /* following checks don't make sense for offline migration */