On Tue, Oct 7, 2014 at 4:35 PM, Nithin Raju <nit...@vmware.com> wrote: > 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>
Wouldn't it be better to simply not set .init for NETDEV_WINDOWS_CLASS in this case? Couple of trivial comments below. > --- > 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); There is a comment below which needs correction. > > /* 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. s/datpaath/datapath s/any calls/any/ > + */ > + 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