[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl: add option for discard support to xl disk configuration
On Wed, 2014-01-29 at 16:06 +0100, Olaf Hering wrote: > On Tue, Jan 28, Olaf Hering wrote: > > > Handle new option discard=on|off for disk configuration. It is supposed > > to disable discard support if file based backing storage was > > intentionally created non-sparse to avoid fragmentation of the file. > > > +++ b/tools/libxl/libxl_types.idl > > @@ -415,6 +415,7 @@ libxl_device_disk = Struct("device_disk", [ > > ("removable", integer), > > ("readwrite", integer), > > ("is_cdrom", integer), > > + ("discard_enable", integer), > > This new field changes the API, _libxl_types.h:struct libxl_device_disk > gets a new member. How should code using this new flag recognize if its > present? If it is supposed to be part of a new libxl-4.5 API then > out-of-tree code could put the code into #ifdef LIBXL_API_VERSION >= X. > If not, how should it be done? You should add a #define LIBXL_HAVE_FOO to libxl.h, there are a few examples in there already. There is no need to make the actual field conditional -- that would actually be wrong since it would modify the ABI depending on what the application asked for, meaning it would differ from how libxl was actually built. An application which us using an ABI before 4.5 simply won't think to touch this field. > > For my own purpose I will overload ->readwrite to carry the discard flag > and to preserve the ABI. > > Olaf _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |