From nobody Tue Feb 10 04:18:37 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 1726667041250804.1321662839503; Wed, 18 Sep 2024 06:44:01 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 374BB1B7E; Wed, 18 Sep 2024 09:44:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6CB2F1BDE; Wed, 18 Sep 2024 09:42:22 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 998EC1B0F; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 131DC1AFC for ; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-EBS4DwCdM8WXtR58Z3LKAA-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3789c3541e9so2937478f8f.2 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 ffacd0b85a97d-378e72e49bfsm12353649f8f.21.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 9550924F6878; 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=1726666931; 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=coH4S0pqRiLv+fD7BMyqEPaXlzzNIMcE+CpW66AqmHw=; b=NYxBuYZx7FoPe1fyeQ8WSbMkDlUn+b2bGkW3zyXF2DVRy4sfLg8Mc4PjeYa0SJHVDYpIHe 1wKMb1hxLz9uQOJildTmxQboEL3WZdhj8HoA4hGznoDhq/hCwBhpWrt0niyQn7daA8U4ZB sF+AFPWLvLV+mJuUqrf+VqcNUd8b0lg= X-MC-Unique: EBS4DwCdM8WXtR58Z3LKAA-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=coH4S0pqRiLv+fD7BMyqEPaXlzzNIMcE+CpW66AqmHw=; b=vDEyAYb7Pqnpzn01UsT7y81/HzUl93tNrSXL7l7DUynLkInt6CjCDwwWJIFMyZup/c qiKshYBLnHQ5LUby8fR+YD03O+XgvHuQPRqekDvWGFqigppFlyWkKaahj6zE0iOVONnI duBP3b8yIpIZqRPXNwONtKalEzp7uBg5UARRjm2KnA1SvqQUVCR37DYGdZJrdWr1Oe9Z Nu8Nrhtli/xyqwQtFJ8Tpwq5ceuXXoyRbFL4lwQWqJpbhzn1P/WF9TNJot1/Imc2BLwG utPm/okPRW/nn4xyMCTu6GJRkEvs+eeoY7POvRdOe1fthVXM0JlbPnBToPf17SxWSteI XKmQ== X-Gm-Message-State: AOJu0YwcNsluYnQTogfsEz/roekdda8zFc/bgDPiiAGvm0VGPP2N/qpG JrRxe92L1INzgOvFuS8SNw6QuIXUIVjae07ycNsFzF0tqq/QpamxNPdj0Htujwkdc7Lw0EUO86l eHG/XA3Yp5hc+gqTLOYcnL4rPACORB4/6q2vsSa/M9CmewZU44rbxQZ8= X-Received: by 2002:adf:e988:0:b0:374:c2e9:28bc with SMTP id ffacd0b85a97d-378c2d0625cmr14352170f8f.21.1726666929256; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjk3WyEcBe5G16HmJ7UnRjG72DP1Pbz/f8gWmFi4LKL4/kW9lRHFfQjkxKS0DSRrA319egYw== X-Received: by 2002:adf:e988:0:b0:374:c2e9:28bc with SMTP id ffacd0b85a97d-378c2d0625cmr14352143f8f.21.1726666928758; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 3/8] qemu: Change parameters of qemuGetMemoryBackingDomainPath() Date: Wed, 18 Sep 2024 15:42:01 +0200 Message-ID: <017652c5095b6289de3611b8eec4df810616f546.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: 2BQEFD6RVUBDBL3FE54FTN2EIAFN36DF X-Message-ID-Hash: 2BQEFD6RVUBDBL3FE54FTN2EIAFN36DF 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: 1726667041509116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This way it does not use driver, since it will be later reworked and the following patches cleaner, hopefully. Signed-off-by: Martin Kletzander --- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 7 ++++--- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 7 +++---- src/qemu/qemu_process.h | 3 +-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1b992d8eed7a..5d24439a6ff6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3421,7 +3421,7 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPro= ps, } else { /* We can have both pagesize and mem source. If that's the cas= e, * prefer hugepages as those are more specific. */ - if (qemuGetMemoryBackingPath(priv->driver, def, mem->info.alia= s, &memPath) < 0) + if (qemuGetMemoryBackingPath(priv, def, mem->info.alias, &memP= ath) < 0) return -1; } =20 @@ -7315,7 +7315,7 @@ qemuBuildMemPathStr(const virDomainDef *def, return -1; prealloc =3D true; } else if (def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) { - if (qemuGetMemoryBackingPath(priv->driver, def, "ram", &mem_path) = < 0) + if (qemuGetMemoryBackingPath(priv, def, "ram", &mem_path) < 0) return -1; } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 550ab5046f00..e3db3ee903c0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -13146,10 +13146,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConf= ig *cfg, =20 =20 int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path) { + virQEMUDriver *driver =3D priv->driver; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); const char *root =3D driver->embeddedRoot; g_autofree char *shortName =3D NULL; @@ -13181,7 +13182,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *drive= r, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath) @@ -13195,7 +13196,7 @@ qemuGetMemoryBackingPath(virQEMUDriver *driver, return -1; } =20 - if (qemuGetMemoryBackingDomainPath(driver, def, &domainPath) < 0) + if (qemuGetMemoryBackingDomainPath(priv, def, &domainPath) < 0) return -1; =20 *memPath =3D g_strdup_printf("%s/%s", domainPath, alias); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6681246c2338..6cc4c14f74d3 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1170,11 +1170,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfig= *cfg, virStorageSource *src); =20 int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path); int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 75b97cf7367b..4ada4179dd7f 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2354,7 +2354,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, qemuDomainObjExitMonitor(vm); =20 if (objAdded && mem) - ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem)); + ignore_value(qemuProcessDestroyMemoryBackingPath(vm, mem)); =20 virErrorRestore(&orig_err); if (!mem) @@ -4649,7 +4649,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriver *driver, if (qemuDomainNamespaceTeardownMemory(vm, mem) < 0) VIR_WARN("Unable to remove memory device from /dev"); =20 - if (qemuProcessDestroyMemoryBackingPath(driver, vm, mem) < 0) + if (qemuProcessDestroyMemoryBackingPath(vm, mem) < 0) VIR_WARN("Unable to destroy memory backing path"); =20 qemuDomainReleaseMemoryDeviceSlot(vm, mem); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2e4ee9e30502..1d3a905dd854 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4095,7 +4095,7 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *dri= ver, =20 if (!build || shouldBuildMB) { g_autofree char *path =3D NULL; - if (qemuGetMemoryBackingDomainPath(driver, vm->def, &path) < 0) + if (qemuGetMemoryBackingDomainPath(QEMU_DOMAIN_PRIVATE(vm), vm->de= f, &path) < 0) return -1; =20 if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm, @@ -4108,13 +4108,12 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *d= river, =20 =20 int -qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem) { g_autofree char *path =3D NULL; =20 - if (qemuGetMemoryBackingPath(driver, vm->def, mem->info.alias, &path) = < 0) + if (qemuGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), vm->def, mem->in= fo.alias, &path) < 0) return -1; =20 if (unlink(path) < 0 && diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 2324aeb7bdff..878c522d8255 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -43,8 +43,7 @@ int qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *dri= ver, virDomainMemoryDef *mem, bool build); =20 -int qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +int qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem); =20 void qemuProcessReconnectAll(virQEMUDriver *driver); --=20 2.46.0