vpci/header: cope with devices not having vpci allocated
PATCH v2 1/1 vpci/header: cope with devices not having vpci allocated
When traversing the list of pci devices assigned to a domain cope with some of them not having the vpci struct allocated. It should be possible for the hardware domain to have read-only devices assigned that are not handled by vPCI, such support will be added by further patches.
---
Changes since v1:
- Do not mention domU plans.
--- xen/drivers/vpci/header.c | 8 ++++++++ 1 file changed, 8 insertions(+)
xen/drivers/vpci/header.c +8 -0
@@ -289,6 +289,14 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)*/ for_each_pdev ( pdev->domain, tmp ) { +if ( !tmp->vpci ) +/* +* For the hardware domain it's possible to have devices assigned +* to it that are not handled by vPCI, either because those are +* read-only devices, or because vPCI setup has failed. +*/ +continue ; +if ( tmp == pdev ) {/*
Signature · 1 line
2.40.0
Quoted 7 lines · Roger Pau Monne
When traversing the list of pci devices assigned to a domain cope with some of them not having the vpci struct allocated. It should be possible for the hardware domain to have read-only devices assigned that are not handled by vPCI, such support will be added by further patches.
Signed-off-by Roger Pau Monné <[email protected]>
I was wondering whether to put an assertion in (permitting both DomXEN and hwdom, i.e. slightly more relaxed than I had it).
Jan
Quoted 10 lines · Jan Beulich
Quoted 7 lines · Roger Pau Monne
When traversing the list of pci devices assigned to a domain cope with some of them not having the vpci struct allocated. It should be possible for the hardware domain to have read-only devices assigned that are not handled by vPCI, such support will be added by further patches.
Signed-off-by Roger Pau Monné <[email protected]>Reviewed-by Jan Beulich <[email protected]>
Thanks.
Quoted 2 lines
I was wondering whether to put an assertion in (permitting both DomXEN and hwdom, i.e. slightly more relaxed than I had it).
I also wondered it, but didn't think it was very helpful, but that was back when I had the comment about how I envisioned this to work for domUs.
Let me know if you want me to add it.
Thanks, Roger.