conf: virNetDevSupportsBandwidth: move into the C file

Make the header easier to read and let the compiler inline
what it wants.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2020-02-17 18:35:37 +01:00
parent 82513048bf
commit 1b6d56a39e
3 changed files with 25 additions and 23 deletions

View File

@ -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
virNetDevBandwidthHasFloor(const virNetDevBandwidth *b)
{

View File

@ -37,28 +37,6 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *def,
void virDomainClearNetBandwidth(virDomainObjPtr vm)
ATTRIBUTE_NONNULL(1);
static inline 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 virNetDevSupportsBandwidth(virDomainNetType type);
bool virNetDevBandwidthHasFloor(const virNetDevBandwidth *b);
bool virNetDevBandwidthSupportsFloor(virNetworkForwardType type);

View File

@ -740,6 +740,7 @@ virNetDevBandwidthFormat;
virNetDevBandwidthHasFloor;
virNetDevBandwidthParse;
virNetDevBandwidthSupportsFloor;
virNetDevSupportsBandwidth;
# conf/netdev_vlan_conf.h