mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
node_device: update sriov/iommu info before dumpxml of a device
Because reloading a PF driver with a different number of VFs doesn't result in any sort of event sent from udev to the libvirt node_device driver, libvirt's cache of that info can be out of date when a request arrives for the info about a device. To fix this, we refresh that data at the time of the dumpxml request, similar to what is already done for netdev link info and SCSI host capabilities. Since the same is true for iommu group information (for example, some other device in the same iommu group could have been detached from the host), we also create a function to update the iommu group info from sysfs, and a common function that does both. (a later patch will call this common function from the udev and hal backends). This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=981546
This commit is contained in:
parent
7349fa2ebe
commit
601b0fa872
@ -59,12 +59,16 @@ static int update_caps(virNodeDeviceObjPtr dev)
|
||||
if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
|
||||
return -1;
|
||||
break;
|
||||
case VIR_NODE_DEV_CAP_PCI_DEV:
|
||||
if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
|
||||
&dev->def->caps->data) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
/* all types that (supposedly) don't require any updates
|
||||
* relative to what's in the cache.
|
||||
*/
|
||||
case VIR_NODE_DEV_CAP_SYSTEM:
|
||||
case VIR_NODE_DEV_CAP_PCI_DEV:
|
||||
case VIR_NODE_DEV_CAP_USB_DEV:
|
||||
case VIR_NODE_DEV_CAP_USB_INTERFACE:
|
||||
case VIR_NODE_DEV_CAP_SCSI_TARGET:
|
||||
|
Loading…
Reference in New Issue
Block a user