From: Ian Campbell Subject: Re: [PATCH 1 of 2] libxl: Move bdf parsing into libxlu Date: Mon, 2 Apr 2012 12:05:37 +0100 Message-ID: <1333364737.25602.47.camel@zakaz.uk.xensource.com> References: <5386937e6c5c9afaa8a3.1333363656@kodo2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5386937e6c5c9afaa8a3.1333363656@kodo2> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-04-02 at 11:47 +0100, George Dunlap wrote: > # HG changeset patch > # User George Dunlap > # Date 1333362574 -3600 > # Node ID 5386937e6c5c9afaa8a3cd56d391dcc9e40d0596 > # Parent f744e82ea74075983de6d5b0ad0cf7ccacf999a2 > libxl: Move bdf parsing into libxlu > > Config parsing functions do not properly belong in libxl. Move them into > libxlu so that others can use them or not as they see fit. > > No functional changes. One side-effect was making public a private libxl > utility function which just set the elements of a structure from the function > arguments passed in. > [...] > diff -r f744e82ea740 -r 5386937e6c5c tools/libxl/libxl.h > --- a/tools/libxl/libxl.h Wed Feb 29 16:30:34 2012 +0000 > +++ b/tools/libxl/libxl.h Mon Apr 02 11:29:34 2012 +0100 > @@ -573,13 +573,10 @@ int libxl_device_pci_add(libxl_ctx *ctx, > int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev); > int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev); > libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid, int *num); > - > -/* > - * Parse a PCI BDF into a PCI device structure. > - */ > -int libxl_device_pci_parse_bdf(libxl_ctx *ctx, > - libxl_device_pci *pcidev, > - const char *str); > +/* Just initialize the structure elements with the arguments provided. */ > +int libxl_pci_dev_init(libxl_device_pci *pcidev, unsigned int domain, > + unsigned int bus, unsigned int dev, > + unsigned int func, unsigned int vdevfn); libxl__init has a particular meaning described further up in this header. Although you haven't actually used here so it doesn't conflict the general convention is to use the type name as a prefix. Does this function actually add all that much value? The users of it could either open code it or have a local version. Otherwise I think this patch looks good, thanks. Ian.