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: Fw: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub (xen-unstable)

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: Fw: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
From: Philipp Hahn <hahn@xxxxxxxxxxxxx>
Date: Thu, 11 Nov 2010 14:31:03 +0100
Delivery-date: Thu, 11 Nov 2010 05:32:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=CRsqNV1K0L2QM+_4sfFLL1Ns-0q+-e2O7hoUR@xxxxxxxxxxxxxx>
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>
Organization: Univention.de
References: <337066.84134.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <201011010021.51382.lukaszoles@xxxxxxxxx> <AANLkTi=CRsqNV1K0L2QM+_4sfFLL1Ns-0q+-e2O7hoUR@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.10 (enterprise35 20100903.1171286)
Hello,

Am Montag 08 November 2010 13:40:29 schrieb Łukasz Oleś:
> 2010/11/1 Łukasz Oleś <lukaszoles@xxxxxxxxx>:
> > On Monday 16 August 2010 18:35:10 Stefano Stabellini wrote:
> >> On Sun, 1 Aug 2010, Boris Derzhavets wrote:
> >> > Forwarding to you original patch requested.
> >> > It works for me.

For me to, but I observed some kind of race condition probably between udev 
creating the device node and pygrub acessing it: The first start of my domain 
failed with "Disk isn't accessible", while subsequent starts worked fine. I 
could reproduce this after doing a reboot: 1st start failed, further starts  
worked fine.
After adding the following hack it even worked on a freshly rebooted system. 
(For my case the loop always exited on the second iteration.)

--- a/xen-4.0.1/tools/python/xen/xend/XendBootloader.py 2010-11-01 
15:33:59.000000000 +0100
+++ b/xen-4.0.1/tools/python/xen/xend/XendBootloader.py 2010-11-11 
13:36:13.000000000 +0100
@@ -15,6 +15,7 @@
 import os, select, errno, stat, signal, tty
 import random
 import shlex
+import time
 from xen.xend import sxp
 
 from xen.util import mkdir, oshelp
@@ -35,13 +36,18 @@
     @param blargs Arguments to pass to the bootloader."""
     
     if not os.access(blexec, os.X_OK):
-         msg = "Bootloader isn't executable"
+         msg = "Bootloader '%s' isn't executable" % blexec
         log.error(msg)
         raise VmError(msg)
-    if not os.access(disk, os.R_OK):
+    
+    retries = 10
+    while not os.access(disk, os.R_OK):
-        msg = "Disk isn't accessible"
+        msg = "Disk '%s' isn't accessible" % disk
         log.error(msg)
-        raise VmError(msg)
+        time.sleep(1)
+        retries -= 1
+        if retries <= 0:
+            raise VmError(msg)
 
     if os.uname()[0] == "NetBSD" and disk.startswith('/dev/'):
        disk = disk.replace("/dev/", "/dev/r")

BYtE
Philipp
-- 
Philipp Hahn           Open Source Software Engineer      hahn@xxxxxxxxxxxxx   
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  28359 Bremen                   fax: +49 421 22 232-99
                                                    http://www.univention.de

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>