[PATCH v4 09/19] conf: change type to void virCapabilitiesSetNetPrefix()

Dmitry Frolov posted 19 patches 1 year ago
[PATCH v4 09/19] conf: change type to void virCapabilitiesSetNetPrefix()
Posted by Dmitry Frolov 1 year ago
virCapabilitiesSetNetPrefix() returns nothing except 0. Changing return
type to void.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
---
 src/conf/capabilities.c        | 4 +---
 src/conf/capabilities.h        | 2 +-
 src/libxl/libxl_capabilities.c | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 096ccc18e7..f7e7610ce6 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -312,13 +312,11 @@ virCapabilitiesAddHostMigrateTransport(virCaps *caps,
  *
  * Registers the prefix that is used for generated network interfaces
  */
-int
+void
 virCapabilitiesSetNetPrefix(virCaps *caps,
                             const char *prefix)
 {
     caps->host.netprefix = g_strdup(prefix);
-
-    return 0;
 }
 
 
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index 085c0af868..d770cddd6b 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -244,7 +244,7 @@ int
 virCapabilitiesAddHostMigrateTransport(virCaps *caps,
                                        const char *name);
 
-int
+void
 virCapabilitiesSetNetPrefix(virCaps *caps,
                             const char *prefix);
 
diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index 977418d472..f2ab338e74 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -180,8 +180,7 @@ libxlCapsInitHost(libxl_ctx *ctx, virCaps *caps)
     if (libxlCapsInitCPU(caps, &phy_info) < 0)
         goto cleanup;
 
-    if (virCapabilitiesSetNetPrefix(caps, LIBXL_GENERATED_PREFIX_XEN) < 0)
-        goto cleanup;
+    virCapabilitiesSetNetPrefix(caps, LIBXL_GENERATED_PREFIX_XEN);
 
     ret = 0;
 
-- 
2.34.1
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org