From nobody Sat Nov 23 18:17:20 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=1722978219; cv=none; d=zohomail.com; s=zohoarc; b=OgHfDmjUFeyebpCPjiJkfa/ZL7MxTH6NXWML2RD2/obuP/+O4vjghJZ+z2knufQHnasyulMPWkdm0ezOdVXhWhvaYAzAfDoR2RcvJ/M+a3s9nQlaf67H2M95D+Up3xc3BEIw67mzliamcLtoy9cLYlnrm3J2rDFlfz3+aitwI+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722978219; 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=YmcWP1TjjdpPGB7MQ5U/8JqAD65P4mUwSwOii3JeSaI=; b=DoI0G8U9xDLSxEwR+iHicX+9JdCuSNNHjuvcD64g8ucejSvkrwl3ca3DaZdiw1glo3rXUcJKa9M/eu7EinS5j65lBiaK4LQACn69EGSlaM1GIX2MOipfapivIqhIQtP/lC2lVHMMw9f1KReiXkeozpB3haccXGBLgYsBGMLuZyg= 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 1722978219723728.8230842550452; Tue, 6 Aug 2024 14:03:39 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7D1EBC2F; Tue, 6 Aug 2024 17:03:38 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B1E03C84; Tue, 6 Aug 2024 17:03:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EE0CFB93; Tue, 6 Aug 2024 17:03:14 -0400 (EDT) Received: from mx0b-00190b01.pphosted.com (mx0b-00190b01.pphosted.com [67.231.157.127]) (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 0495BBA1 for ; Tue, 6 Aug 2024 17:03:13 -0400 (EDT) Received: from pps.filterd (m0409411.ppops.net [127.0.0.1]) by m0409411.ppops.net-00190b01. (8.18.1.2/8.18.1.2) with ESMTP id 476Ihr4o005250; Tue, 6 Aug 2024 21:32:31 +0100 Received: from prod-mail-ppoint5 (prod-mail-ppoint5.akamai.com [184.51.33.60] (may be forged)) by m0409411.ppops.net-00190b01. (PPS) with ESMTPS id 40ur6q2h5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Aug 2024 21:32:31 +0100 (BST) Received: from pps.filterd (prod-mail-ppoint5.akamai.com [127.0.0.1]) by prod-mail-ppoint5.akamai.com (8.17.1.19/8.17.1.19) with ESMTP id 476EYXD4009884; Tue, 6 Aug 2024 13:32:30 -0700 Received: from prod-mail-relay10.akamai.com ([172.27.118.251]) by prod-mail-ppoint5.akamai.com (PPS) with ESMTP id 40sjhb319r-1; Tue, 06 Aug 2024 13:32:30 -0700 Received: from bos-lhvcg5.bos01.corp.akamai.com (bos-lhvcg5.bos01.corp.akamai.com [172.28.222.58]) by prod-mail-relay10.akamai.com (Postfix) with ESMTP id B1B2C65885; Tue, 6 Aug 2024 20:32:29 +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=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable 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=UqEPjmc6a Tz396UkIb6TXmD2UHi2/kYOPRK5R+oF9HQ=; b=bvKvhgigaMPsEqcJfqN2YjzNG FfoQt1JWgyne9uGN6f794caep1b6t9LGwaRza15a0TRLcGf7sbmsc+C+t9zXQC78 ikzSnuCBy/Ft8HpqDkpWI/jFx20tzGwzwWhLL6K44A3GNCMQnuHB+FqTTzSwMKW+ Go6mmBy2KHrXRfRIwHmtNO/5uVS1x2rU3lJmQ8AAAWFGHLHgwNvEITW9pi4Cd4pX 2DO7XRfsQawZ0LVzTN88oTrTo1mG2Sf1742yu1lKo9KRVOcOYC/ApWrPL9mk+oBu se/IGOKuyXTBe4aBc/LELRJadl4RETVCSveDoHN+ki4J2bLPir2R6bNMTUq1w== To: devel@lists.libvirt.org Subject: [PATCH RESEND v2 2/4] Support live migration between file-backed memory and anonymous memory. Date: Tue, 6 Aug 2024 16:32:19 -0400 Message-Id: <20240806203221.3673616-3-mgalaxy@akamai.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806203221.3673616-1-mgalaxy@akamai.com> References: <20240806203221.3673616-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-06_16,2024-08-06_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408060143 X-Proofpoint-GUID: ajGbMtnz-1FXY1Nj2h4kE8hKii92eBY0 X-Proofpoint-ORIG-GUID: ajGbMtnz-1FXY1Nj2h4kE8hKii92eBY0 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-06_16,2024-08-06_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408060143 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JOXDVDV2UFSQQCFQY3Y4HFJXGDB2B7ML X-Message-ID-Hash: JOXDVDV2UFSQQCFQY3Y4HFJXGDB2B7ML 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, mgalaxy@akamai.com 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: 1722978219886116600 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 bda62f2e5c..93e98f8dae 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8641,11 +8641,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