c1c534
From 0597400171b44e0d180196b2c04da72f8b1f225f Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <0597400171b44e0d180196b2c04da72f8b1f225f@dist-git>
c1c534
From: Jiri Denemark <jdenemar@redhat.com>
c1c534
Date: Thu, 2 Nov 2017 19:58:00 +0100
c1c534
Subject: [PATCH] conf: Don't inline virDomainNetTypeSharesHostView
c1c534
c1c534
When coverage build is enabled, gcc complains about it:
c1c534
c1c534
In file included from qemu/qemu_agent.h:29:0,
c1c534
                 from qemu/qemu_driver.c:47:
c1c534
qemu/qemu_driver.c: In function 'qemuDomainSetInterfaceParameters':
c1c534
./conf/domain_conf.h:3397:1: error: inlining failed in call to
c1c534
'virDomainNetTypeSharesHostView': call is unlikely and code size would
c1c534
grow [-Werror=inline]
c1c534
 virDomainNetTypeSharesHostView(const virDomainNetDef *net)
c1c534
 ^
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
(cherry picked from commit bce925dadaf8fe4693abee88fb68aa7ede9d209e)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1472263
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/conf/domain_conf.c   | 36 ++++++++++++++++++++++++++++++++++++
c1c534
 src/conf/domain_conf.h   | 37 +++----------------------------------
c1c534
 src/libvirt_private.syms |  1 +
c1c534
 3 files changed, 40 insertions(+), 34 deletions(-)
c1c534
c1c534
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
c1c534
index 77c20c6972..394afb0d80 100644
c1c534
--- a/src/conf/domain_conf.c
c1c534
+++ b/src/conf/domain_conf.c
c1c534
@@ -28082,3 +28082,39 @@ virDomainGenerateMachineName(const char *drivername,
c1c534
     virBufferCheckError(&buf;;
c1c534
     return virBufferContentAndReset(&buf;;
c1c534
 }
c1c534
+
c1c534
+
c1c534
+/**
c1c534
+ * virDomainNetTypeSharesHostView:
c1c534
+ * @net: interface
c1c534
+ *
c1c534
+ * Some types of interfaces "share" the host view. For instance,
c1c534
+ * for macvtap interface, every domain RX is the host RX too. And
c1c534
+ * every domain TX is host TX too. IOW, for some types of
c1c534
+ * interfaces guest and host are on the same side of RX/TX
c1c534
+ * barrier. This is important so that we set up QoS correctly and
c1c534
+ * report proper stats.
c1c534
+ */
c1c534
+bool
c1c534
+virDomainNetTypeSharesHostView(const virDomainNetDef *net)
c1c534
+{
c1c534
+    virDomainNetType actualType = virDomainNetGetActualType(net);
c1c534
+    switch (actualType) {
c1c534
+    case VIR_DOMAIN_NET_TYPE_DIRECT:
c1c534
+    case VIR_DOMAIN_NET_TYPE_ETHERNET:
c1c534
+        return true;
c1c534
+    case VIR_DOMAIN_NET_TYPE_USER:
c1c534
+    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
c1c534
+    case VIR_DOMAIN_NET_TYPE_SERVER:
c1c534
+    case VIR_DOMAIN_NET_TYPE_CLIENT:
c1c534
+    case VIR_DOMAIN_NET_TYPE_MCAST:
c1c534
+    case VIR_DOMAIN_NET_TYPE_NETWORK:
c1c534
+    case VIR_DOMAIN_NET_TYPE_BRIDGE:
c1c534
+    case VIR_DOMAIN_NET_TYPE_INTERNAL:
c1c534
+    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
c1c534
+    case VIR_DOMAIN_NET_TYPE_UDP:
c1c534
+    case VIR_DOMAIN_NET_TYPE_LAST:
c1c534
+        break;
c1c534
+    }
c1c534
+    return false;
c1c534
+}
c1c534
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
c1c534
index 38de70b154..171f340785 100644
c1c534
--- a/src/conf/domain_conf.h
c1c534
+++ b/src/conf/domain_conf.h
c1c534
@@ -3382,40 +3382,9 @@ virDomainGenerateMachineName(const char *drivername,
c1c534
                              int id,
c1c534
                              const char *name,
c1c534
                              bool privileged);
c1c534
-/**
c1c534
- * virDomainNetTypeSharesHostView:
c1c534
- * @net: interface
c1c534
- *
c1c534
- * Some types of interfaces "share" the host view. For instance,
c1c534
- * for macvtap interface, every domain RX is the host RX too. And
c1c534
- * every domain TX is host TX too. IOW, for some types of
c1c534
- * interfaces guest and host are on the same side of RX/TX
c1c534
- * barrier. This is important so that we set up QoS correctly and
c1c534
- * report proper stats.
c1c534
- */
c1c534
-static inline bool
c1c534
-virDomainNetTypeSharesHostView(const virDomainNetDef *net)
c1c534
-{
c1c534
-    virDomainNetType actualType = virDomainNetGetActualType(net);
c1c534
-    switch (actualType) {
c1c534
-    case VIR_DOMAIN_NET_TYPE_DIRECT:
c1c534
-    case VIR_DOMAIN_NET_TYPE_ETHERNET:
c1c534
-        return true;
c1c534
-    case VIR_DOMAIN_NET_TYPE_USER:
c1c534
-    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
c1c534
-    case VIR_DOMAIN_NET_TYPE_SERVER:
c1c534
-    case VIR_DOMAIN_NET_TYPE_CLIENT:
c1c534
-    case VIR_DOMAIN_NET_TYPE_MCAST:
c1c534
-    case VIR_DOMAIN_NET_TYPE_NETWORK:
c1c534
-    case VIR_DOMAIN_NET_TYPE_BRIDGE:
c1c534
-    case VIR_DOMAIN_NET_TYPE_INTERNAL:
c1c534
-    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
c1c534
-    case VIR_DOMAIN_NET_TYPE_UDP:
c1c534
-    case VIR_DOMAIN_NET_TYPE_LAST:
c1c534
-        break;
c1c534
-    }
c1c534
-    return false;
c1c534
-}
c1c534
+
c1c534
+bool
c1c534
+virDomainNetTypeSharesHostView(const virDomainNetDef *net);
c1c534
 
c1c534
 bool
c1c534
 virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
c1c534
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c1c534
index 448d962b2d..811d9053e6 100644
c1c534
--- a/src/libvirt_private.syms
c1c534
+++ b/src/libvirt_private.syms
c1c534
@@ -444,6 +444,7 @@ virDomainNetInsert;
c1c534
 virDomainNetRemove;
c1c534
 virDomainNetRemoveHostdev;
c1c534
 virDomainNetTypeFromString;
c1c534
+virDomainNetTypeSharesHostView;
c1c534
 virDomainNetTypeToString;
c1c534
 virDomainNostateReasonTypeFromString;
c1c534
 virDomainNostateReasonTypeToString;
c1c534
-- 
c1c534
2.15.0
c1c534