udev: skip empty device-mapper nodes

It can happen during device reconfiguration - do not decide to expose
the device until its known what device it will be.
This fixes bug where root.img was visible in qvm-block as normal device
and could be detached.
This commit is contained in:
Marek Marczykowski-Górecki 2014-07-04 03:29:38 +02:00
parent 44e5c20806
commit 58df64ad20

View File

@ -12,6 +12,7 @@ ENV{MAJOR}=="202", GOTO="qubes_block_end"
# Skip device-mapper devices # Skip device-mapper devices
ENV{MAJOR}=="253", ENV{DM_NAME}=="snapshot-*", GOTO="qubes_block_end" ENV{MAJOR}=="253", ENV{DM_NAME}=="snapshot-*", GOTO="qubes_block_end"
ENV{MAJOR}=="253", ENV{DM_NAME}=="", GOTO="qubes_block_end"
IMPORT{db}="QUBES_EXPOSED" IMPORT{db}="QUBES_EXPOSED"
ACTION=="add", IMPORT{program}="/usr/bin/flock /var/run/qubes-udev.lock -c /usr/libexec/qubes/udev-block-add-change" ACTION=="add", IMPORT{program}="/usr/bin/flock /var/run/qubes-udev.lock -c /usr/libexec/qubes/udev-block-add-change"