From nobody Sun Feb 8 19:20:38 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 1727092236676144.6081952049101; Mon, 23 Sep 2024 04:50:36 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A6349161E; Mon, 23 Sep 2024 07:50:35 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 431441632; Mon, 23 Sep 2024 07:48:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6A4381419; 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.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 C98DE13F3 for ; Mon, 23 Sep 2024 07:48:05 -0400 (EDT) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-nOyehsyJMju2xM4utQCTcw-1; Mon, 23 Sep 2024 07:48:03 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a8a80667ad8so354028566b.2 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-a90612b3ba7sm1206847366b.119.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 8383B26732EA 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=1727092085; 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=Ot5KoT87GkH9qB0ECKDJKngmR0ppesU/7cl50BIdiFU=; b=Q+dJ9RsNbHqE7y0BuPICa47HzqcMmq8ISuc5pM8rIjs0xK9xCZg5WTjq1QUTBsm0lrZ69F 1e1tS3oG1XV3Zc4vpAKRsprv/c0Z81BiKS+X4esgCTDBACJvImcSGcfY/cO5Ye5O5RhNIm MAbAilSMSdwKx5fGW2Ti9BQnv6hK+8A= X-MC-Unique: nOyehsyJMju2xM4utQCTcw-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=Ot5KoT87GkH9qB0ECKDJKngmR0ppesU/7cl50BIdiFU=; b=TzmmHtrb5nsQzCXbwtOdOE2TJbpCeqEF2L0mdoS9goW8+TGSJ1BlT5Q0pXFtGCzXv8 woZjK4zNmRYUA0EYm/4HwP5NTud/EoWzCFJ3JfG4hbq/O4HDEaOhXo3xJ6/ISvUDV2/z 9D2bltRrcjdSmE9iwvXYtjIyMOeeB5xBo7NlGKlKCd9DJSIlfOMrafujPUBAXpAAheKM TBTr7LAYnLcgWaI/Ly68+rbfsqCTvYhxDF8XzcjW/WmWGrkkyGtwXolLTqblj50aUcmc zamTuNLyZzmokoNGHr8Bdu8Ee90BoFJMd7VZirRN2EW/pj3jSRxxkwYxZPXGYuFfOuq4 2cxQ== X-Gm-Message-State: AOJu0YywAluEw7e3vrENlyB1phMn4YibZtc2Cjro3NkbGxS0xdTqazq1 ecKilkGtzC3Iq8UEnSP5dcLTnFF+xZkhu9oErKE6mR8Mwbmg1ydqjcT8n2PVd+kfYnf91i0aADj w/Nf/JO9kVvY6lPY1U9W3igGxmdMK8VZEU1Hc8Eo18xOBzCIlMw8JhqZLcugXD0rcsB9xmk+Ki4 u3L6IB7t5RnBXvfPnWd7+zAOuqNrBUEZe+JmFfeAU= X-Received: by 2002:a17:907:f783:b0:a90:419f:d8c3 with SMTP id a640c23a62f3a-a90d50d0b18mr1168466066b.49.1727092082256; Mon, 23 Sep 2024 04:48:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmpiifgu3NSU/P51mPKj2jvIgYtoyrC34oSag65QqtnqjKVqb59b/Eip9WwxIU5+KIHM9K1A== X-Received: by 2002:a17:907:f783:b0:a90:419f:d8c3 with SMTP id a640c23a62f3a-a90d50d0b18mr1168463766b.49.1727092081677; Mon, 23 Sep 2024 04:48:01 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH v2 2/8] qemu: Change parameters of qemuGetMemoryBackingDomainPath() Date: Mon, 23 Sep 2024 13:47:52 +0200 Message-ID: <28aa7abffd077a520b110b436884f481474e1457.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: IF654ZUDODJNAADLSTG6LACTMC7JM3MB X-Message-ID-Hash: IF654ZUDODJNAADLSTG6LACTMC7JM3MB 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: 1727092239018116600 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 | 9 +++++---- src/qemu/qemu_domain.h | 5 +++-- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 7 +++---- src/qemu/qemu_process.h | 3 +-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c20d033aea5a..f36b02b76b35 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3222,7 +3222,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 @@ -7116,7 +7116,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 cd891fd58f52..9a2ce910a5c8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1736,10 +1736,11 @@ qemuDomainSecretPrepare(virQEMUDriver *driver, =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; @@ -1760,7 +1761,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, =20 /** * qemuGetMemoryBackingPath: - * @driver: the qemu driver + * @priv: domain private data * @def: domain definition * @alias: memory object alias * @memPath: constructed path @@ -1771,7 +1772,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath) @@ -1785,7 +1786,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 9d897b761e3a..355a9e1cb21e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -936,11 +936,12 @@ void qemuDomainCleanupStorageSourceFD(virStorageSourc= e *src); =20 void qemuDomainStartupCleanup(virDomainObj *vm); =20 -int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, + +int qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path); =20 -int qemuGetMemoryBackingPath(virQEMUDriver *driver, +int 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 2dcb627dbdc0..09a37caf85c3 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2404,7 +2404,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) @@ -4761,7 +4761,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.1