virCapabilitiesAddHostFeature() returns nothing except 0. Changing return
type to void.
Found by Linux Verification Center (
linuxtesting.org) with SVACE.
Signed-off-by: Dmitry Frolov <frolov(a)swemel.ru>
---
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] = g_strdup(name);
caps->host.nfeatures++;
-
- return 0;
}
/**
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);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCapsHostNUMA, virCapabilitiesHostNUMAUnref);
-int
+void
virCapabilitiesAddHostFeature(virCaps *caps,
const char *name);
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_info)
cpu = virCPUDefNew();
host_pae = 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");
host_lm = (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 = virCapabilitiesNew(VIR_ARCH_I686, false, false)) == NULL)
return NULL;
- if (virCapabilitiesAddHostFeature(caps, "pae") < 0)
- return NULL;
- if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0)
- return NULL;
+ virCapabilitiesAddHostFeature(caps, "pae");
+ virCapabilitiesAddHostFeature(caps, "nonpae");
virCapabilitiesHostInitIOMMU(caps);
--
2.34.1