
On Mon, Apr 22, 2024 at 02:45:52PM +0200, Marc Hartmayer wrote:
On Fri, Apr 19, 2024 at 04:49 PM +0200, Marc Hartmayer <mhartmay@linux.ibm.com> wrote:
Use a worker pool for processing the events (e.g. udev, mdevctl config changes) and the initialization instead of a separate initThread and a mdevctl-thread. This has the large advantage that we can leverage the job API and now this thread pool is responsible to do all the "costly-work" and emitting the libvirt nodedev events.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> ---
[…snip…]
+ /* must be initialized before trying to reconnect to all the running mdevs + * since there might occur some mdevctl monitor events that will be + * dispatched to the worker pool */ + priv->workerPool = virThreadPoolNewFull(1, 1, 0, nodeDeviceEventHandler,
The more I think about the number of workers in this pool, the more I'm convinced that it's (currently) important to use only _one_ worker (1 udev thread <-> 1 worker), because otherwise we don't have any guarantees that we comply to the following:
order(udev_events) == order(libvirt nodedev events)
And I guess we would like to fulfill this guarantee.
Yes, we need to preserve that ordering, otherwise the events become largely unusable. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|