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);
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);
}
-int
+void
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBuffer *buf)
{
bool noParameters;
if (!virtPort)
- return 0;
+ return;
noParameters = !(virtPort->managerID_specified ||
virtPort->typeID_specified ||
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));
virBufferAddLit(buf, "/>\n");
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</virtualport>\n");
- return 0;
+ return;
}
virNetDevVPortProfile *
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
-int
+void
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
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");
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)
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)