Roger Pau Monne
2011-Jul-22 17:36 UTC
[Xen-devel] [PATCH] libxl: only add PCI entries to xenstore if there is at least one PCI device
# HG changeset patch # User royger # Date 1311355474 -7200 # Node ID bb2568713604f2eef45326c271132b06a0bff1cc # Parent e298ce67777eb45187d6581a0c51c2dbe7161000 libxl: only add PCI entries to xenstore if there is at least one PCI device. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r e298ce67777e -r bb2568713604 tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Mon Jul 18 14:38:31 2011 +0100 +++ b/tools/libxl/libxl_create.c Fri Jul 22 19:24:34 2011 +0200 @@ -528,15 +528,17 @@ 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); + if (d_config->num_pcidevs > 0) { + 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, + 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 (ret < 0) { + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, + "libxl_create_pci_backend failed: %d", ret); + goto error_out; + } } if (!d_config->c_info.hvm && d_config->b_info.u.pv.e820_host) { _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel