From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhigang Wang Subject: [PATCH]fix losetup -r flag when sharing disk Date: Fri, 25 Jan 2008 18:08:04 +0800 Message-ID: <4799B504.30703@oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060605050302090008080201" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson , keir.fraser@citrix.com Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------060605050302090008080201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------060605050302090008080201 Content-Type: text/x-patch; name="block-roflag-sharing.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="block-roflag-sharing.patch" --- 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 --------------060605050302090008080201 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060605050302090008080201--