]> xenbits.xensource.com Git - libvirt.git/commit
virpci: introduce virPCIDeviceExists()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 4 Jan 2021 12:54:29 +0000 (09:54 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 1 Mar 2021 15:25:33 +0000 (12:25 -0300)
commit3acc65e1b0823956582dbce6f551e08dfe2f9d37
tree1e961acd423a60b3c2d0ba423d877cb58dca7e1c
parent155151a3d061e36417095f6fc09db3471a9eaa47
virpci: introduce virPCIDeviceExists()

We're going to add logic to handle the case where a previously
existing PCI device does not longer exist in the host.

The logic was copied from virPCIDeviceNew(), which verifies if a
PCI device exists in the host, returning NULL and throwing an
error if it doesn't. The NULL is used for other errors as well
(product/vendor id read errors, dev id overflow), meaning that we
can't re-use virPCIDeviceNew() for the purpose of detecting
if the device exists.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/libvirt_private.syms
src/util/virpci.c
src/util/virpci.h