The init function must be dummy for the unit tests to pass. The
unit tests don't require the kernel datpaath to be loaded, and
without the kernel datapath, any calls netlink calls will fail.

Signed-off-by: Nithin Raju <nit...@vmware.com>
Reported-by: Gurucharan Shetty <gshe...@nicira.com>
---
 lib/netdev-windows.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
index 0518156..56a26ae 100644
--- a/lib/netdev-windows.c
+++ b/lib/netdev-windows.c
@@ -78,6 +78,7 @@ static int query_netdev(const char *devname,
                         struct netdev_windows_netdev_info *reply,
                         struct ofpbuf **bufp);
 static int netdev_windows_init(void);
+static int netdev_windows_init_(void);
 
 /* Generic Netlink family numbers for OVS.
  *
@@ -102,6 +103,16 @@ netdev_windows_cast(const struct netdev *netdev_)
 static int
 netdev_windows_init(void)
 {
+    /* This must be dummy for the unit tests to pass. The unit tests don't
+     * require the kernel datpaath to be loaded, and without the kernel
+     * datapath, any calls netlink calls will fail.
+     */
+    return 0;
+}
+
+static
+netdev_windows_init_(void)
+{
     int error = 0;
     static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
 
@@ -250,7 +261,7 @@ query_netdev(const char *devname,
     ovs_assert(info != NULL);
     netdev_windows_info_init(info);
 
-    error = netdev_windows_init();
+    error = netdev_windows_init_();
     if (error) {
         if (info) {
             *bufp = NULL;
-- 
1.7.4.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to