]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: make virNetDevVPortProfileFormat() void
authorAlexandra Diupina <adiupina@astralinux.ru>
Wed, 17 Jan 2024 16:04:58 +0000 (19:04 +0300)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 24 Jan 2024 09:06:09 +0000 (10:06 +0100)
Since commit 4af3cbafdd0e the function always returns 0, so it is
possible to make this function void and remove return value checks.

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

Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
src/conf/domain_conf.c
src/conf/netdev_vport_profile_conf.c
src/conf/netdev_vport_profile_conf.h
src/conf/network_conf.c
src/conf/virnetworkportdef.c

index 8bddd2c1db8994bfcd70966a040fcdad351e7ea1..59d51c4c52399c34f7d36354d9ba40037be705be 100644 (file)
@@ -23783,8 +23783,8 @@ virDomainActualNetDefContentsFormat(virBuffer *buf,
 
     if (virNetDevVlanFormat(virDomainNetGetActualVlan(def), buf) < 0)
         return -1;
-    if (virNetDevVPortProfileFormat(virDomainNetGetActualVirtPortProfile(def), buf) < 0)
-        return -1;
+    virNetDevVPortProfileFormat(virDomainNetGetActualVirtPortProfile(def), buf);
+
     if (virNetDevBandwidthFormat(virDomainNetGetActualBandwidth(def), 0, buf) < 0)
         return -1;
     virNetworkPortOptionsFormat(virDomainNetGetActualPortOptionsIsolated(def), buf);
@@ -24257,8 +24257,8 @@ virDomainNetDefFormat(virBuffer *buf,
 
         if (virNetDevVlanFormat(&def->vlan, buf) < 0)
             return -1;
-        if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
-            return -1;
+        virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
         if (virNetDevBandwidthFormat(def->bandwidth, 0, buf) < 0)
             return -1;
         virNetworkPortOptionsFormat(def->isolatedPort, buf);
index 59237e10de21696ce2fe492f2895f2c6745f0bb7..032a3147d72bffd0ab33f4936e2d8abdf420e1d9 100644 (file)
@@ -177,7 +177,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
 }
 
 
-int
+void
 virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
                             virBuffer *buf)
 {
@@ -185,7 +185,7 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
     bool noParameters;
 
     if (!virtPort)
-        return 0;
+        return;
 
     noParameters = !(virtPort->managerID_specified ||
                      virtPort->typeID_specified ||
@@ -197,13 +197,13 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
     type = virtPort->virtPortType;
     if (type == VIR_NETDEV_VPORT_PROFILE_NONE) {
         if (noParameters)
-            return 0;
+            return;
         virBufferAddLit(buf, "<virtualport>\n");
     } else {
         if (noParameters) {
             virBufferAsprintf(buf, "<virtualport type='%s'/>\n",
                               virNetDevVPortTypeToString(type));
-            return 0;
+            return;
         } else {
             virBufferAsprintf(buf, "<virtualport type='%s'>\n",
                               virNetDevVPortTypeToString(type));
@@ -255,5 +255,5 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
     virBufferAddLit(buf, "/>\n");
     virBufferAdjustIndent(buf, -2);
     virBufferAddLit(buf, "</virtualport>\n");
-    return 0;
+    return;
 }
index 58b104610a39b460419d57bc450c9023c9bbea96..f710d34874620488be6adc2d03f547c57f341393 100644 (file)
@@ -39,6 +39,6 @@ typedef enum {
 virNetDevVPortProfile *
 virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
 
-int
+void
 virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
                             virBuffer *buf);
index 6f8a0d2d0b50974a3ad48b1e0a599d357048e0a3..ed2e72eddf59102cfe5773ece73940ac682af314 100644 (file)
@@ -2213,8 +2213,8 @@ virPortGroupDefFormat(virBuffer *buf,
     virBufferAdjustIndent(buf, 2);
     if (virNetDevVlanFormat(&def->vlan, buf) < 0)
         return -1;
-    if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
-        return -1;
+    virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
     virNetDevBandwidthFormat(def->bandwidth, 0, buf);
     virBufferAdjustIndent(buf, -2);
     virBufferAddLit(buf, "</portgroup>\n");
@@ -2466,8 +2466,7 @@ virNetworkDefFormatBuf(virBuffer *buf,
             return -1;
     }
 
-    if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
-        return -1;
+    virNetDevVPortProfileFormat(def->virtPortProfile, buf);
 
     for (i = 0; i < def->nPortGroups; i++)
         if (virPortGroupDefFormat(buf, &def->portGroups[i]) < 0)
index 64db63ae66654663fa2b6ec7be11c2913f1f08c8..ad6150d5a742f4ab962f84f9617a517c97e424de 100644 (file)
@@ -307,8 +307,8 @@ virNetworkPortDefFormatBuf(virBuffer *buf,
     virMacAddrFormat(&def->mac, macaddr);
     virBufferAsprintf(buf, "<mac address='%s'/>\n", macaddr);
 
-    if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
-        return -1;
+    virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
     if (def->bandwidth)
         virNetDevBandwidthFormat(def->bandwidth, def->class_id, buf);
     if (virNetDevVlanFormat(&def->vlan, buf) < 0)