From nobody Thu Jul 3 15:35:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1495637285120758.0888219852743; Wed, 24 May 2017 07:48:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDC1E7D50A; Wed, 24 May 2017 14:47:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9592485DB5; Wed, 24 May 2017 14:47:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 22BC24A48E; Wed, 24 May 2017 14:47:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4OEkm5g022462 for ; Wed, 24 May 2017 10:46:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9DA8B7F8CD; Wed, 24 May 2017 14:46:48 +0000 (UTC) Received: from moe.brq.redhat.com (dhcp129-131.brq.redhat.com [10.34.129.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2379E7F8D1 for ; Wed, 24 May 2017 14:46:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CDC1E7D50A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CDC1E7D50A From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 24 May 2017 16:45:57 +0200 Message-Id: <42dcb84fe44240b4e2e36525f01cebbf4e87af8d.1495637025.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/3] virQEMUDriverDomainABIStability: Check for memoryBacking X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 24 May 2017 14:48:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1450349 Problem is, qemu fails to load guest memory image if these attribute change on migration/restore from an image. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 6 ++++++ src/qemu/qemu_conf.c | 2 +- src/qemu/qemu_domain.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 1 + 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d361454d5..a3ed2ad5b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -404,11 +404,15 @@ virDomainLockFailureTypeFromString; virDomainLockFailureTypeToString; virDomainMemballoonModelTypeFromString; virDomainMemballoonModelTypeToString; +virDomainMemoryAllocationTypeFromString; +virDomainMemoryAllocationTypeToString; virDomainMemoryDefFree; virDomainMemoryFindByDef; virDomainMemoryFindInactiveByDef; virDomainMemoryInsert; virDomainMemoryRemove; +virDomainMemorySourceTypeFromString; +virDomainMemorySourceTypeToString; virDomainNetAppendIPAddress; virDomainNetDefClear; virDomainNetDefFormat; @@ -690,6 +694,8 @@ virNodeDeviceEventUpdateNew; =20 =20 # conf/numa_conf.h +virDomainMemoryAccessTypeFromString; +virDomainMemoryAccessTypeToString; virDomainNumaCheckABIStability; virDomainNumaEquals; virDomainNumaFree; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 78f55c0e7..d8b88386d 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -910,7 +910,7 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver) return virDomainXMLOptionNew(&virQEMUDriverDomainDefParserConfig, &virQEMUDriverPrivateDataCallbacks, &virQEMUDriverDomainXMLNamespace, - NULL); + &virQEMUDriverDomainABIStability); } =20 =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 35fd79de8..c1ff8ca8a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5797,6 +5797,46 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr dr= iver, } =20 =20 +static bool +qemuDomainABIStabilityCheck(const virDomainDef *src, + const virDomainDef *dst) +{ + if (src->mem.source !=3D dst->mem.source) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memoryBacking source '%s' doesn't " + "match source memoryBacking source'%s'"), + virDomainMemorySourceTypeToString(dst->mem.source), + virDomainMemorySourceTypeToString(src->mem.source)); + return false; + } + + if (src->mem.access !=3D dst->mem.access) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memoryBacking access '%s' doesn't " + "match access memoryBacking access'%s'"), + virDomainMemoryAccessTypeToString(dst->mem.access), + virDomainMemoryAccessTypeToString(src->mem.access)); + return false; + } + + if (src->mem.allocation !=3D dst->mem.allocation) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memoryBacking allocation '%s' doesn't " + "match allocation memoryBacking allocation'%s'"), + virDomainMemoryAllocationTypeToString(dst->mem.allo= cation), + virDomainMemoryAllocationTypeToString(src->mem.allo= cation)); + return false; + } + + return true; +} + + +virDomainABIStability virQEMUDriverDomainABIStability =3D { + .domain =3D qemuDomainABIStabilityCheck, +}; + + bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, virDomainDefPtr src, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index aebd91ad3..829f7746e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -636,6 +636,7 @@ void qemuDomainCleanupRun(virQEMUDriverPtr driver, extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks; extern virDomainXMLNamespace virQEMUDriverDomainXMLNamespace; extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig; +extern virDomainABIStability virQEMUDriverDomainABIStability; =20 int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob); --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list