core-admin/misc/qubes_block.rules
Marek Marczykowski 1aebb12f30 dom0+vm/qvm-block: speed up udev block handler (#560)
xenstore is very slow, so don't bother it when unneeded. Namely do not try to
remove entries, which haven't even created.
2012-06-06 02:12:10 +02:00

20 lines
638 B
Plaintext

# Expose all (except xen-frontend) block devices via xenstore
# Only block devices are interesting
SUBSYSTEM!="block", GOTO="qubes_block_end"
# Skip xen-blkfront devices
ENV{MAJOR}=="202", GOTO="qubes_block_end"
# Skip device-mapper devices
ENV{MAJOR}=="253", GOTO="qubes_block_end"
ACTION=="add", IMPORT{program}="/usr/lib/qubes/block_add_change"
ACTION=="change", IMPORT{program}="/usr/lib/qubes/block_add_change"
ACTION=="remove", RUN+="/usr/lib/qubes/block_remove"
LABEL="qubes_block_end"
# Cleanup disconnected frontend from xenstore
ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/block_cleanup"