udev-block-add-change: don't exclude already attached devs

For example, attaching a device-mapper device to another VM increases
its "dmsetup info" open count in is_used(), which triggered its removal
from qvm-block.
This commit is contained in:
Rusty Bird 2016-07-15 16:15:41 +00:00
parent e7d7111f13
commit 6b32378158
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -11,6 +11,10 @@ MODE=w
QDB_KEY="/qubes-block-devices/$NAME" QDB_KEY="/qubes-block-devices/$NAME"
xs_remove() { xs_remove() {
if is_attached /sys$DEVPATH; then
return 0
fi
if [ "$QUBES_EXPOSED" == "1" ]; then if [ "$QUBES_EXPOSED" == "1" ]; then
qubesdb-rm "$QDB_KEY/" qubesdb-rm "$QDB_KEY/"
qubesdb-write /qubes-block-devices '' qubesdb-write /qubes-block-devices ''