From nobody Thu Sep 19 16:17:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1723760069; cv=none; d=zohomail.com; s=zohoarc; b=EFHEKEtTHo5cIIxMDZ0q46v5+H8rMxa0v7zJVFuztY2faChUsoduklubrLcDeYi3YnyOc4nCTMQO9tBLwBLIYdI7yRZAD3cIVCxxV6g2BF2FnyCm1LOk+wLRPtqc5zVRXjncgQqtQNOhfagkVi1os+Lza0yvtYN+u+0EJ5OUnJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723760069; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=03oWxCXvLnc6RVIj3k/kSbYt551BIwqm2eBKdRLDnD4=; b=V5ASg598vKFUu9f3Uah/HkWYvnXJTcEPkiTs0GiQaiYnhdFOcOAq56w1gXyeL/u2MD09YbHLmz6ywhvipM0zfLsTgdnz6ucS4bosIZvBj2XLd4XmLfeszkhBGlhOyDFZjOWwEprG8skd5RIhKFJ7I5aVD5QNFIfAf4NYUSnUt1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1723760069718278.33780465650784; Thu, 15 Aug 2024 15:14:29 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AB8E313EF; Thu, 15 Aug 2024 18:14:28 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 33E751525; Thu, 15 Aug 2024 18:13:26 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5927312ED; Thu, 15 Aug 2024 18:13:20 -0400 (EDT) Received: from mx0a-00190b01.pphosted.com (mx0a-00190b01.pphosted.com [67.231.149.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B576412B4 for ; Thu, 15 Aug 2024 18:13:19 -0400 (EDT) Received: from pps.filterd (m0409409.ppops.net [127.0.0.1]) by m0409409.ppops.net-00190b01. (8.18.1.2/8.18.1.2) with ESMTP id 47FASpNW029090; Thu, 15 Aug 2024 23:13:18 +0100 Received: from prod-mail-ppoint2 (prod-mail-ppoint2.akamai.com [184.51.33.19] (may be forged)) by m0409409.ppops.net-00190b01. (PPS) with ESMTPS id 41107rpsbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Aug 2024 23:13:18 +0100 (BST) Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.17.1.19/8.17.1.19) with ESMTP id 47FM7kGF000797; Thu, 15 Aug 2024 18:13:16 -0400 Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint2.akamai.com (PPS) with ESMTP id 40x3hyuhhr-1; Thu, 15 Aug 2024 18:13:16 -0400 Received: from bos-lhvcg5.bos01.corp.akamai.com (bos-lhvcg5.bos01.corp.akamai.com [172.28.222.58]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 666E133EE3; Thu, 15 Aug 2024 22:13:16 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=jan2016.eng; bh=k0Jyid+tH Fccoug3vsIyUk/akdF88v9Y3tSN8hmP/1Y=; b=hUo0dgqDPl+Pmkq1dWQaL5Fyc Ljcbxolz26d46bPS76uCQDjA/pNvC9vPI6kmjiAa8FQtAC87aDwG0IVp4jZRlWsc ctUxMDplNfaF8//b42xcm2S1XWbU7gIuwEp63vyJX6lUGKeGs9RnF/K+ufwpLxTs jC/2seqR/mwDdKZT0iv08MnF6HhPXoeNqvqjYZ6krDf/8RxZs4COJFdL9IAD/Pdu tCG+3ow/40SSpb/74ApFSRzNUkbFw4z0jO2mK6s2bws32qgrreB9rPD4UN0X11p4 cdA1kPZrewczjbv6BTQJ71fWYEhJoDQdoLA2gKpiTWlswyc1qt4JLKxhfruSA== To: devel@lists.libvirt.org Subject: [PATCH v3 2/4] Support live migration between file-backed memory and anonymous memory. Date: Thu, 15 Aug 2024 18:13:06 -0400 Message-Id: <20240815221308.3892813-3-mgalaxy@akamai.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815221308.3892813-1-mgalaxy@akamai.com> References: <20240815221308.3892813-1-mgalaxy@akamai.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-15_14,2024-08-15_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408150161 X-Proofpoint-GUID: n2grbnwyykuJ5LxULHoI_HPe2LX9bgC9 X-Proofpoint-ORIG-GUID: n2grbnwyykuJ5LxULHoI_HPe2LX9bgC9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-15_14,2024-08-15_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408150162 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AELTNZR4FMQXIUEUI4DFRA4CKP7CWTHD X-Message-ID-Hash: AELTNZR4FMQXIUEUI4DFRA4CKP7CWTHD X-MailFrom: mgalaxy@akamai.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: steven.sistare@oracle.com, johunt@akamai.com, cweng@akamai.com, bchaney@akamai.com, trakotoz@akamai.com, mkletzan@redhat.com, anthony.yznaga@oracle.com, mprivozn@redhat.com, Michael Galaxy X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Michael Galaxy via Devel Reply-To: mgalaxy@akamai.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1723760070708116600 Content-Type: text/plain; charset="utf-8" From: Michael Galaxy In our environment, we need to convert VMs into a live-update-comptabile configuration "on-the-fly" (via live migration). More specifically: We need to convert between anonymous memory-backed VMs and file-backed memory VMs. So, for this very specific case, this needs to work when host-level PMEM is being enabled. QEMU does not have a problem with this at all, but we need to relax the rules here a bit so that libvirt allows it to go through normally. Signed-off-by: Michael Galaxy --- src/qemu/qemu_domain.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f87ba6ba51..d574f6ab98 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8748,11 +8748,25 @@ qemuDomainABIStabilityCheck(const virDomainDef *src, size_t i; =20 if (src->mem.source !=3D dst->mem.source) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target memoryBacking source '%1$s' doesn't match= source memoryBacking source'%2$s'"), - virDomainMemorySourceTypeToString(dst->mem.source), - virDomainMemorySourceTypeToString(src->mem.source)); - return false; + /* + * The current use case for this is the live migration of live-upd= ate + * capable CPR guests mounted on PMEM devices at the host + * level (not in-guest PMEM). QEMU has no problem doing these kind= s of + * live migrations between these two memory backends, so let them = go through. + * This allows us to "upgrade" guests from regular memory to file-= backed + * memory seemlessly without taking them down. + */ + if (!((src->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_NONE + && dst->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) || + (src->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE + && dst->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_NONE)))= { + + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memoryBacking source '%1$s' doesn't m= atch source memoryBacking source'%2$s'"), + virDomainMemorySourceTypeToString(dst->mem.sour= ce), + virDomainMemorySourceTypeToString(src->mem.sour= ce)); + return false; + } } =20 for (i =3D 0; i < src->nmems; i++) { --=20 2.34.1