All of lore.kernel.org
 help / color / mirror / Atom feed
* Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
@ 2010-08-01 19:12 Boris Derzhavets
  2010-08-16 16:35 ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Boris Derzhavets @ 2010-08-01 19:12 UTC (permalink / raw)
  To: Patrick Schlicher; +Cc: Xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1285 bytes --]

Forwarding to you original patch requested.
It works for me.

Boris

--- On Sun, 7/11/10, eXeC001er <execooler@gmail.com> wrote:

From: eXeC001er <execooler@gmail.com>
Subject: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
To: "Xen-devel" <xen-devel@lists.xensource.com>
Date: Sunday, July 11, 2010, 9:18 AM

1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is already connected."2. Bug fix for error: "Error: Device 51952 not connected" 

process of booting DomU with 'mounted-blktap2' (VHD for example) and 'pygrub' as bootloader:





1. Connect boot-device to Dom0 as '/dev/xpvd'2. Pygrub get info for load DomU3. Disconnect boot-device from Dom04. Boot DomU
During step 3 created device disconnecting from Dom0, but xenstore does not scrape away after device disconnected from Dom0 => result: 




    "Error: Device /dev/xvdp (51952, tap2) is already connected."





During step 3 created device disconnecting from Dom0, but 'destroyDevice' method is passed 'tap' always => result:    "Error: Device 51952 not connected"

-----Inline Attachment Follows-----

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



      

[-- Attachment #1.2: Type: text/html, Size: 2472 bytes --]

[-- Attachment #2: blkpat2_pygrub.patch --]
[-- Type: text/x-patch, Size: 1617 bytes --]

diff -r a672af698bc3 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Jul 11 17:16:39 2010 +0400
@@ -3261,6 +3261,7 @@
 
             taptype = blkdev_uname_to_taptype(disk)
             mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
+            mounted_vbd_uuid = 0
             if mounted:
                 # This is a file, not a device.  pygrub can cope with a
                 # file if it's raw, but if it's QCOW or other such formats
@@ -3276,7 +3277,8 @@
 
                 from xen.xend import XendDomain
                 dom0 = XendDomain.instance().privilegedDomain()
-                dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk))
+                mounted_vbd_uuid = dom0.create_vbd(vbd, disk);
+                dom0._waitForDeviceUUID(mounted_vbd_uuid)
                 fn = BOOTLOADER_LOOPBACK_DEVICE
 
             try:
@@ -3286,8 +3288,9 @@
                 if mounted:
                     log.info("Unmounting %s from %s." %
                              (fn, BOOTLOADER_LOOPBACK_DEVICE))
-
-                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+                    _, vbd_info = dom0.info['devices'][mounted_vbd_uuid]
+                    dom0.destroyDevice(dom0.getBlockDeviceClass(vbd_info['devid']), 
+                                       BOOTLOADER_LOOPBACK_DEVICE, force = True)
 
             if blcfg is None:
                 msg = "Had a bootloader specified, but can't find disk"

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
  2010-08-01 19:12 Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable) Boris Derzhavets
@ 2010-08-16 16:35 ` Stefano Stabellini
  2010-10-31 23:21   ` Łukasz Oleś
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2010-08-16 16:35 UTC (permalink / raw)
  To: Boris Derzhavets; +Cc: Patrick Schlicher, Xen-devel

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

On Sun, 1 Aug 2010, Boris Derzhavets wrote:
> Forwarding to you original patch requested.
> It works for me.
> 
> Boris
> 
> --- On Sun, 7/11/10, eXeC001er <execooler@gmail.com> wrote:
> 
>       From: eXeC001er <execooler@gmail.com>
>       Subject: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
>       To: "Xen-devel" <xen-devel@lists.xensource.com>
>       Date: Sunday, July 11, 2010, 9:18 AM
> 
>       1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is already connected."
> 2. Bug fix for error: "Error: Device 51952 not connected" 
> 
> 
> process of booting DomU with 'mounted-blktap2' (VHD for example) and 'pygrub' as bootloader:
> 
> 1. Connect boot-device to Dom0 as '/dev/xpvd'
> 2. Pygrub get info for load DomU
> 3. Disconnect boot-device from Dom0
> 4. Boot DomU
> 
> During step 3 created device disconnecting from Dom0, but xenstore does not scrape away after device disconnected
> from Dom0 => result: 
>     "Error: Device /dev/xvdp (51952, tap2) is already connected."
> 
> During step 3 created device disconnecting from Dom0, but 'destroyDevice' method is passed 'tap' always => result:
>     "Error: Device 51952 not connected"
> 

