提交 d3bbe338 编写于 作者: D Daniel Veillard

Portability fixes for non-linux or old linux platforms

The commits d5756794 and
080bf330 made use directly of
macro defined in recent linux netlink version. Make those
part conditional on the definition

* daemon/libvirtd.c: do not use NETLINK_ROUTE and NETLINK_KOBJECT_UEVENT
  without some check first
上级 f2f0af39
......@@ -1312,17 +1312,21 @@ int main(int argc, char **argv) {
goto cleanup;
}
#if defined(__linux__) && defined(NETLINK_ROUTE)
/* Register the netlink event service for NETLINK_ROUTE */
if (virNetlinkEventServiceStart(NETLINK_ROUTE, 0) < 0) {
ret = VIR_DAEMON_ERR_NETWORK;
goto cleanup;
}
#endif
#if defined(__linux__) && defined(NETLINK_KOBJECT_UEVENT)
/* Register the netlink event service for NETLINK_KOBJECT_UEVENT */
if (virNetlinkEventServiceStart(NETLINK_KOBJECT_UEVENT, 1) < 0) {
ret = VIR_DAEMON_ERR_NETWORK;
goto cleanup;
}
#endif
/* Run event loop. */
virNetServerRun(srv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册