In commit 4af3cbafdd0e31c5c5b20d57c4aaeb19efcb98bc
(Laine Stump <laine(a)redhat.com>, Tue Jul 31 14:36:51 2012 -0400)
the return -1 was removed and since then
virNetDevVPortProfileFormat() 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(a)astralinux.ru>
---
src/conf/domain_conf.c | 8 ++++----
src/conf/netdev_vport_profile_conf.c | 10 +++++-----
src/conf/netdev_vport_profile_conf.h | 2 +-
src/conf/network_conf.c | 7 +++----
src/conf/virnetworkportdef.c | 4 ++--
5 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6211d2a51b..dac2584cf2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23767,8 +23767,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);
@@ -24241,8 +24241,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);
diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c
index 59237e10de..032a3147d7 100644
--- a/src/conf/netdev_vport_profile_conf.c
+++ b/src/conf/netdev_vport_profile_conf.c
@@ -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;
}
diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_profile_conf.h
index 58b104610a..f710d34874 100644
--- a/src/conf/netdev_vport_profile_conf.h
+++ b/src/conf/netdev_vport_profile_conf.h
@@ -39,6 +39,6 @@ typedef enum {
virNetDevVPortProfile *
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
-int
+void
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBuffer *buf);
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 6f8a0d2d0b..ed2e72eddf 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -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)
diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c
index 64db63ae66..ad6150d5a7 100644
--- a/src/conf/virnetworkportdef.c
+++ b/src/conf/virnetworkportdef.c
@@ -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)
--
2.30.2