mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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>
This commit is contained in:
1 parent
4b272d61e8
commit
1893cf7799
1 file changed
+2
-1
@@ -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]
|
||||
|
||||