[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Pass the -r flag to losetup for read-only devices.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1170776118 0
# Node ID 0c17f16f9f0309c3ca452e3d35df006fccf96dea
# Parent  ffe95edc5266f1b05d34a8f45ec03d3b5302abe1
Pass the -r flag to losetup for read-only devices.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tools/examples/block |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r ffe95edc5266 -r 0c17f16f9f03 tools/examples/block
--- a/tools/examples/block      Wed Jan 31 11:05:36 2007 -0800
+++ b/tools/examples/block      Tue Feb 06 15:35:18 2007 +0000
@@ -367,7 +367,13 @@ mount it read-write in a guest domain."
           fatal 'Failed to find an unused loop device'
         fi
 
-        do_or_die losetup "$loopdev" "$file"
+        cmode=`canonicalise_mode $mode`
+        if [ "$cmode" == 'r' ]
+        then
+          do_or_die losetup -r "$loopdev" "$file"
+        else
+          do_or_die losetup "$loopdev" "$file"
+        fi
         xenstore_write "$XENBUS_PATH/node" "$loopdev"
         write_dev "$loopdev"
         release_lock "block"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.