From: Ian Campbell Subject: Re: [PATCH] libxl: create pci backend only when there are pci devices Date: Wed, 14 Sep 2011 14:31:14 +0200 Message-ID: <1316003476.2892.27.camel@cthulhu.hellion.org.uk> References: <63e254468d6e8d81baea.1316002763@loki> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <63e254468d6e8d81baea.1316002763@loki> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Roger Pau Monne Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, 2011-09-14 at 08:19 -0400, Roger Pau Monne wrote: > # HG changeset patch > # User Roger Pau Monne > # Date 1316002720 -7200 > # Node ID 63e254468d6e8d81baeafaed68f05791dc21eb4e > # Parent ac33d68e89767d49113824e5661c49a5465a18e7 > libxl: create pci backend only when there are pci devices. I think I recall discussing this a way back but I don't recall the specific rationale, can you add something to the commit message please? Also does this continue to allow a subsequent pci hotplug to work? I expect it does but it would be useful to check. Ian. > > Signed-off-by: Roger Pau Monne > > diff -r ac33d68e8976 -r 63e254468d6e tools/libxl/libxl_create.c > --- a/tools/libxl/libxl_create.c Thu Sep 08 15:13:06 2011 +0100 > +++ b/tools/libxl/libxl_create.c Wed Sep 14 14:18:40 2011 +0200 > @@ -584,12 +584,14 @@ static int do_domain_create(libxl__gc *g > for (i = 0; i < d_config->num_pcidevs; i++) > libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1); > > - ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs, > - d_config->num_pcidevs); > - if (ret < 0) { > - LIBXL__LOG(ctx, LIBXL__LOG_ERROR, > - "libxl_create_pci_backend failed: %d", ret); > - goto error_out; > + if (d_config->num_pcidevs > 0) { > + ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs, > + d_config->num_pcidevs); > + if (ret < 0) { > + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, > + "libxl_create_pci_backend failed: %d", ret); > + goto error_out; > + } > } > > if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV && > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel