]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Portability fixes for non-linux or old linux platforms
authorDaniel Veillard <veillard@redhat.com>
Wed, 29 Aug 2012 01:21:38 +0000 (09:21 +0800)
committerDaniel Veillard <veillard@redhat.com>
Wed, 29 Aug 2012 01:21:38 +0000 (09:21 +0800)
The commits d57567940153147f4d43875fb92c3030b3178b03 and
080bf330e3749d94ebe094f8deca0e3e67d3f2fe 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

daemon/libvirtd.c

index 19dd26bffc0153ccdfcd5d83e7dab36dca8cc337..352d4fed15ff981766aa8a70e4e7dc12d53ae612 100644 (file)
@@ -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);