udev: fix hiding devices from qvm-block

When device becomes non-attachable (for example because it gets mounted,
or used as part of LVM/RAID/whatever), it should be removed from
advertised available devices. The code for removing QubesDB entry was
buggy - the device is actually a directory in QubesDB, not a single
entry.

QubesOS/qubes-issues#1600
This commit is contained in:
Marek Marczykowski-Górecki 2016-01-14 05:01:27 +01:00
parent 1d20cdea89
commit 22d6892ec9
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -9,7 +9,7 @@ QDB_KEY="/qubes-block-devices/$NAME"
xs_remove() {
if [ "$QUBES_EXPOSED" == "1" ]; then
qubesdb-rm "$QDB_KEY"
qubesdb-rm "$QDB_KEY/"
qubesdb-write /qubes-block-devices ''
fi
echo QUBES_EXPOSED=0