udev-block-add-change: ignore unconnected Network Block Device

"modprobe nbd" shouldn't instantly send 16 zero byte nbd devices to
dom0.
This commit is contained in:
Rusty Bird 2017-12-30 21:27:28 +00:00
parent 929e03bcba
commit 6b3830ba31
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -119,6 +119,12 @@ if [ "$MAJOR" -eq 7 -a ! -d /sys/$DEVPATH/loop ]; then
exit 0
fi
# or unconnected Network Block Device
if [ "$MAJOR" -eq 43 -a ! -e /sys/$DEVPATH/pid ]; then
xs_remove
exit 0
fi
# ... and loop devices from excluded directories
if [[ "$NAME" = 'loop'* ]]; then
backing_file=$(cat /sys/block/${NAME}/loop/backing_file)