1 # Expose all (except xen-frontend) block devices via xenstore
3 # Only block devices are interesting
4 SUBSYSTEM!="block", GOTO="qubes_block_end"
6 # Skip xen-blkfront devices
7 ENV{MAJOR}=="202", GOTO="qubes_block_end"
9 # Skip device-mapper devices
10 ENV{MAJOR}=="253", GOTO="qubes_block_end"
12 IMPORT{db}="QUBES_EXPOSED"
13 ACTION=="add", IMPORT{program}="/usr/lib/qubes/block_add_change"
14 ACTION=="change", IMPORT{program}="/usr/lib/qubes/block_add_change"
15 ACTION=="remove", RUN+="/usr/lib/qubes/block_remove"
17 LABEL="qubes_block_end"
19 # Cleanup disconnected frontend from xenstore
20 ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/block_cleanup"