[PATCH v3 04/13] libxl: turn virCapabilitiesAddHostFeature() to void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virCapabilitiesAddHostFeature() always returns 0.

Signed-off-by: Dmitry Frolov <frolov@xxxxxxxxx>
---
 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 9be64a53a8..836f46341a 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -137,9 +137,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 67f8e75296..ec1a9b75de 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
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux