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] Race condition in /etc/xen/scripts/block

To: "Bastian de Groot" <degroot@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Race condition in /etc/xen/scripts/block
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Jul 2010 20:07:29 +1000
Cc:
Delivery-date: Fri, 16 Jul 2010 03:08:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201007161159.10982.degroot@xxxxxxxxxxxxx>
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: <201007161159.10982.degroot@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acskziklrum3jWboThKOjulUggsFOwAACKBA
Thread-topic: [Xen-devel] Race condition in /etc/xen/scripts/block
> Hello,
> 
> I am trying to figure out the behavior of the hook-script for block
devices
> (/etc/xen/scripts/block).
> 
> Here is the problem:
> I want to start a VM. It shall boot from a dm-device, which is setup
by a
> script executed in the script /etc/xen/scripts/block. The dm-device
doesn't
> exist when "xm start " is executed .
> 
> When I place the setup script at the top of the block-script,
everything
> works fine (http://pastebin.com/UYYbGupC). But when the script is
placed in
> the phy case branch of the block-script, the VM won't start
> (http://pastebin.com/iPdJ65AH).
> 
> Whether the VM starts or not, also depends on the runtime of the setup
script.
> When the script is executed fast, it is much more likely that the VM
starts.
> 
> So, is there a way to setup a device in the hook-script?
> 
> My configuration: Xen 3.4 on a 2.6.32 Kernel
> 
> I would appreciate your help on that very much,
> Bastian
> 

I've seen a similar thing when using drbd. When you run 'xm start' the
drbd device is 'secondary' and one of the things the block setup script
does is make it 'primary' which means it can be opened/accessed.
Unfortunately most of the time qemu-dm has already tried to open it and
failed by then.

In that case I solved it by having qemu-dm try to open in a loop with a
sleep each time. Not the most elegant solution but it works.

I don't think the same problem exists with PV domains so if you are
using a PV DomU then I've probably not been much help...

James

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