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

[Xen-changelog] [xen-unstable] xend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto pci allocation



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1237286552 0
# Node ID 6e3e841f0259888467c0f5ea956d71ab727e19dd
# Parent  f81467ad13563d81f550be69f9f744b940c3916b
xend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto pci allocation

Rather than use "0x0" to signify that the hotplug slot should
be automatically selected by qemu-dm, define AUTO_PHP_SLOT_STR.

At the same time, change the magic value form 0x0 to 0xff,
in line with changes made to qemu-dm to allow any unused PCI
device to be used for hotplug.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConstants.py  |    3 +++
 tools/python/xen/xend/XendDomainInfo.py |    4 ++--
 tools/python/xen/xend/server/pciif.py   |    3 ++-
 tools/python/xen/xm/main.py             |    2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff -r f81467ad1356 -r 6e3e841f0259 tools/python/xen/xend/XendConstants.py
--- a/tools/python/xen/xend/XendConstants.py    Tue Mar 17 10:40:47 2009 +0000
+++ b/tools/python/xen/xend/XendConstants.py    Tue Mar 17 10:42:32 2009 +0000
@@ -135,3 +135,6 @@ VTPM_DELETE_SCRIPT = '/etc/xen/scripts/v
 
 XS_VMROOT = "/vm/"
 
+NR_PCI_DEV = 32
+AUTO_PHP_SLOT = NR_PCI_DEV
+AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEV
diff -r f81467ad1356 -r 6e3e841f0259 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Mar 17 10:40:47 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Mar 17 10:42:32 2009 +0000
@@ -793,7 +793,7 @@ class XendDomainInfo:
                 existing_dev_uuid = sxp.child_value(existing_dev_info, 'uuid')
                 existing_pci_conf = self.info['devices'][existing_dev_uuid][1]
                 existing_pci_devs = existing_pci_conf['devs']
-                vslt = '0x0'
+                vslt = AUTO_PHP_SLOT_STR
                 for x in existing_pci_devs:
                     if ( int(x['domain'], 16) == int(dev['domain'], 16) and
                          int(x['bus'], 16) == int(dev['bus'], 16) and
@@ -801,7 +801,7 @@ class XendDomainInfo:
                          int(x['func'], 16) == int(dev['func'], 16) ):
                         vslt = x['vslt']
                         break
-                if vslt == '0x0':
+                if vslt == AUTO_PHP_SLOT_STR:
                     raise VmError("Device %04x:%02x:%02x.%01x is not connected"
                                   % (int(dev['domain'],16), int(dev['bus'],16),
                                      int(dev['slot'],16), int(dev['func'],16)))
diff -r f81467ad1356 -r 6e3e841f0259 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Tue Mar 17 10:40:47 2009 +0000
+++ b/tools/python/xen/xend/server/pciif.py     Tue Mar 17 10:42:32 2009 +0000
@@ -24,6 +24,7 @@ from xen.xend import arch
 from xen.xend import arch
 from xen.xend.XendError import VmError
 from xen.xend.XendLogging import log
+from xen.xend.XendConstants import *
 
 from xen.xend.server.DevController import DevController
 from xen.xend.server.DevConstants import xenbusState
@@ -218,7 +219,7 @@ class PciController(DevController):
                     try:
                         dev_dict['vslt'] = slot_list[i]
                     except IndexError:
-                        dev_dict['vslt'] = '0x0'
+                        dev_dict['vslt'] = AUTO_PHP_SLOT_STR
 
                 pci_devs.append(dev_dict)
 
diff -r f81467ad1356 -r 6e3e841f0259 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Mar 17 10:40:47 2009 +0000
+++ b/tools/python/xen/xm/main.py       Tue Mar 17 10:42:32 2009 +0000
@@ -2456,7 +2456,7 @@ def parse_pci_configuration(args, state,
     if len(args) == 3:
         vslt = args[2]
     else:
-        vslt = '0x0' #chose a free virtual PCI slot
+        vslt = AUTO_PHP_SLOT_STR
     pci=['pci']
     pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
             r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \

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


 


Rackspace

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