aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Noonan <snoonan@amazon.com>2013-09-09 11:49:15 +0200
committerJan Beulich <jbeulich@suse.com>2013-09-09 11:49:15 +0200
commit4736f563e73f9e2808c0777deff4f2b4e75752f0 (patch)
tree1f02c96c8ea45406ad574a27db9160fd66574261
parent3aa502a0315402b923d2796f20dad0009970f408 (diff)
downloadxen-4736f563e73f9e2808c0777deff4f2b4e75752f0.tar.gz
xen-4736f563e73f9e2808c0777deff4f2b4e75752f0.tar.bz2
xen-4736f563e73f9e2808c0777deff4f2b4e75752f0.zip
xend: handle extended PCI configuration space when saving state
Newer PCI standards (e.g., PCI-X 2.0 and PCIe) introduce extended configuration space which is larger than 256 bytes. This patch uses stat() to determine the amount of space used to correctly save all of the PCI configuration space. Resets handled by the xen-pciback driver don't have this problem, as that code correctly handles saving extended configuration space. Signed-off-by: Steven Noonan <snoonan@amazon.com> Reviewed-by: Matt Wilson <msw@amazon.com> [msw: adjusted commit message] Signed-off-by: Matt Wilson <msw@amazon.com> master commit: 1893cf77992cc0ce9d827a8d345437fa2494b540 master date: 2013-09-03 16:36:47 +0100
-rw-r--r--tools/python/xen/util/pci.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/python/xen/util/pci.py b/tools/python/xen/util/pci.py
index 98bea1aead..307144ce31 100644
--- a/tools/python/xen/util/pci.py
+++ b/tools/python/xen/util/pci.py
@@ -521,8 +521,9 @@ def save_pci_conf_space(devs_string):
pci_path = sysfs_mnt + SYSFS_PCI_DEVS_PATH + '/' + pci_str + \
SYSFS_PCI_DEV_CONFIG_PATH
fd = os.open(pci_path, os.O_RDONLY)
+ size = os.fstat(fd).st_size
configs = []
- for i in range(0, 256, 4):
+ for i in range(0, size, 4):
configs = configs + [os.read(fd,4)]
os.close(fd)
pci_list = pci_list + [pci_path]