applied, thanks

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
  2010-08-16 16:35 ` Stefano Stabellini
@ 2010-10-31 23:21   ` Łukasz Oleś
  2010-11-08 12:40     ` Łukasz Oleś
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Oleś @ 2010-10-31 23:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Stefano Stabellini

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.
> > 
> > Boris
> > 
> > --- On Sun, 7/11/10, eXeC001er <execooler@gmail.com> wrote:
> >       From: eXeC001er <execooler@gmail.com>
> >       Subject: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub
> >       (xen-unstable) To: "Xen-devel" <xen-devel@lists.xensource.com>
> >       Date: Sunday, July 11, 2010, 9:18 AM
> >       
> >       1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
> >       already connected."
> > 
> > 2. Bug fix for error: "Error: Device 51952 not connected" 
> > 
> > 
> > process of booting DomU with 'mounted-blktap2' (VHD for example) and
> > 'pygrub' as bootloader:
> > 
> > 1. Connect boot-device to Dom0 as '/dev/xpvd'
> > 2. Pygrub get info for load DomU
> > 3. Disconnect boot-device from Dom0
> > 4. Boot DomU
> > 
> > During step 3 created device disconnecting from Dom0, but xenstore does
> > not scrape away after device disconnected from Dom0 => result:
> >     "Error: Device /dev/xvdp (51952, tap2) is already connected."
> > 
> > During step 3 created device disconnecting from Dom0, but 'destroyDevice'
> > method is passed 'tap' always => result: "Error: Device 51952 not
> > connected"
> 
> applied, thanks

Could you merge it also to Xen 4.0? Without this patch I can not use vhd + 
pygrub. In  Xen-unstable it was added in commit cd5b4135fe03.

Regards,

Łukasz Oleś

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
  2010-10-31 23:21   ` Łukasz Oleś
@ 2010-11-08 12:40     ` Łukasz Oleś
  2010-11-11 13:31       ` Philipp Hahn
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Oleś @ 2010-11-08 12:40 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Stefano Stabellini

2010/11/1 Łukasz Oleś <lukaszoles@gmail.com>:
> 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.
>> >
>> > Boris
>> >
>> > --- On Sun, 7/11/10, eXeC001er <execooler@gmail.com> wrote:
>> >       From: eXeC001er <execooler@gmail.com>
>> >       Subject: [Xen-devel] [PATCH] blktap2: blktap2 and pygrub
>> >       (xen-unstable) To: "Xen-devel" <xen-devel@lists.xensource.com>
>> >       Date: Sunday, July 11, 2010, 9:18 AM
>> >
>> >       1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
>> >       already connected."
>> >
>> > 2. Bug fix for error: "Error: Device 51952 not connected"
>> >
>> >
>> > process of booting DomU with 'mounted-blktap2' (VHD for example) and
>> > 'pygrub' as bootloader:
>> >
>> > 1. Connect boot-device to Dom0 as '/dev/xpvd'
>> > 2. Pygrub get info for load DomU
>> > 3. Disconnect boot-device from Dom0
>> > 4. Boot DomU
>> >
>> > During step 3 created device disconnecting from Dom0, but xenstore does
>> > not scrape away after device disconnected from Dom0 => result:
>> >     "Error: Device /dev/xvdp (51952, tap2) is already connected."
>> >
>> > During step 3 created device disconnecting from Dom0, but 'destroyDevice'
>> > method is passed 'tap' always => result: "Error: Device 51952 not
>> > connected"
>>
>> applied, thanks
>
> Could you merge it also to Xen 4.0? Without this patch I can not use vhd +
> pygrub. In  Xen-unstable it was added in commit cd5b4135fe03.

ping

-- 
Łukasz Oleś

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable)
  2010-11-08 12:40     ` Łukasz Oleś
@ 2010-11-11 13:31       ` Philipp Hahn
  0 siblings, 0 replies; 5+ messages in thread
From: Philipp Hahn @ 2010-11-11 13:31 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2255 bytes --]

Hello,

Am Montag 08 November 2010 13:40:29 schrieb Łukasz Oleś:
> 2010/11/1 Łukasz Oleś <lukaszoles@gmail.com>:
> > 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@univention.de   
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 #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-11 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-01 19:12 Fw: [PATCH] blktap2: blktap2 and pygrub (xen-unstable) Boris Derzhavets
2010-08-16 16:35 ` Stefano Stabellini
2010-10-31 23:21   ` Łukasz Oleś
2010-11-08 12:40     ` Łukasz Oleś
2010-11-11 13:31       ` Philipp Hahn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.