From: Ian Campbell Subject: Re: [PATCH] libxl: add option for discard support to xl disk configuration Date: Wed, 29 Jan 2014 16:19:45 +0000 Message-ID: <1391012385.31814.138.camel@kazak.uk.xensource.com> References: <1390933497-12819-1-git-send-email-olaf@aepfle.de> <20140129150632.GA31958@aepfle.de> <1391011264.31814.134.camel@kazak.uk.xensource.com> <20140129160717.GA11100@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140129160717.GA11100@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: Olaf Hering Cc: anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-01-29 at 17:07 +0100, Olaf Hering wrote: > On Wed, Jan 29, Ian Campbell wrote: > > > On Wed, 2014-01-29 at 16:06 +0100, Olaf Hering wrote: > > > 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. > > I will add such a define. THanks. > > 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. > > I meant the access of the field in libvirt, like "p->discard_enable = val;". > Putting such code into #ifdef LIBXL_HAVE_FOO is fine. Yes, I misunderstood what you meant. The applications choices are to #define LIBXL_API_VERSION to a big enough number or to make things conditional on the appropriate LIBXL_HAVE_FOO. AIUI libvirt has chosen to use the LIBXL_HAVE option. Ian.