[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] [PATCH 1/1] support libnl-3 (v2)
- From: Serge Hallyn <serge hallyn canonical com>
- To: Eric Blake <eblake redhat com>
- Cc: libvir-list redhat com
- Subject: Re: [libvirt] [PATCH 1/1] support libnl-3 (v2)
- Date: Thu, 3 May 2012 14:14:08 -0500
Quoting Eric Blake (eblake redhat com):
> On 05/03/2012 11:55 AM, Stefan Berger wrote:
> >>
> >> +#ifdef HAVE_LIBNL1
> >> +#define nl_alloc nl_handle_alloc
> >> +#define nl_free nl_handle_destroy
> >> +typedef struct nl_handle nlhandle_t;
> >> +#else
> >> +#define nl_alloc nl_socket_alloc
> >> +#define nl_free nl_socket_free
> >> +typedef struct nl_sock nlhandle_t;
> >> +#endif
> >> +
> >
> > I would not #define in the namespace of that library (nl_*).
>
> Agreed that a vir* namespace is safer.
>
> > What about
> > the following:
>
> > #ifdef HAVE_LIBNL1
> >
> > static struct nl_handle *
> > virNLHandleAlloc(void)
> > {
> > return nl_handle_alloc();
> > }
>
> One further:
>
> typedef struct nl_handle virNLHandle;
>
> static virNLHandle *
> virNLHandleAlloc(void) ...
>
> so that the rest of the code is indeed isolated into virNL wrappers with
> no additional #ifdefs.
Yup, I like it, thanks guys.
I don't know whether I'll have time to send a new patch tomorrow. If not
I'll aim to write one over the weekend, but if someone else wants to make
the (somewhat trivial) updates I won't feel upstaged :)
thanks,
-serge
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]