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

conf: virNetDevSupportsBandwidth: move into the C file

Make the header easier to read and let the compiler inline
what it wants.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 82513048
...@@ -299,6 +299,29 @@ virDomainClearNetBandwidth(virDomainObjPtr vm) ...@@ -299,6 +299,29 @@ virDomainClearNetBandwidth(virDomainObjPtr vm)
} }
bool virNetDevSupportsBandwidth(virDomainNetType type)
{
switch ((virDomainNetType) type) {
case VIR_DOMAIN_NET_TYPE_BRIDGE:
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_ETHERNET:
return true;
case VIR_DOMAIN_NET_TYPE_USER:
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
break;
}
return false;
}
bool bool
virNetDevBandwidthHasFloor(const virNetDevBandwidth *b) virNetDevBandwidthHasFloor(const virNetDevBandwidth *b)
{ {
......
...@@ -37,28 +37,6 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def, ...@@ -37,28 +37,6 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def,
void virDomainClearNetBandwidth(virDomainObjPtr vm) void virDomainClearNetBandwidth(virDomainObjPtr vm)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
static inline bool virNetDevSupportsBandwidth(virDomainNetType type) bool virNetDevSupportsBandwidth(virDomainNetType type);
{
switch (type) {
case VIR_DOMAIN_NET_TYPE_BRIDGE:
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_ETHERNET:
return true;
case VIR_DOMAIN_NET_TYPE_USER:
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
break;
}
return false;
}
bool virNetDevBandwidthHasFloor(const virNetDevBandwidth *b); bool virNetDevBandwidthHasFloor(const virNetDevBandwidth *b);
bool virNetDevBandwidthSupportsFloor(virNetworkForwardType type); bool virNetDevBandwidthSupportsFloor(virNetworkForwardType type);
...@@ -740,6 +740,7 @@ virNetDevBandwidthFormat; ...@@ -740,6 +740,7 @@ virNetDevBandwidthFormat;
virNetDevBandwidthHasFloor; virNetDevBandwidthHasFloor;
virNetDevBandwidthParse; virNetDevBandwidthParse;
virNetDevBandwidthSupportsFloor; virNetDevBandwidthSupportsFloor;
virNetDevSupportsBandwidth;
# conf/netdev_vlan_conf.h # conf/netdev_vlan_conf.h
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册