[PATCH v2 1/3] nodedev: Wait for device initialization in all public API callbacks
Erik Skultety
eskultet at redhat.com
Wed Apr 14 05:53:11 UTC 2021
On Tue, Apr 13, 2021 at 05:57:13PM +0200, Michal Privoznik wrote:
> Although I have not experienced this in real life, there is a
> possible race condition when creating new device, getting its XML
> or parent or listing its capabilities. If the nodedev driver is
> still enumerating devices (in a separate thread) and one of
> virNodeDeviceGetXMLDesc(), virNodeDeviceGetParent(),
> virNodeDeviceNumOfCaps(), virNodeDeviceListCaps() or
> virNodeDeviceCreate() is called then it can lead to spurious
> results because the device enumeration thread is removing devices
> from or adding them to the internal list of devices (among with
> their states).
>
> Therefore, wait for things to settle down before proceeding with
> nodeDeviceCreate().
s/nodeDeviceCreate/any of the APIs.
Reviewed-by: Erik Skultety <eskultet at redhat.com>
More information about the libvir-list
mailing list