[libvirt] [PATCH 6/6] virpci: Allow greater PCI domain value in virPCIDeviceAddressIsValid

Ján Tomko jtomko at redhat.com
Wed Jul 31 10:41:38 UTC 2019


On Wed, Jul 31, 2019 at 10:32:24AM +0200, Michal Privoznik wrote:
>There is no restriction on maximum value of PCI domain. In fact,
>Linux kernel uses plain atomic inc when assigning PCI domains:
>
>drivers/pci/pci.c:static int pci_get_new_domain_nr(void)
>drivers/pci/pci.c-{
>drivers/pci/pci.c-      return atomic_inc_return(&__domain_nr);
>drivers/pci/pci.c-}
>
>Of course, this function is called only if kernel was compiled
>without PCI domain support or ACPI did not provide PCI domain.
>
>However, QEMU still has the same restriction as us: in
>set_pci_host_devaddr() QEMU checks if domain isn't greater than
>0xffff. But one can argue that that's a QEMU limitation. We still
>want to be able to cope with other hypervisors that don't have
>this limitation (possibly).
>

I would argue that by lifting this check we fail to report the error
early for QEMU that (still) lacks the support for it.

But I doubt that the QEMU fix will be detectable in our capability
probing code, so:

>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> docs/schemas/basictypes.rng                   | 2 +-
> src/util/virpci.c                             | 2 +-
> tests/qemuxml2argvdata/pci-domain-invalid.xml | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190731/59b67ce7/attachment-0001.sig>


More information about the libvir-list mailing list