On 10/08/2014 01:59 PM, Anirban Chakraborty wrote:
Signed-off-by: Anirban Chakraborty <abchak(a)juniper.net>
---
src/conf/domain_conf.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f03599e..91da1ec 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2852,7 +2852,8 @@ static inline bool virNetDevSupportBandwidth(int type)
{
return ((type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
type == VIR_DOMAIN_NET_TYPE_NETWORK ||
- type == VIR_DOMAIN_NET_TYPE_DIRECT) ? true : false);
+ type == VIR_DOMAIN_NET_TYPE_DIRECT ||
+ type == VIR_DOMAIN_NET_TYPE_ETHERNET) ? true : false);
Needs rework after my comments on 1/2. I also wonder if this should
just be folded in to that patch, and/or made into a switch statement
where the compiler forces us to think about any future
VIR_DOMAIN_NET_TYPE_* additions on whether they should return true or false.
As in:
bool virNetDevSupportBandwidth(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_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
/* cover all enums to appease the compiler */ ;
}
return false;
}
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org