提交 be8b536a 编写于 作者: M Michal Privoznik

Drop inline keyword from some functions.

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: NMichal Privoznik <mprivozn@redhat.com>
上级 e53f2dc8
...@@ -2925,6 +2925,14 @@ virNetworkObjFormat(virNetworkObjPtr net, ...@@ -2925,6 +2925,14 @@ virNetworkObjFormat(virNetworkObjPtr net,
return NULL; 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, virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net,
const char *portgroup) const char *portgroup)
{ {
......
...@@ -346,13 +346,7 @@ int virNetworkDefFormatBuf(virBufferPtr buf, ...@@ -346,13 +346,7 @@ int virNetworkDefFormatBuf(virBufferPtr buf,
const virNetworkDef *def, const virNetworkDef *def,
unsigned int flags); unsigned int flags);
static inline const char * const char * virNetworkDefForwardIf(const virNetworkDef *def, size_t n);
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, virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net,
const char *portgroup); const char *portgroup);
......
...@@ -72,7 +72,7 @@ struct _virDomainNuma { ...@@ -72,7 +72,7 @@ struct _virDomainNuma {
}; };
inline bool bool
virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune, virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
int cellid) int cellid)
{ {
......
...@@ -589,6 +589,7 @@ virNetworkConfigFile; ...@@ -589,6 +589,7 @@ virNetworkConfigFile;
virNetworkDefCopy; virNetworkDefCopy;
virNetworkDefFormat; virNetworkDefFormat;
virNetworkDefFormatBuf; virNetworkDefFormatBuf;
virNetworkDefForwardIf;
virNetworkDefFree; virNetworkDefFree;
virNetworkDefGetIpByIndex; virNetworkDefGetIpByIndex;
virNetworkDefGetRouteByIndex; virNetworkDefGetRouteByIndex;
......
...@@ -1253,7 +1253,7 @@ virCommandRawStatus(virCommandPtr cmd) ...@@ -1253,7 +1253,7 @@ virCommandRawStatus(virCommandPtr cmd)
* string like "name=value". If the named environment variable is * string like "name=value". If the named environment variable is
* already set, then it is replaced in the list. * already set, then it is replaced in the list.
*/ */
static inline void static void
virCommandAddEnv(virCommandPtr cmd, char *env) virCommandAddEnv(virCommandPtr cmd, char *env)
{ {
size_t namelen; size_t namelen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册