[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V4 16/24] libxl: copy function for builtin types



> > I think we can probably use LIBXL_API_VERSION to add this parameter,
> > similar to how we did for libxl_domain_create_restore. That would mean
> > libxl_uuid_copy would have to accept ctx==NULL, but it seems unlikely to
> > need to log anyway.
> > 
> > Something like:
> > 
> >      #define LIBXL_HAVE_UUID_COPY_CTX_PARAM
> > 
> >         void libxl_uuid_copy(libxl_ctx *ctx, libxl_uuid *dst,
> >                              const libxl_uuid *src);
> >         
> >         #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040400
> >         #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> >         #endif
> > 
> 
> This approach looks reasonable. One question, should I bump
> LIBXL_API_VERSION to 0x040500?

No, this is something which the calling application is required to
define if it wants a particular version of the interface.

There is a check in libxl.h somewhere which defines the valid versions,
you should update that though.

> 
> > ought to do it I think? Perhaps we should do all of libxl_uuid_* for
> > consistency?
> > 
> 
> I don't think so. Looking at the existing API not every function takes a
> ctx.

I think most of them do (for consistency).

>  Other functions which don't involve memory allocation should be
> fine without a ctx.

The problem comes in the future when we discover a need to log or
allocate from this function (as you've just discovered).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.