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] Re: xl create should refuse to share block devices RW betwee

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: xl create should refuse to share block devices RW between domains
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 27 Jul 2010 08:23:43 -0700
Cc: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Tue, 27 Jul 2010 08:24:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19534.63648.652292.804989@xxxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4C4E2A06.9070604@xxxxxxxx> <19534.63648.652292.804989@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Thunderbird/3.1.1
 On 07/27/2010 08:17 AM, Ian Jackson wrote:
Jeremy Fitzhardinge writes ("xl create should refuse to share block devices RW 
between domains"):
   When creating a domain, "xl create" should fail if a block device is
shared RW between domains, like xm create does.

I'm not sure how this would be implemented.  Search xenstore for
references to the device when setting up a domain?
Does this safety catch have to be 100% reliable ?  If not then there
are some useful heuristics: for example, you could see whether the
device is a devmapper device and if so check its open count.  That
would catch simultaneously mounting the fs in dom0.

Well, my specific use case is that I have pairs of domain configs, one PV, one HVM, referring to the same set of resources. I want xl create to catch when I try and create the PV version of a domain while the HVM is still running.

A more comprehensive check would be nice, but just this would be useful. But whatever it does check should be 100% reliable.

Doesn't the kernel already have some features to try to stop multiple
conflicting uses of the same block device ?  Perhaps blktap[2] should
do the same ?

Not in general. The only interlock the kernel has is that you can't change the partition mapping on a device while it is in use. The e2fsprogs do generally try to stop mistakes like fscking a mounted filesystem, but it fails to detect if the block device is being used by blktap (and that does make quite a bit of a mess, it turns out...).

    J

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