From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] libxl: add option for discard support to xl disk configuration Date: Wed, 29 Jan 2014 16:06:32 +0100 Message-ID: <20140129150632.GA31958@aepfle.de> References: <1390933497-12819-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1390933497-12819-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: anthony.perard@citrix.com, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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? For my own purpose I will overload ->readwrite to carry the discard flag and to preserve the ABI. Olaf