提交 82513048 编写于 作者: J Ján Tomko

conf: rename virNetDevSupportBandwidth to virNetDevSupportsBandwidth

Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NPavel Mores <pmores@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 b413b03f
...@@ -293,7 +293,7 @@ virDomainClearNetBandwidth(virDomainObjPtr vm) ...@@ -293,7 +293,7 @@ virDomainClearNetBandwidth(virDomainObjPtr vm)
for (i = 0; i < vm->def->nnets; i++) { for (i = 0; i < vm->def->nnets; i++) {
type = virDomainNetGetActualType(vm->def->nets[i]); type = virDomainNetGetActualType(vm->def->nets[i]);
if (virDomainNetGetActualBandwidth(vm->def->nets[i]) && if (virDomainNetGetActualBandwidth(vm->def->nets[i]) &&
virNetDevSupportBandwidth(type)) virNetDevSupportsBandwidth(type))
virNetDevBandwidthClear(vm->def->nets[i]->ifname); virNetDevBandwidthClear(vm->def->nets[i]->ifname);
} }
} }
......
...@@ -37,7 +37,7 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def, ...@@ -37,7 +37,7 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def,
void virDomainClearNetBandwidth(virDomainObjPtr vm) void virDomainClearNetBandwidth(virDomainObjPtr vm)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
static inline bool virNetDevSupportBandwidth(virDomainNetType type) static inline bool virNetDevSupportsBandwidth(virDomainNetType type)
{ {
switch (type) { switch (type) {
case VIR_DOMAIN_NET_TYPE_BRIDGE: case VIR_DOMAIN_NET_TYPE_BRIDGE:
......
...@@ -3521,7 +3521,7 @@ lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver, ...@@ -3521,7 +3521,7 @@ lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver,
/* Set bandwidth or warn if requested and not supported. */ /* Set bandwidth or warn if requested and not supported. */
actualBandwidth = virDomainNetGetActualBandwidth(net); actualBandwidth = virDomainNetGetActualBandwidth(net);
if (actualBandwidth) { if (actualBandwidth) {
if (virNetDevSupportBandwidth(actualType)) { if (virNetDevSupportsBandwidth(actualType)) {
if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false, if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false,
!virDomainNetTypeSharesHostView(net)) < 0) !virDomainNetTypeSharesHostView(net)) < 0)
goto cleanup; goto cleanup;
...@@ -3978,7 +3978,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm, ...@@ -3978,7 +3978,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm,
/* clear network bandwidth */ /* clear network bandwidth */
if (virDomainNetGetActualBandwidth(detach) && if (virDomainNetGetActualBandwidth(detach) &&
virNetDevSupportBandwidth(actualType) && virNetDevSupportsBandwidth(actualType) &&
virNetDevBandwidthClear(detach->ifname)) virNetDevBandwidthClear(detach->ifname))
goto cleanup; goto cleanup;
......
...@@ -622,7 +622,7 @@ virLXCProcessSetupInterfaces(virLXCDriverPtr driver, ...@@ -622,7 +622,7 @@ virLXCProcessSetupInterfaces(virLXCDriverPtr driver,
/* Set bandwidth or warn if requested and not supported. */ /* Set bandwidth or warn if requested and not supported. */
actualBandwidth = virDomainNetGetActualBandwidth(net); actualBandwidth = virDomainNetGetActualBandwidth(net);
if (actualBandwidth) { if (actualBandwidth) {
if (virNetDevSupportBandwidth(type)) { if (virNetDevSupportsBandwidth(type)) {
if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false, if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false,
!virDomainNetTypeSharesHostView(net)) < 0) !virDomainNetTypeSharesHostView(net)) < 0)
goto cleanup; goto cleanup;
......
...@@ -8081,7 +8081,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, ...@@ -8081,7 +8081,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
/* Set bandwidth or warn if requested and not supported. */ /* Set bandwidth or warn if requested and not supported. */
actualBandwidth = virDomainNetGetActualBandwidth(net); actualBandwidth = virDomainNetGetActualBandwidth(net);
if (actualBandwidth) { if (actualBandwidth) {
if (virNetDevSupportBandwidth(actualType)) { if (virNetDevSupportsBandwidth(actualType)) {
if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false, if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false,
!virDomainNetTypeSharesHostView(net)) < 0) !virDomainNetTypeSharesHostView(net)) < 0)
goto cleanup; goto cleanup;
......
...@@ -11220,12 +11220,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, ...@@ -11220,12 +11220,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
if (net) { if (net) {
actualType = virDomainNetGetActualType(net); actualType = virDomainNetGetActualType(net);
qosSupported = virNetDevSupportBandwidth(actualType); qosSupported = virNetDevSupportsBandwidth(actualType);
} }
if (qosSupported && persistentNet) { if (qosSupported && persistentNet) {
actualType = virDomainNetGetActualType(persistentNet); actualType = virDomainNetGetActualType(persistentNet);
qosSupported = virNetDevSupportBandwidth(actualType); qosSupported = virNetDevSupportsBandwidth(actualType);
} }
if (!qosSupported) { if (!qosSupported) {
......
...@@ -1342,7 +1342,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, ...@@ -1342,7 +1342,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
/* Set bandwidth or warn if requested and not supported. */ /* Set bandwidth or warn if requested and not supported. */
actualBandwidth = virDomainNetGetActualBandwidth(net); actualBandwidth = virDomainNetGetActualBandwidth(net);
if (actualBandwidth) { if (actualBandwidth) {
if (virNetDevSupportBandwidth(actualType)) { if (virNetDevSupportsBandwidth(actualType)) {
if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false, if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false,
!virDomainNetTypeSharesHostView(net)) < 0) !virDomainNetTypeSharesHostView(net)) < 0)
goto cleanup; goto cleanup;
...@@ -4582,7 +4582,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, ...@@ -4582,7 +4582,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
return -1; return -1;
if (virDomainNetGetActualBandwidth(net) && if (virDomainNetGetActualBandwidth(net) &&
virNetDevSupportBandwidth(virDomainNetGetActualType(net)) && virNetDevSupportsBandwidth(virDomainNetGetActualType(net)) &&
virNetDevBandwidthClear(net->ifname) < 0) virNetDevBandwidthClear(net->ifname) < 0)
VIR_WARN("cannot clear bandwidth setting for device : %s", VIR_WARN("cannot clear bandwidth setting for device : %s",
net->ifname); net->ifname);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册