mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
82513048bf
commit
1b6d56a39e
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -740,6 +740,7 @@ virNetDevBandwidthFormat;
|
|||
virNetDevBandwidthHasFloor;
|
||||
virNetDevBandwidthParse;
|
||||
virNetDevBandwidthSupportsFloor;
|
||||
virNetDevSupportsBandwidth;
|
||||
|
||||
|
||||
# conf/netdev_vlan_conf.h
|
||||
|
|
Loading…
Reference in New Issue