From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 4/4] libxl: add support for vscsi Date: Thu, 12 Mar 2015 16:47:36 +0000 Message-ID: <1426178856.32572.57.camel@citrix.com> References: <1425635156-2357-1-git-send-email-olaf@aepfle.de> <1425635156-2357-5-git-send-email-olaf@aepfle.de> <1426088006.21353.282.camel@citrix.com> <20150312160728.GA19536@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150312160728.GA19536@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: Wei Liu , Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-03-12 at 17:07 +0100, Olaf Hering wrote: > On Wed, Mar 11, Ian Campbell wrote: > > > On Fri, 2015-03-06 at 10:45 +0100, Olaf Hering wrote: > > > +void libxl_device_vscsi_append_dev(libxl_ctx *ctx, libxl_device_vscsi *hst, > > > + libxl_vscsi_dev *dev); > > > +int libxl_device_vscsi_get_host(libxl_ctx *ctx, > > > + uint32_t domid, > > > + const char *cfg, > > > + libxl_device_vscsi **vscsi_host); > > What do these two non-standard functions do? > > In general the caller would be expected to provide a libxl_device_vscsi, > > which will be filled in, rather than having the function allocate one. > > Is it OK if the caller allocates libxl_device_vscsi, but libxl does > further allocations for the number of libxl_vscsi_dev? Yes, we do that a lot. See also the comment about memory allocation in libxl.h > Related: I see libxl_device_vscsi_dispose does now a pointer check, so I > assume its required to validate input in libxl_device_vscsi_get_host. Not sure what you mean, you should call libxl_device_vcsci_init before using the object and then _dispose when you are done. Ian.