|
@@ -16,6 +16,11 @@ if [ -n "`ls -A /sys/$DEVPATH/holders 2> /dev/null`" ]; then
|
|
|
xenstore-rm "$XS_KEY"
|
|
|
exit 0
|
|
|
fi
|
|
|
+# ... and "empty" loop devices
|
|
|
+if [ "$MAJOR" -eq 7 -a ! -d /sys/$DEVPATH/loop ]; then
|
|
|
+ xenstore-rm "$XS_KEY"
|
|
|
+ exit 0
|
|
|
+fi
|
|
|
|
|
|
# Special case for CD
|
|
|
if [ "$ID_TYPE" = "cd" ]; then
|
|
@@ -26,6 +31,11 @@ if [ "$ID_TYPE" = "cd" ]; then
|
|
|
fi
|
|
|
MODE=r
|
|
|
fi
|
|
|
+
|
|
|
+# Special description for loop devices
|
|
|
+if [ -d /sys/$DEVPATH/loop ]; then
|
|
|
+ DESC=$(cat /sys/$DEVPATH/loop/backing_file)
|
|
|
+fi
|
|
|
xenstore-write "$XS_KEY/desc" "$DESC" "$XS_KEY/size" "$SIZE" "$XS_KEY/mode" "$MODE"
|
|
|
|
|
|
# Make sure that block backend is loaded
|