While trying to build with -Os I've encountered some build
failures.
util/vircommand.c: In function 'virCommandAddEnvFormat':
util/vircommand.c:1257:1: error: inlining failed in call to 'virCommandAddEnv': call is unlikely and code size would grow [-Werror=inline]
virCommandAddEnv(virCommandPtr cmd, char *env)
^
util/vircommand.c:1308:5: error: called from here [-Werror=inline]
virCommandAddEnv(cmd, env);
^
This function is big enough for the compiler to be not inlined.
This is the error message I'm seeing:
Then virDomainNumatuneNodeSpecified is exported and called from
other places. It shouldn't be inlined then.
In file included from network/bridge_driver_platform.h:30:0,
from network/bridge_driver_platform.c:26:
network/bridge_driver_linux.c: In function 'networkRemoveRoutingFirewallRules':
./conf/network_conf.h:350:1: error: inlining failed in call to 'virNetworkDefForwardIf.constprop': call is unlikely and code size would grow [-Werror=inline]
virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
^
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
return NULL;
}
+const char *
+virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
+{
+ return ((def->forward.ifs && (def->forward.nifs > n) &&
+ def->forward.ifs[n].type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
+ ? def->forward.ifs[n].device.dev : NULL);
+}
+
virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net,
const char *portgroup)
{
const virNetworkDef *def,
unsigned int flags);
-static inline const char *
-virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
-{
- return ((def->forward.ifs && (def->forward.nifs > n) &&
- def->forward.ifs[n].type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
- ? def->forward.ifs[n].device.dev : NULL);
-}
+const char * virNetworkDefForwardIf(const virNetworkDef *def, size_t n);
virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net,
const char *portgroup);
};
-inline bool
+bool
virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
int cellid)
{
virNetworkDefCopy;
virNetworkDefFormat;
virNetworkDefFormatBuf;
+virNetworkDefForwardIf;
virNetworkDefFree;
virNetworkDefGetIpByIndex;
virNetworkDefGetRouteByIndex;
* string like "name=value". If the named environment variable is
* already set, then it is replaced in the list.
*/
-static inline void
+static void
virCommandAddEnv(virCommandPtr cmd, char *env)
{
size_t namelen;