This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-3.1-testing] Enable loopback disk image files on re

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] Enable loopback disk image files on readonly nfs filesystem.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Jan 2008 07:10:36 -0800
Delivery-date: Thu, 24 Jan 2008 07:13:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1201186677 0
# Node ID 8fae9e400c4e156f2f216f338365dc053ddf58e7
# Parent  b8140d119ef8651e229c745b2478311154ff1892
Enable loopback disk image files on readonly nfs filesystem.

When we losetup a file on readonly nfs filesystem, it fails with:
# losetup /dev/loop7 /data/vm/xen_el5_i386_para/system.raw
/data/vm/xen_el5_i386_para/system.raw: Permission denied

New version of losetup has add a "-r" option for readonly loop, which
Linux kernel has supported for a long time. Some distribution (EL5
update, Fedora 8, etc.) have shipped it. This patch benefit this
option while doesn't break the old versions of losetup.

Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
xen-unstable changeset:   16330:fbe7ed173314723f80f105e7e60fddd0bed77e5b
xen-unstable date:        Wed Nov 07 09:22:31 2007 +0000
 tools/examples/block |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r b8140d119ef8 -r 8fae9e400c4e tools/examples/block
--- a/tools/examples/block      Thu Jan 24 14:53:46 2008 +0000
+++ b/tools/examples/block      Thu Jan 24 14:57:57 2008 +0000
@@ -367,7 +367,10 @@ mount it read-write in a guest domain."
           fatal 'Failed to find an unused loop device'
-        do_or_die losetup "$loopdev" "$file"
+        status=$(losetup "$loopdev" "$file" || echo "failed")
+        if [ -n "$status" ]; then
+          do_or_die losetup -r "$loopdev" "$file"
+        fi
         xenstore_write "$XENBUS_PATH/node" "$loopdev"
         write_dev "$loopdev"
         release_lock "block"

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] Enable loopback disk image files on readonly nfs filesystem., Xen patchbot-3.1-testing <=