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] Fix config file interpretation when pci= not specifi

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix config file interpretation when pci= not specified
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 4 Mar 2010 18:47:16 +0000
Delivery-date: Thu, 04 Mar 2010 10:48:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19341.26082.271923.152094@xxxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <19341.26082.271923.152094@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
My code for interpreting the results of the new config parser has
undefined behaviour in the case when pci=... is not specified.  Bad
luck meant it worked for me in my tests.  This patch fixes it.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1267728147 0
# Node ID 2c7d21b063a59bfcc5c327820ffe1b15cf6915ac
# Parent  32c721712bcef07b8e24834abbf1f23ef49640ed
xl: Fix undefined behaviour when pci not specified in input file

diff -r 32c721712bce -r 2c7d21b063a5 tools/libxl/xl.c
--- a/tools/libxl/xl.c  Thu Mar 04 11:23:57 2010 +0000
+++ b/tools/libxl/xl.c  Thu Mar 04 18:42:27 2010 +0000
@@ -590,7 +590,7 @@
     if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l))
         pci_power_mgmt = l;
 
-    if (xlu_cfg_get_list (config, "pci", &pcis, 0)) {
+    if (!xlu_cfg_get_list (config, "pci", &pcis, 0)) {
         *num_pcidevs = 0;
         *pcidevs = NULL;
         while ((buf = xlu_cfg_get_listitem (pcis, *num_pcidevs)) != NULL) {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>