On 15.04.2025 12:07, Chen, Jiqian wrote: > On 2025/4/15 17:25, Roger Pau Monné wrote: >> On Wed, Apr 09, 2025 at 02:45:22PM +0800, Jiqian Chen wrote: >>> --- a/xen/drivers/vpci/header.c >>> +++ b/xen/drivers/vpci/header.c >>> @@ -745,6 +745,76 @@ static int bar_add_rangeset(const struct pci_dev >>> *pdev, struct vpci_bar *bar, >>> return !bar->mem ? -ENOMEM : 0; >>> } >>> >>> +/* These capabilities can be exposed to the guest, that vPCI can handle. */ >>> +static const unsigned int guest_supported_caps[] = { >>> + PCI_CAP_ID_MSI, >>> + PCI_CAP_ID_MSIX, >>> +}; >> >> Is there a reason this needs to be defined outside of the function >> scope? So far it's only used by vpci_init_capability_list(). > Because, for dom0 I don't need to pass this array, so I need to set below > parameter "caps" to be NULL or guest_supported_caps according to the type of > domain. > If inside the function, I can't to do that since "caps" is const, I think.
Why would the more narrow scope of the array affect how it can be used? Jan