qvm-block: detect read-only devices

release2 mm_23ea1ebe
Marek Marczykowski-Górecki 11 years ago
parent 0bf30e0426
commit 23ea1ebe19

@ -29,6 +29,11 @@ if [ "$MAJOR" -eq 7 -a ! -d /sys/$DEVPATH/loop ]; then
exit 0
fi
# Check if device is read-only
if [ "`cat /sys/$DEVPATH/ro`" -eq 1 ]; then
MODE=r
fi
# Special case for CD
if [ "$ID_TYPE" = "cd" ]; then
if [ "$ID_CDROM_MEDIA" != "1" ]; then

Loading…
Cancel
Save