direct-io.hg

changeset 13805:0c17f16f9f03

Pass the -r flag to losetup for read-only devices.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 06 15:35:18 2007 +0000 (2007-02-06)
parents ffe95edc5266
children 39a2833dde51
files tools/examples/block
line diff
     1.1 --- a/tools/examples/block	Wed Jan 31 11:05:36 2007 -0800
     1.2 +++ b/tools/examples/block	Tue Feb 06 15:35:18 2007 +0000
     1.3 @@ -367,7 +367,13 @@ mount it read-write in a guest domain."
     1.4            fatal 'Failed to find an unused loop device'
     1.5          fi
     1.6  
     1.7 -        do_or_die losetup "$loopdev" "$file"
     1.8 +        cmode=`canonicalise_mode $mode`
     1.9 +        if [ "$cmode" == 'r' ]
    1.10 +        then
    1.11 +          do_or_die losetup -r "$loopdev" "$file"
    1.12 +        else
    1.13 +          do_or_die losetup "$loopdev" "$file"
    1.14 +        fi
    1.15          xenstore_write "$XENBUS_PATH/node" "$loopdev"
    1.16          write_dev "$loopdev"
    1.17          release_lock "block"