virLXCDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
int actualType;
+ virNetDevBandwidthPtr actualBandwidth;
char *veth = NULL;
if (!priv->initpid) {
_("Network device type is not supported"));
goto cleanup;
}
- /* set network bandwidth */
- if (virNetDevSupportBandwidth(actualType) &&
- virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net), false) < 0)
- goto cleanup;
+ /* Set bandwidth or warn if requested and not supported. */
+ actualBandwidth = virDomainNetGetActualBandwidth(net);
+ if (actualBandwidth) {
+ if (virNetDevSupportBandwidth(actualType)) {
+ if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false) < 0)
+ goto cleanup;
+ } else {
+ VIR_WARN("setting bandwidth on interfaces of "
+ "type '%s' is not implemented yet",
+ virDomainNetTypeToString(actualType));
+ }
+ }
if (virNetDevSetNamespace(veth, priv->initpid) < 0) {
virDomainAuditNet(vm, NULL, net, "attach", false);
for (i = 0; i < def->nnets; i++) {
char *veth = NULL;
+ virNetDevBandwidthPtr actualBandwidth;
/* If appropriate, grab a physical device from the configured
* network's pool of devices, or resolve bridge device name
* to the one defined in the network definition.
}
- /* set network bandwidth */
- if (virNetDevSupportBandwidth(type) &&
- virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net), false) < 0)
- goto cleanup;
+ /* Set bandwidth or warn if requested and not supported. */
+ actualBandwidth = virDomainNetGetActualBandwidth(net);
+ if (actualBandwidth) {
+ if (virNetDevSupportBandwidth(type)) {
+ if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false) < 0)
+ goto cleanup;
+ } else {
+ VIR_WARN("setting bandwidth on interfaces of "
+ "type '%s' is not implemented yet",
+ virDomainNetTypeToString(type));
+ }
+ }
(*veths)[(*nveths)-1] = veth;
char **tapfdName = NULL;
char **vhostfdName = NULL;
int actualType = virDomainNetGetActualType(net);
+ virNetDevBandwidthPtr actualBandwidth;
size_t i;
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER)
goto cleanup;
}
- /* Set Bandwidth */
- if (virNetDevSupportBandwidth(actualType) &&
- virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net),
- false) < 0)
- goto cleanup;
+ /* Set bandwidth or warn if requested and not supported. */
+ actualBandwidth = virDomainNetGetActualBandwidth(net);
+ if (actualBandwidth) {
+ if (virNetDevSupportBandwidth(actualType)) {
+ if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false) < 0)
+ goto cleanup;
+ } else {
+ VIR_WARN("setting bandwidth on interfaces of "
+ "type '%s' is not implemented yet",
+ virDomainNetTypeToString(actualType));
+ }
+ }
if ((actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
bool releaseaddr = false;
bool iface_connected = false;
int actualType;
+ virNetDevBandwidthPtr actualBandwidth;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
size_t i;
if (qemuInterfaceStartDevice(net) < 0)
goto cleanup;
- /* Set Bandwidth */
- if (virNetDevSupportBandwidth(actualType) &&
- virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net), false) < 0)
- goto cleanup;
+ /* Set bandwidth or warn if requested and not supported. */
+ actualBandwidth = virDomainNetGetActualBandwidth(net);
+ if (actualBandwidth) {
+ if (virNetDevSupportBandwidth(actualType)) {
+ if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false) < 0)
+ goto cleanup;
+ } else {
+ VIR_WARN("setting bandwidth on interfaces of "
+ "type '%s' is not implemented yet",
+ virDomainNetTypeToString(actualType));
+ }
+ }
for (i = 0; i < tapfdSize; i++) {
if (virSecurityManagerSetTapFDLabel(driver->securityManager,