From nobody Sun Feb 8 03:28:54 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 1726667179052735.3220574534375; Wed, 18 Sep 2024 06:46:19 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 098331B10; Wed, 18 Sep 2024 09:46:18 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2019A1BD8; Wed, 18 Sep 2024 09:42:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 120841B9F; Wed, 18 Sep 2024 09:42:15 -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 58FDA1AFC for ; Wed, 18 Sep 2024 09:42:14 -0400 (EDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-z9TpJLUBNaylMZKR4KKtmg-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42cb5b01c20so40345905e9.1 for ; Wed, 18 Sep 2024 06:42:10 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e705162b0sm17331495e9.34.2024.09.18.06.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:42:08 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id A0DC624F6879; Wed, 18 Sep 2024 15:42:07 +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.5 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=1726666934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lm77bTFL4mzai24tIl8cq5R2qnSsnAegaxqiqlmz6Os=; b=KpVCWPomZG8AA5Fb2EN8cOA16D/Ne76Tisqri39waHs5Vj5OsEAW0WgKLZT5MKH7NIxuXA Q1rvRVVQRW578Cs37s+YVh06P82bWm3GOV+/YiPzfEBdkDiqcQ1iqMv7shisuEs+OI4qTM 3IbeKr/iSxfbsRqGmCD0lHztbE7xIzY= X-MC-Unique: z9TpJLUBNaylMZKR4KKtmg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666929; x=1727271729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lm77bTFL4mzai24tIl8cq5R2qnSsnAegaxqiqlmz6Os=; b=vwnKeQsROQ6VVhyU6ivO/Shr3FN+3urvMv44BuEK19j8X4LP0RZg4dmYPf+Gkzr6W0 fiLzApxCV0TIad/8ClZZQe5d26JVJ1FTjDSuo9ozH7R8SlOHjDRV+RYRbrLuj9sovacb ngQ5m2T4NhU/l5clpUqCQczeGy6MQVUWinN6TUZzVJbXojCcg4+travCI0eReelnCloC OAHA3GRg7l63b59O21jJsW6hIzxpF95jo6zhwqd5xw7Z+j3ynJJQnx99rf/mv16ZKLV1 cQMEUdHfDTUmDUxavNB+deOieliqa04xdpij1Wb5aKWjHSGxtuycL8f8x9nrmH2e8KKG n4WA== X-Gm-Message-State: AOJu0Yy4Ao79cRmjdjZ95uxmG3BLVZ0I+VpYjCAczkUJcjurY5kwU5JI AMFmWnYe7k1N2MnnjEgdjtPUfGR/acH/YsCDbk9PoGU45iT4+7mZJBnd+c9pFCxYmFX/Ob6Ov9y XEqznX6abbiLrXjmyZyTS3EH9ztHlRagfaWAKOeyNNLuC0MY2spGR0+tnX9YOAcU= X-Received: by 2002:a5d:4dc6:0:b0:374:af59:427d with SMTP id ffacd0b85a97d-378d625a26dmr9796588f8f.49.1726666929408; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ5yKKOz+GkurGyz7YrtPzk34D94UouAr7uDRLEgCYgVaKm/Y9SxJr/BHy7GagzTm26BS7PA== X-Received: by 2002:a5d:4dc6:0:b0:374:af59:427d with SMTP id ffacd0b85a97d-378d625a26dmr9796569f8f.49.1726666928985; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 4/8] qemu_domain: Add memoryBackingDir to qemuDomainObjPrivate Date: Wed, 18 Sep 2024 15:42:02 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 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: 6ZQ7Z76MIOQ7EDARAXEY2Q6DMDGH3STP X-Message-ID-Hash: 6ZQ7Z76MIOQ7EDARAXEY2Q6DMDGH3STP 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 CC: 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726667180400116600 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 e3db3ee903c0..d5c0c4b56834 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1875,6 +1875,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 @@ -2649,6 +2651,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 @@ -3370,6 +3373,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 6cc4c14f74d3..b0fcbdd4673b 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 + +
+ + +
+ + + + +