From: Peter Krempa Date: Mon, 19 Jan 2015 13:28:14 +0000 (+0100) Subject: qemu: migration: Forbid migration with memory modules lacking info X-Git-Tag: v1.2.14-rc1~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5710066e87dc8d563e9dcf9c0af9585319a0a54;p=thirdparty%2Flibvirt.git qemu: migration: Forbid migration with memory modules lacking info Make sure that libvirt has all vital information needed to reliably represent configuration of guest's memory devices in case of a migration. This patch forbids migration in case the required slot number and module base address are not present (failed to be loaded from qemu via monitor). --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index f542087567..d34bb02dc4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2021,6 +2021,20 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm, } } + /* Verify that memory device config can be transferred reliably */ + for (i = 0; i < def->nmems; i++) { + virDomainMemoryDefPtr mem = def->mems[i]; + + if (mem->model == VIR_DOMAIN_MEMORY_MODEL_DIMM && + mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain's dimm info lacks slot ID " + "or base address")); + + return false; + } + } + return true; }