From nobody Wed Jan 15 11:42:15 2025 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=quarantine dis=none) header.from=swemel.ru Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704897298819387.84695382166774; Wed, 10 Jan 2024 06:34:58 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 872F91D72; Wed, 10 Jan 2024 09:34:57 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C9E141CAA; Wed, 10 Jan 2024 09:23:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 90FB41C13; Wed, 10 Jan 2024 09:23:07 -0500 (EST) Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) (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 37941187B for ; Wed, 10 Jan 2024 09:21:58 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 From: Dmitry Frolov To: devel@lists.libvirt.org Subject: [PATCH v4 08/19] conf: change type to void virCapabilitiesAddHostFeature() Date: Wed, 10 Jan 2024 17:21:23 +0300 Message-Id: <20240110142134.915450-9-frolov@swemel.ru> In-Reply-To: <20240110142134.915450-1-frolov@swemel.ru> References: <47d3cbc0-003b-4829-8038-8e00bbdb5c85@redhat.com> <20240110142134.915450-1-frolov@swemel.ru> MIME-Version: 1.0 Message-ID-Hash: S5XLG5CUBZBZ35ORLU4UYG7RVUDVW6YC X-Message-ID-Hash: S5XLG5CUBZBZ35ORLU4UYG7RVUDVW6YC X-MailFrom: frolov@swemel.ru 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: sdl.libvirt@linuxtesting.org, Dmitry Frolov 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: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704897299397100001 virCapabilitiesAddHostFeature() returns nothing except 0. Changing return type to void. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov --- src/conf/capabilities.c | 4 +--- src/conf/capabilities.h | 2 +- src/libxl/libxl_capabilities.c | 5 ++--- src/test/test_driver.c | 6 ++---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 32badee7b3..096ccc18e7 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -276,7 +276,7 @@ virCapsDispose(void *object) * * Registers a new host CPU feature, eg 'pae', or 'vmx' */ -int +void virCapabilitiesAddHostFeature(virCaps *caps, const char *name) { @@ -284,8 +284,6 @@ virCapabilitiesAddHostFeature(virCaps *caps, caps->host.nfeatures, 1); caps->host.features[caps->host.nfeatures] =3D g_strdup(name); caps->host.nfeatures++; - - return 0; } =20 /** diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 9eaf6e2807..085c0af868 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -236,7 +236,7 @@ virCapabilitiesHostNUMARef(virCapsHostNUMA *caps); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCapsHostNUMA, virCapabilitiesHostNUMAUnre= f); =20 -int +void virCapabilitiesAddHostFeature(virCaps *caps, const char *name); =20 diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index dfb602ca2f..977418d472 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -138,9 +138,8 @@ libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_inf= o) cpu =3D virCPUDefNew(); =20 host_pae =3D phy_info->hw_cap[0] & LIBXL_X86_FEATURE_PAE_MASK; - if (host_pae && - virCapabilitiesAddHostFeature(caps, "pae") < 0) - return -1; + if (host_pae) + virCapabilitiesAddHostFeature(caps, "pae"); =20 host_lm =3D (phy_info->hw_cap[2] & LIBXL_X86_FEATURE_LM_MASK); if (host_lm) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index ed545848af..053f1b55e1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -299,10 +299,8 @@ testBuildCapabilities(virConnectPtr conn) if ((caps =3D virCapabilitiesNew(VIR_ARCH_I686, false, false)) =3D=3D = NULL) return NULL; =20 - if (virCapabilitiesAddHostFeature(caps, "pae") < 0) - return NULL; - if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0) - return NULL; + virCapabilitiesAddHostFeature(caps, "pae"); + virCapabilitiesAddHostFeature(caps, "nonpae"); =20 virCapabilitiesHostInitIOMMU(caps); =20 --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org