WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]fix losetup -r flag when sharing disk

To: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, keir.fraser@xxxxxxxxxx
Subject: [Xen-devel] [PATCH]fix losetup -r flag when sharing disk
From: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
Date: Fri, 25 Jan 2008 18:08:04 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 25 Jan 2008 02:10:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.9 (X11/20071031)
hi keir,

this small patch fixes the losetup -r flag when we specify 'w!' to the disk 
mode.

the mode from canonicalise_mode can be 'r' 'w' or '!'. ian's patch doesn't 
consider
the '!' case.

when I specify 'w!' to a disk mode, will results disk setup failure.
log in /var/log/xen/xen-hotplug.log:
[--snip--]
losetup: invalid option -- !
usage:
 losetup loop_device                                       # give info
 losetup -d loop_device                                    # delete
 losetup -f                                                # find unused
 losetup -a                                                # list all used
 losetup -r                                                # read-only loop
 losetup [-e encryption] [-o offset] [-r] {-f|loop_device} file # setup
xenstore-read: couldn't read path backend/vbd/1/768/node
[--snip--]

ian, please confirm.

this patch should apply to xen-unstable and xen-3.2-testing as well.

regards,

zhigang
--- xen-unstable/tools/examples/block.orig      2008-01-25 17:52:19.000000000 
+0800
+++ xen-unstable/tools/examples/block   2008-01-25 17:53:38.000000000 +0800
@@ -329,7 +329,7 @@ mount it read-write in a guest domain."
 
         if LANG=C losetup -h 2>&1 | grep read-only >/dev/null
         then
-          roflag="-$mode"; roflag="${roflag#-w}"
+          roflag="-$mode"; roflag="${roflag#-w}"; roflag="${roflag#-!}"
         else
           roflag=''
         fi
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]fix losetup -r flag when sharing disk, Zhigang Wang <=