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

Re: [Xen-devel] [PATCH] xend: handle extended PCI configuration space when saving state



On Fri, 2013-08-30 at 16:40 -0700, Matt Wilson wrote:
> From: Steven Noonan <snoonan@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Reviewed-by: Matt Wilson <msw@xxxxxxxxxx>
> [msw: adjusted commit message]
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Signed-off-by: Matt Wilson <msw@xxxxxxxxxx>

I've applied this and "xend: fix file descriptor leak in pci utilities"
on the basis that they looked pretty simple, however in general I'm not
prepared to review xend patches so I am relying on whoever wants to keep
xend alive to co-review each others patches and provide the appropriate
reviewed-by etc (and to take responsibility for the fallout etc).

> ---
>  tools/python/xen/util/pci.py |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/python/xen/util/pci.py b/tools/python/xen/util/pci.py
> index 792fb69..adeca4b 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]



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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