util: validate pcie_cap_pos != 0 in virDeviceHasPCIExpressLink()
util: validate pcie_cap_pos != 0 in virDeviceHasPCIExpressLink()

virDeviceHasPCIExpressLink() wasn't checking that pcie_cap_pos was
valid before attempting to use it, which could lead to reading the
byte at offset 0 + PCI_CAP_ID_EXP instead of [valid offset] +
PCI_CAP_ID_EXP. In particular, this could happen for "integrated" PCI
devices (those that are on the PCIe root complex). If it happened that
the byte from the wrong address had the "right" bit set, then it would
lead to us innappropriately believing that Express Link info was
available when it wasn't, and the node device driver would then log an
error like this:

  virPCIDeviceGetLinkCapSta:2754 :
  internal error: pci device 0000:00:18.0 is not a PCI-Express device

during a libvirtd restart. (this didn't ever occur until after
virPCIDeviceIsPCIExpress() was made more intelligent in commit
c00b6b1ae, which hasn't yet been in any official release)

Signed-off-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

crobinso/libvirt,nertpinx/libvirt,olafhering/libvirt,jfehlig/libvirt,olafhering/libvirt,jfehlig/libvirt,nertpinx/libvirt,crobinso/libvirt,jfehlig/libvirt,zippy2/libvirt,jfehlig/libvirt,nertpinx/libvirt,zippy2/libvirt,libvirt/libvirt,libvirt/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,zippy2/libvirt,nertpinx/libvirt,libvirt/libvirt,olafhering/libvirt