From nobody Sun Feb 8 14:46:56 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 1727092337451790.3076055467371; Mon, 23 Sep 2024 04:52:17 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 633B212F2; Mon, 23 Sep 2024 07:52:14 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 10277170B; Mon, 23 Sep 2024 07:48:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5FB2113F2; Mon, 23 Sep 2024 07:48:07 -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 DB78D12F2 for ; Mon, 23 Sep 2024 07:48:06 -0400 (EDT) Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-4ASV9hkgNFi9SIw34Thrzw-1; Mon, 23 Sep 2024 07:48:05 -0400 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2f760cbd9deso28721321fa.0 for ; Mon, 23 Sep 2024 04:48:05 -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-a90612b38desm1211864166b.121.2024.09.23.04.48.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:48:02 -0700 (PDT) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id BC4B126732EF 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=1727092086; 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=5bZ6h4QUj1U/Y8oB0Bq0w1hwfBXa8e9fgdxsmWqf8D4=; b=BdHSuv6HG51gDfZ/LUeq+E3dP9pE1NlcSMTLD0SvZ6P4AL1M+7jIp3WvhqBGMVKgAg9JiC R2Jm+q2Ua04yIg7L6TpmoRkkmctbQa6lifNYfBI3NoBisd5nbFwlX8R5wu4y9SRe2swmQ6 HPsSKQFLJtaMBiP8VLmFXyurvEV8DPY= X-MC-Unique: 4ASV9hkgNFi9SIw34Thrzw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092084; x=1727696884; 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=5bZ6h4QUj1U/Y8oB0Bq0w1hwfBXa8e9fgdxsmWqf8D4=; b=EYR6C09/VTss8JRIkMC79aJd4aPtdGcBKdGJTWH/cBv80YfWZK+ar9euXgrFFczbvE pAeThSOo/ZsYnHwvWRgFPg6ogivI8sSn+i6D6zi609cz29kNj9jVYoVJIwobg4Ot8UmT j6thqKu1Lyjjr4DnAeJfwLLwFfh4oHx80FWKiqH74GEKboC3/jjxwSqzq5EGIRZ7JLMo Mx7MXrELpys4jsDrsAuDkmCYpk26LpiNbFWmnlSA7gyM/8/n434z+PFYVThQxL2y4rPM SfOa9/1JLa1+4Cgw98+48QIFPAGFezbEVRKIdhmgY/iFpkW8M37TmDWgOs94HcrZEWu6 XmZw== X-Gm-Message-State: AOJu0YzfSz8w2lTm8xegW4+JLQSs8lHeQvuaC0AUHgnyDuf1dvfOaZuP Szvi59BO73EwzkWoSgmpq9oCi6c+oFgvO28x9CwhBTRKfheZqqxF+a+89FEB2lTPqGo2k2SNfI+ Qb5aG8rR1cYL2a5ZD1kX7cJFg4QYFwzGk2sKVOA6Kjdf669nBoPcuOy+YPThbajD3Wt+X75+b9h 6/szTd3CH6TAKhYupbh7Bc81GZeHqCmvweWCtOf0s= X-Received: by 2002:a05:6512:3baa:b0:52c:8c4d:f8d6 with SMTP id 2adb3069b0e04-536ad3b7e32mr5100842e87.45.1727092083896; Mon, 23 Sep 2024 04:48:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8JfJDCmTHNxtF/NSfZB+U7Vsi7MtFnGZsBth0JSb5ySc0hyE0sObre6ogaZWm2NpXS/2Weg== X-Received: by 2002:a05:6512:3baa:b0:52c:8c4d:f8d6 with SMTP id 2adb3069b0e04-536ad3b7e32mr5100824e87.45.1727092083345; Mon, 23 Sep 2024 04:48:03 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH v2 7/8] qemu: Rename memory path functions Date: Mon, 23 Sep 2024 13:47:57 +0200 Message-ID: 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: KMBLLWGNYGNM47XYN7KN3FNTJTTQSRCJ X-Message-ID-Hash: KMBLLWGNYGNM47XYN7KN3FNTJTTQSRCJ 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: 1727092339456116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This way they make sense not only based on where they are located but the name also relates to what they are actually doing. Signed-off-by: Martin Kletzander --- src/qemu/qemu_command.c | 5 +++-- src/qemu/qemu_domain.c | 22 +++++++++++----------- src/qemu/qemu_domain.h | 6 +++--- src/qemu/qemu_process.c | 3 ++- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 167ee8240b22..a0c9e5f8b399 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3222,7 +3222,8 @@ 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, mem->info.alias, &memPath) = < 0) + if (qemuDomainGetMemoryBackingPath(priv, mem->info.alias, + &memPath) < 0) return -1; } =20 @@ -7116,7 +7117,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, "ram", &mem_path) < 0) + if (qemuDomainGetMemoryBackingPath(priv, "ram", &mem_path) < 0) return -1; } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a92eaef80af0..49318f518788 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1736,9 +1736,9 @@ qemuDomainSecretPrepare(virQEMUDriver *driver, =20 =20 static int -qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, - const virDomainDef *def, - char **path) +qemuDomainGenerateMemoryBackingPath(qemuDomainObjPrivate *priv, + const virDomainDef *def, + char **path) { virQEMUDriver *driver =3D priv->driver; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); @@ -1760,7 +1760,7 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *= priv, =20 =20 /** - * qemuGetMemoryBackingPath: + * qemuDomainGetMemoryBackingPath: * @priv: domain private data * @alias: memory object alias * @memPath: constructed path @@ -1771,9 +1771,9 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *= priv, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, - const char *alias, - char **memPath) +qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv, + const char *alias, + char **memPath) { if (!alias) { /* This should never happen (TM) */ @@ -1804,8 +1804,8 @@ qemuDomainSetPrivatePathsOld(virQEMUDriver *driver, cfg->channelTargetDir, vm= ->def->name); =20 if (!priv->memoryBackingDir && - qemuGetMemoryBackingDomainPath(priv, vm->def, - &priv->memoryBackingDir) < 0) + qemuDomainGenerateMemoryBackingPath(priv, vm->def, + &priv->memoryBackingDir) < 0) return -1; =20 return 0; @@ -1831,8 +1831,8 @@ qemuDomainSetPrivatePaths(virQEMUDriver *driver, cfg->channelTargetDir, do= mname); =20 if (!priv->memoryBackingDir && - qemuGetMemoryBackingDomainPath(priv, vm->def, - &priv->memoryBackingDir) < 0) + qemuDomainGenerateMemoryBackingPath(priv, vm->def, + &priv->memoryBackingDir) < 0) return -1; =20 return 0; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index cb42577ee51a..ba357af8f4b6 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -939,9 +939,9 @@ void qemuDomainCleanupStorageSourceFD(virStorageSource = *src); void qemuDomainStartupCleanup(virDomainObj *vm); =20 =20 -int qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, - const char *alias, - char **memPath); +int qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv, + const char *alias, + char **memPath); =20 int qemuDomainSecretPrepare(virQEMUDriver *driver, virDomainObj *vm) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dd3afbeb39ac..a00066e88ed2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4110,7 +4110,8 @@ qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, { g_autofree char *path =3D NULL; =20 - if (qemuGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), mem->info.alias,= &path) < 0) + if (qemuDomainGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), + mem->info.alias, &path) < 0) return -1; =20 if (unlink(path) < 0 && --=20 2.46.1