def update_devices_from_compute_resources(self, devices_json):
"""Sync the pci device tracker with compute node information.
To support pci device hot plug, we sync with the compute node
periodically, fetching all devices information from compute node,
update the tracker and sync the DB information.
Devices should not be hot-plugged when assigned to a container,
but possibly the compute node has no such guarantee. The best
we can do is to give a warning if a device is changed
or removed while assigned.
:param devices_json: The JSON-ified string of device information
that is returned from the compute node.
"""
devices = []
for dev in jsonutils.loads(devices_json):
if self.dev_filter.device_assignable(dev):
devices.append(dev)
self._set_hvdevs(devices)
评论列表
文章目录