]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: new functions to check if PCI address is wanted/present
authorLaine Stump <laine@laine.org>
Wed, 18 May 2016 16:04:42 +0000 (12:04 -0400)
committerLaine Stump <laine@laine.org>
Fri, 20 May 2016 17:54:25 +0000 (13:54 -0400)
commit9a81a363535b24d326f21ce8a81563108c145b7d
tree9c935bb0de3aaadb38ce4d0c85ce7eba3f59b68f
parentff89e9b932c9c1a4749ed2239f0fc67bfd2291d5
conf: new functions to check if PCI address is wanted/present

In order to allow <address type='pci'/> with no other attributes to
mean "I want a PCI address, but any PCI address will do" (just as
having no <address> at all usually indicates), we will need to change
several places in the code from a simple "info->type == (or !=)
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_(PCI|NONE)" into something slightly
more complex, this patch adds to new functions that take a
virDomainDeviceInfoPtr and return true/false depending on 1) whether
the current state of the info indicates that we "want" a PCI address
for this device (virDeviceInfoPCIAddressWanted()) and 2) whether this
device already has a valid PCI address
(virDeviceInfoPCIAddressPresent()).

Both of these functions required the simpler check for whether a pci
address is "empty" (i.e. all of its attributes are 0, which can never
happen in a real PCI address, since slot 0 of bus 0 of domain 0 is
always reserved), so that function is also added.
src/conf/device_conf.h