[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix config file interpretation when pci= not specified



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.