From 0597400171b44e0d180196b2c04da72f8b1f225f Mon Sep 17 00:00:00 2001 Message-Id: <0597400171b44e0d180196b2c04da72f8b1f225f@dist-git> From: Jiri Denemark Date: Thu, 2 Nov 2017 19:58:00 +0100 Subject: [PATCH] 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: Jiri Denemark (cherry picked from commit bce925dadaf8fe4693abee88fb68aa7ede9d209e) https://bugzilla.redhat.com/show_bug.cgi?id=1472263 Signed-off-by: Jiri Denemark --- src/conf/domain_conf.c | 36 ++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 37 +++---------------------------------- src/libvirt_private.syms | 1 + 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 77c20c6972..394afb0d80 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28082,3 +28082,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; +} diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 38de70b154..171f340785 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3382,40 +3382,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, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 448d962b2d..811d9053e6 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -444,6 +444,7 @@ virDomainNetInsert; virDomainNetRemove; virDomainNetRemoveHostdev; virDomainNetTypeFromString; +virDomainNetTypeSharesHostView; virDomainNetTypeToString; virDomainNostateReasonTypeFromString; virDomainNostateReasonTypeToString; -- 2.15.0