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

Re: [Xen-devel] Fix for loop mounting of readonly images

To: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Subject: Re: [Xen-devel] Fix for loop mounting of readonly images
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Tue, 6 Feb 2007 15:35:54 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 06 Feb 2007 07:35:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070202204313.GG18218@xxxxxxxxxx>
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>
References: <20070202204313.GG18218@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Fri, Feb 02, 2007 at 08:43:13PM +0000, Daniel P. Berrange wrote:

> We hit an wierd edge case when booting a fullyvirt guest VM off an ISO 
> image stored on NFS, where the hotplug scripts would fail to map the
> ISO to the backend. This only happened if the ISO image was marked readonly,
> but on a read-write NFS mount. It worked fine on a readonly NFS mount!
> 
> After a little debugging appears that losetup was failing with:
> 
> # mount -orw nfs1:/some/path /mnt
> # strace -e trace=open losetup /dev/loop0  /mnt/rhel4-i386-AS/images/boot.iso 
> 2>&1 | grep boot.iso
> open("/mnt/rhel4-i386-AS/images/boot.iso", O_RDWR) = -1 EACCES (Permission 
> denied)
> /mnt/rhel4-i386-AS/images/boot.iso: Permission denied
> 
> When the NFS mount is mounted read-only it works, because it falls back
> to setting up a readonly loop device:
> 
> # mount -oro nfs1:/some/path /mnt
> # strace -e trace=open losetup /dev/loop0  /mnt/rhel4-i386-AS/images/boot.iso 
> 2>&1 | grep boot.iso
> open("/mnt/rhel4-i386-AS/images/boot.iso", O_RDWR) = -1 EROFS (Read-only file 
> system)
> open("/mnt/rhel4-i386-AS/images/boot.iso", O_RDONLY) = 3
> 
> Which made me wonder - why don't we request a readonly loopdevice in the
> first place, given that the ISO is being exported read-only to the guest.
> 
> So I'm ataching a patch to teh block hotplug scripts which will automatically
> pass the '-r' option to losetup if the device sharing mode is 'r'
> 
>    Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

Applied, thank you.

Ewan.

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

<Prev in Thread] Current Thread [Next in Thread>