]> xenbits.xensource.com Git - libvirt.git/commit
nodedev: udev: Convert udev private data to a lockable object
authorErik Skultety <eskultet@redhat.com>
Fri, 6 Oct 2017 13:21:55 +0000 (15:21 +0200)
committerErik Skultety <eskultet@redhat.com>
Thu, 19 Oct 2017 06:54:53 +0000 (08:54 +0200)
commit365553645c92cd34fbceb1fc3b523cb129e79399
tree1eb7c1d90314919da82c298669ecc866e68d06eb
parentc6a16d3c64e77a2ace408e4c24839b8ef242ed5a
nodedev: udev: Convert udev private data to a lockable object

Since there's going to be a worker thread which needs to have some data
protected by a lock, the whole code would just simply get unnecessary
complex, since two sets of locks would be necessary, driver lock (for
udev monitor and event handle) and a mutex protecting thread-local data.
Given the future thread will need to access the udev monitor socket as
well, why not protect everything with a single lock, even better, by
converting the driver's private data to a lockable object, we get the
automatic object disposal feature for free.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
src/node_device/node_device_udev.c
src/node_device/node_device_udev.h