WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: only add PCI entries to xenstore if there is

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: only add PCI entries to xenstore if there is at least one PCI device
From: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
Date: Fri, 22 Jul 2011 19:36:19 +0200
Delivery-date: Fri, 22 Jul 2011 08:33:34 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to; bh=CXjV1mo9ROVxhcRjyccnSjtiX8A7U+EUJ0pipuwBIv8=; b=Q0FK877vSgWkzjfjpiuaKq4KHPLJTo7GAk5isk2eO1BxaH3O01JA6I03oZE7gC0z6P /Xo1y4+Pk7J4yRd4m4LaeuFPe84P5Jjfk2lznr6zW5J2+l/7FTAk0V8we8gwiV4LfJ0X u699cFYIk5oQKPvwmCpwDGTTkcGc3Bj4//3Jo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.8.4
# 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@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: only add PCI entries to xenstore if there is at least one PCI device, Roger Pau Monne <=