mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: make virNetDevVPortProfileFormat() void
Since commit 4af3cbafdd 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>
This commit is contained in:
committed by
Martin Kletzander
parent
20e13e3bdc
commit
ab9da5c4ab
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@ typedef enum {
|
||||
virNetDevVPortProfile *
|
||||
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
|
||||
|
||||
int
|
||||
void
|
||||
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
|
||||
virBuffer *buf);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user