提交 bce925da 编写于 作者: J Jiri Denemark

conf: Don't inline virDomainNetTypeSharesHostView

When coverage build is enabled, gcc complains about it:

In file included from qemu/qemu_agent.h:29:0,
                 from qemu/qemu_driver.c:47:
qemu/qemu_driver.c: In function 'qemuDomainSetInterfaceParameters':
./conf/domain_conf.h:3397:1: error: inlining failed in call to
'virDomainNetTypeSharesHostView': call is unlikely and code size would
grow [-Werror=inline]
 virDomainNetTypeSharesHostView(const virDomainNetDef *net)
 ^
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 27b67eba
......@@ -28091,3 +28091,39 @@ virDomainGenerateMachineName(const char *drivername,
virBufferCheckError(&buf);
return virBufferContentAndReset(&buf);
}
/**
* virDomainNetTypeSharesHostView:
* @net: interface
*
* Some types of interfaces "share" the host view. For instance,
* for macvtap interface, every domain RX is the host RX too. And
* every domain TX is host TX too. IOW, for some types of
* interfaces guest and host are on the same side of RX/TX
* barrier. This is important so that we set up QoS correctly and
* report proper stats.
*/
bool
virDomainNetTypeSharesHostView(const virDomainNetDef *net)
{
virDomainNetType actualType = virDomainNetGetActualType(net);
switch (actualType) {
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_NETWORK:
case VIR_DOMAIN_NET_TYPE_BRIDGE:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_LAST:
break;
}
return false;
}
......@@ -3391,40 +3391,9 @@ virDomainGenerateMachineName(const char *drivername,
int id,
const char *name,
bool privileged);
/**
* virDomainNetTypeSharesHostView:
* @net: interface
*
* Some types of interfaces "share" the host view. For instance,
* for macvtap interface, every domain RX is the host RX too. And
* every domain TX is host TX too. IOW, for some types of
* interfaces guest and host are on the same side of RX/TX
* barrier. This is important so that we set up QoS correctly and
* report proper stats.
*/
static inline bool
virDomainNetTypeSharesHostView(const virDomainNetDef *net)
{
virDomainNetType actualType = virDomainNetGetActualType(net);
switch (actualType) {
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_NETWORK:
case VIR_DOMAIN_NET_TYPE_BRIDGE:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_LAST:
break;
}
return false;
}
bool
virDomainNetTypeSharesHostView(const virDomainNetDef *net);
bool
virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
......
......@@ -446,6 +446,7 @@ virDomainNetInsert;
virDomainNetRemove;
virDomainNetRemoveHostdev;
virDomainNetTypeFromString;
virDomainNetTypeSharesHostView;
virDomainNetTypeToString;
virDomainNostateReasonTypeFromString;
virDomainNostateReasonTypeToString;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册