From nobody Sun Feb 8 18:11:45 2026 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1727092203230889.3301926869516; Mon, 23 Sep 2024 04:50:03 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 97A8116EA; Mon, 23 Sep 2024 07:50:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6C55215EE; Mon, 23 Sep 2024 07:48:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1FCC113F1; Mon, 23 Sep 2024 07:48:06 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 1F5251414 for ; Mon, 23 Sep 2024 07:48:05 -0400 (EDT) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-xx6sd7JmMRWZM27TvR-uGQ-1; Mon, 23 Sep 2024 07:48:03 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a8d2f475416so317176266b.0 for ; Mon, 23 Sep 2024 04:48:03 -0700 (PDT) Received: from wheatley.localdomain (37-188-137-5.red.o2.cz. [37.188.137.5]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90610966aasm1210538466b.26.2024.09.23.04.48.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:48:01 -0700 (PDT) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 8EDFC26732EB for ; Mon, 23 Sep 2024 13:48:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, 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=redhat.com; s=mimecast20190719; t=1727092084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D6Yioyqm2+SutVO7we4SQAFKzM+YbLDmj9sEvAzPmr4=; b=Mpe8Pu4SD29br0SxHFPa0dUN7kmqGiY5/QenMBaV/PtDTFPkD4bPAVPES7woq0lrD69pOq aI907x8t5YitJJxafC5C22gy87lSedqBz4hQSpGehF4slOAun5y7qOlv80DsAYcjKoTAaP B6/ZgxdkrtQGDb/xIGzIW/sRmflfsN0= X-MC-Unique: xx6sd7JmMRWZM27TvR-uGQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092082; x=1727696882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D6Yioyqm2+SutVO7we4SQAFKzM+YbLDmj9sEvAzPmr4=; b=eTBgCQ6MLq7K+uYga9FYPUKN1/2iP06s7qLm+Rl7bDrKuUj87hC5ImHT/NZM6hRMGj ylk45AmnnJaaO8Ags0+LpuURLc/X+sNGPYEM/zzZ7ysmM6bbifenJD3aVY9xlX84T1TZ FrkztU0A1uFBcZ0rnQnM9mFzTulRt7bTM4fTRFQ70xFPTpumpmvMT0WGCQkaiOhN1j2w BEJ4kOz6uAyOpKSKviegsekTH/8VoIviYCaxKJXS7ms9a7FNTGjNYXtvN1EjclBTYMvv l/fkkO5kJaHdiDTtcaGOchCb9d5fBOE6S8QqYIaJkksvd1Lo8oHEsLAQ4ohvUjr91o6A cOcw== X-Gm-Message-State: AOJu0Yyv7GgdrML1VY5ijokop6PigZE8kv6oz6gX/SADNDbK1hw5s6Ot 9I57jmOcNBSaIWtf5PNCe9FVadrAjreg0qzzmGLsuBiDZ6H7zA5cMiYY+CyFaJB43MhbzxXkHIS GcAB1lPpXaFICyUpTt1EK3rAToCE8wOYPYCfTHg8rdrXoAgAP2Ex3FLeHuG8d1l7Bq+UyfNNoyi xyf54dU7mbhlSvmeiJixseba/AqeEP8icsgDmO4Gc= X-Received: by 2002:a17:907:6095:b0:a86:842a:104a with SMTP id a640c23a62f3a-a90d515b2bcmr1268437966b.57.1727092082549; Mon, 23 Sep 2024 04:48:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzCl2Vk2Kw1ls/jIfbfFxzWYDyigHlcgNQDgu1ocXUDDoNU5Qj8b0h6sCCOdlq7wkD/ksWWQ== X-Received: by 2002:a17:907:6095:b0:a86:842a:104a with SMTP id a640c23a62f3a-a90d515b2bcmr1268435966b.57.1727092082112; Mon, 23 Sep 2024 04:48:02 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH v2 3/8] qemu: Add memoryBackingDir to qemuDomainObjPrivate Date: Mon, 23 Sep 2024 13:47:53 +0200 Message-ID: <00e6e68d53c6d6d2eb4eb595d209ce6f970c6441.1727092045.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7CIWLHX2F56TIDWYLS474DB3TIWT54YH X-Message-ID-Hash: 7CIWLHX2F56TIDWYLS474DB3TIWT54YH X-MailFrom: mkletzan@redhat.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 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1727092204602116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This way we _can_ (but do not, yet) remember the memory backing path for running domains even after configuration change and daemon restart. Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 5 ++ src/qemu/qemu_domain.h | 2 + .../memory-backing-dir-in.xml | 61 +++++++++++++++++++ .../memory-backing-dir-out.xml | 1 + tests/qemuxmlactivetest.c | 2 + 5 files changed, 71 insertions(+) create mode 100644 tests/qemustatusxml2xmldata/memory-backing-dir-in.xml create mode 120000 tests/qemustatusxml2xmldata/memory-backing-dir-out.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9a2ce910a5c8..76bcb70a5699 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1934,6 +1934,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *p= riv) g_slist_free_full(g_steal_pointer(&priv->threadContextAliases), g_free= ); =20 priv->migrationRecoverSetup =3D false; + + g_clear_pointer(&priv->memoryBackingDir, g_free); } =20 =20 @@ -2708,6 +2710,7 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf, virBufferEscapeString(buf, "\n", priv->libDir); virBufferEscapeString(buf, "\n", priv->channelTargetDir); + virBufferEscapeString(buf, "\n", priv->= memoryBackingDir); =20 virCPUDefFormatBufFull(buf, priv->origCPU, NULL); =20 @@ -3429,6 +3432,8 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, priv->channelTargetDir =3D tmp; tmp =3D NULL; =20 + priv->memoryBackingDir =3D virXPathString("string(./memoryBackingDir/@= path)", ctxt); + qemuDomainSetPrivatePathsOld(driver, vm); =20 if (virCPUDefParseXML(ctxt, "./cpu", VIR_CPU_TYPE_GUEST, &priv->origCP= U, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 355a9e1cb21e..8f41c4af81c0 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -261,6 +261,8 @@ struct _qemuDomainObjPrivate { =20 /* named file descriptor groups associated with the VM */ GHashTable *fds; + + char *memoryBackingDir; }; =20 #define QEMU_DOMAIN_PRIVATE(vm) \ diff --git a/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml b/tests/= qemustatusxml2xmldata/memory-backing-dir-in.xml new file mode 100644 index 000000000000..eea671a41c0d --- /dev/null +++ b/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + testtest + + + + + + + + + + + + + + + + -2 + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + +
+ + +
+ + + + +