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] CS 21556 (blktap2: Fix tapdisk disktype issues) is no lo

To: eXeC001er <execooler@xxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] CS 21556 (blktap2: Fix tapdisk disktype issues) is no longer working for "vhd" [and 1 more messages]
From: Boris Derzhavets <bderzhavets@xxxxxxxxx>
Date: Mon, 12 Jul 2010 11:05:04 -0700 (PDT)
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Mon, 12 Jul 2010 11:08:16 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1278957904; bh=YtvpwZ3Hz5P5w01nnghcIIFQVWwO9rNLmmGMW+/W94U=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=4Qyt7w86NcI44xvHId8/4S+e2nE7FpTx2GXPpV3nSQ26rBRmosRKwqTM57q5JipGaQ4oGjcCXAQTBztFgjaFFJ5JxfA2Y+yg2S2k3rCOshwQlUbtRLC4yNHakmWSfEkpAT9aXlm9pA588l84KWHrL7X+EkDgoTFaqQPJzmL8ycs=
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=kfJvtDhZseHcOqkcgXZOo15defM7R+oHPsJ+pKL+kT5C4pm6pezqIMw8f7M4bLPvZasdfGWfChOfkg2IBEUjElH7AKVyxTVuuVQAiOLD56RntEkk4ES2/7ZczP0g83jTKu/oYRZaAylo25v/AGFt8J9reYsWLElS7/HR/TXRlwI=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19515.19028.173876.918737@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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
1. [PATCH] blktap2: blktap2 and pygrub (xen-unstable)

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"


2. [PATCH] blktap/blktap2: Fix for incorrect parse disk configuration (xen-unstable)

diff -r a672af698bc3 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py    Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/util/blkif.py    Sun Jul 11 12:13:34 2010 +0400
@@ -87,7 +87,10 @@
                 fn = "/dev/%s" %(fn,)
              
         if typ in ("tap", "tap2"):
-            (taptype, fn) = fn.split(":", 1)
+            if fn.count(":") == 1:
+                (taptype, fn) = fn.split(":", 1)
+            else:
+                (taptype, fn) = fn.split(":", 2)[1:3]
     return (fn, taptype)
 
 def blkdev_uname_to_file(uname):


I've tested this patches. They make things working for NexexentaStor 3.0.2 xen image
with "vhd" files and pygrub as bootloader at Xen 4.1-unstable ( tip CS) & 2.6.32.16 Dom0
on top of Ubuntu 10.04 Server.


Per exeCooler :-


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"


Boris.
P.S. It's just a reminder of content been already posted by exeCooler to xen-devel mailing list.


--- On Mon, 7/12/10, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:

From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] CS 21556 (blktap2: Fix tapdisk disktype issues) is no longer working for "vhd" [and 1 more messages]
To: "eXeC001er" <execooler@xxxxxxxxx>
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Boris Derzhavets" <bderzhavets@xxxxxxxxx>, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
Date: Monday, July 12, 2010, 1:01 PM

Boris Derzhavets writes ("[Xen-devel] CS 21556 (blktap2: Fix tapdisk disktype issues) is no longer working for "vhd""):
> In about the most recent 4-5 days an error :

This is related to 21541:7ff0e885b5c3 and 21728:51160a8ecf7d.

> root@ServerLSX:~/NexentaStor-Community-3.0.2# xm create -c nexentastor-community-3.0.2-xen.cfg
> Using config file "./nexentastor-community-3.0.2-xen.cfg".
> Error: [Errno 2] No such file or directory: 'vhd:/root/NexentaStor-Community-3.0.2/syspool.img'
>
> has been brought back under xen-unstable.

Does this work in 4.0-testing ?

eXeC001er writes ("[Xen-devel] Re: CS 21556 (blktap2: Fix tapdisk disktype issues) is no longer working for "vhd""):
> My patch was not quite correct. I waited until the return change back to
> make a new one.
> The new patch will be ready today or tomorrow. Let's see how will the
> situation was.

Thanks.  As I wrote earlier:

  Can I ask you to try to (a) separate out these patches, and (b)
  explain the reasoning behind them in more detail ?  If you can
  provide a separate message with a separate patch for each change,
  with an explanation at greater length, it will be much easier for us
  to evaluate them.  Thanks.

Thanks,
Ian.

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