From nobody Sun Feb 8 19:30:39 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 172666708397684.41322668952932; Wed, 18 Sep 2024 06:44:43 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E6BF31BCF; Wed, 18 Sep 2024 09:44:42 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5C5371BA1; Wed, 18 Sep 2024 09:42:24 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 115601AD6; Wed, 18 Sep 2024 09:42:13 -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 8D9E81B10 for ; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-Fd09nUnNPlCbyWCBeuk8Kw-1; Wed, 18 Sep 2024 09:42:11 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb22d396cso54278275e9.0 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-42e704ed7f1sm17405625e9.20.2024.09.18.06.42.08 (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 AD0D424F687A; 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=1726666932; 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=S9QZV9aBro7ZcfvrDV4t9plRtGbQTwWKoCSOEv/AMDA=; b=UfyYJQMaFly/Kbky6xah5uBiYQnzcDmDnO10okOGFL6VIq0b1Fd96Y0BjR7W59/J+RWmE3 TnZsP+b1AyB0jANsF/qrZnOOoYgAsMjeBStxn4kU03PUMrhv5u2YAJ+LVCeQGuXp4oDTlz +lZhKhzuUNK+Qw3Yi+/evkd8rtNyTD8= X-MC-Unique: Fd09nUnNPlCbyWCBeuk8Kw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666930; x=1727271730; 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=S9QZV9aBro7ZcfvrDV4t9plRtGbQTwWKoCSOEv/AMDA=; b=DqaPswluRFUflO+nk+TtokqywhQCP2zqyTQFDSDvcPBBNUun2dV12XLxCxJOoIBA9+ m1m2WsgEK+qr1OH/MSWlP+j88GgTXVcVZ9BI3WrgZoiTMKkdhrfbzpzELk6i5o5P/tqZ RpJbHX3noe96cyX2LKSdUIsnoXJqMagMJ+BRPNz6s2CDsaJUSZ0wYciT2N8q+bro1LyY gnztao1iz5KMj8XegRhSEkN2M52PadHYzyn/v341W4IgZc0h48FZB2GkY6c/RyYVEKcq tfS4bVKtRHF62IuEDXf0fNI4IlK+oi9WL4un1Atn8R+sGug+gZtaLeRlVEkIIb37VMvx 2lTA== X-Gm-Message-State: AOJu0YxjuRnxFQGh7bMqlnhcXWFklFAszNC2jL91qqq8wlDj2Czc23oi 4qN4zXMwaSKfQkQbXDexsfUA4mfNZesCHwT6x4m65t4GZCNSGYmBjAAEc5k2CJO16KtMsKFv9eP 7QrwjeWJyFAnOHbyOVX1SZLOTU3Olyq7rKuZxUaTlDVyKjrT67ow6aGWiz2tJ+NY= X-Received: by 2002:a05:600c:4714:b0:426:602d:a246 with SMTP id 5b1f17b1804b1-42ce1429321mr162928905e9.32.1726666929776; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy8rBpDrbQIRiHMECz1p5+lVNOjuLVqdcwdODS5YZ1ln+LeFCXee4u7avoESUYVo7PdXSYMw== X-Received: by 2002:a05:600c:4714:b0:426:602d:a246 with SMTP id 5b1f17b1804b1-42ce1429321mr162928735e9.32.1726666929220; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 5/8] qemu_domain: Add qemuDomainSetPrivateMemPath() Date: Wed, 18 Sep 2024 15:42:03 +0200 Message-ID: <608ad7aa65b503f384338237ed4af0ecba6fe5f1.1726666238.git.mkletzan@redhat.com> 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: WHQFLDX7NF2J2LNKGXDPZS4RRJT6B54D X-Message-ID-Hash: WHQFLDX7NF2J2LNKGXDPZS4RRJT6B54D 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: 1726667085663116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This function sets the memoryBackingDir in qemuDomainObjPrivate struct so that it is remembered for the whole lifetime of a domain. Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d5c0c4b56834..577c53050651 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1735,6 +1735,27 @@ qemuDomainSecretPrepare(virQEMUDriver *driver, } =20 =20 +static void +qemuDomainSetPrivateMemPath(qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg, + const char *embedded_root, + const char *short_name) +{ + if (priv->memoryBackingDir) + return; + + if (embedded_root && !STRPREFIX(cfg->memoryBackingDir, embedded_root))= { + g_autofree char *hash =3D virDomainDriverGenerateRootHash("qemu", + embedded_r= oot); + priv->memoryBackingDir =3D g_strdup_printf("%s/%s-%s", + cfg->memoryBackingDir, + hash, short_name); + } else { + priv->memoryBackingDir =3D g_strdup_printf("%s/%s", cfg->memoryBac= kingDir, short_name); + } +} + + /* This is the old way of setting up per-domain directories */ static void qemuDomainSetPrivatePathsOld(virQEMUDriver *driver, --=20 2.46.0