]> xenbits.xensource.com Git - libvirt.git/commit
virpci: Allow greater PCI domain value in virPCIDeviceAddressIsValid
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 30 Jul 2019 14:37:20 +0000 (16:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Aug 2019 17:42:15 +0000 (19:42 +0200)
commitd19c21429fd1acfdade23c903804d6e279d1e00e
tree1ca68708e66b9a8fb8b06c5535add22eeed40145
parent9b332820f39619f816bf1e36ea591bae10352077
virpci: Allow greater PCI domain value in virPCIDeviceAddressIsValid

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).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/schemas/basictypes.rng
src/util/virpci.c
tests/qemuxml2argvdata/pci-domain-invalid.xml