From 92f41b3297192c7e0e3ced63398e9c08f5f8cbd3 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 17 Oct 2017 10:42:54 +0200 Subject: [PATCH] qemuDomainABIStabilityCheck: Check for memory aliases too Since we will be allowing users to set device aliases and memory devices are fragile when it comes to aliases we have to make sure they won't change during migration. Other devices should be fine. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ece8ee7dd2..3b94db99f8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6428,6 +6428,8 @@ static bool qemuDomainABIStabilityCheck(const virDomainDef *src, const virDomainDef *dst) { + size_t i; + if (src->mem.source != dst->mem.source) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target memoryBacking source '%s' doesn't " @@ -6437,6 +6439,19 @@ qemuDomainABIStabilityCheck(const virDomainDef *src, return false; } + for (i = 0; i < src->nmems; i++) { + const char *srcAlias = src->mems[i]->info.alias; + const char *dstAlias = dst->mems[i]->info.alias; + + if (STRNEQ_NULLABLE(srcAlias, dstAlias)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memory device alias '%s' doesn't " + "match source alias '%s'"), + NULLSTR(srcAlias), NULLSTR(dstAlias)); + return false; + } + } + return true; } -- GitLab