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

[Xen-changelog] This patch enhances the Summagraphics emulation by adding 2 features:



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4b4d16fe0b05317480a79ec33b696402d214c019
# Parent  50989084d4d0bd3ae8005469f129259aa4d74f5c
The PciController class lacks a configuration method to re-generate the
configuration of an existing domain. This is needed for a domain to be
able to reboot and retain its PCI device configuration. This patch adds
such support.

Thanks to Mike Wright for reporting this problem and working with me to
fix it.

Signed-off-by: Ryan Wilson <hap9@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/server/pciif.py |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+)

diff -r 50989084d4d0 -r 4b4d16fe0b05 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Wed May 10 16:06:55 2006 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Wed May 10 16:07:46 2006 +0100
@@ -31,6 +31,7 @@ import xen.lowlevel.xc
 
 from xen.util.pci import PciDevice
 import resource
+import re
 
 xc = xen.lowlevel.xc.xc()
 
@@ -106,6 +107,30 @@ class PciController(DevController):
 
         return (0, back, {})
 
+    def configuration(self, devid):
+        """@see DevController.configuration"""
+
+        result = DevController.configuration(self, devid)
+
+        (num_devs) = self.readBackend(devid, 'num_devs')
+
+        for i in range(int(num_devs)):
+            (dev_config) = self.readBackend(devid, 'dev-%d'%(i))
+
+            pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
+                    r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
+                    r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
+                    r"(?P<func>[0-9a-fA-F]{1,2})", dev_config)
+            if pci_match!=None:
+                pci_dev_info = pci_match.groupdict('0')
+                result.append( ['dev', \
+                        ['domain', '0x'+pci_dev_info['domain']], \
+                        ['bus', '0x'+pci_dev_info['bus']], \
+                        ['slot', '0x'+pci_dev_info['slot']], \
+                        ['func', '0x'+pci_dev_info['func']]])
+
+        return result
+
     def setupDevice(self, domain, bus, slot, func):
         """ Attach I/O resources for device to frontend domain
         """

_______________________________________________
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®.