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] [PATCH] blktap2 control function (version 2)

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] blktap2 control function (version 2)
From: eXeC001er <execooler@xxxxxxxxx>
Date: Mon, 28 Jun 2010 20:10:35 +0400
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 28 Jun 2010 09:11:56 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=2RDKCWi8vAMiyclZW57bCDDlTf3/LypXGwoRWws0yOk=; b=b2rYcaMYuzODYkUmsis/vpOqeDgygOfS44Yj1cEb/ksyA94HqAMOPNeaj/JMWQ82k0 0jU7ODQCEqyun4G5Due5Ot9BYXvaEKy4Rrvc+d6iw0I9ncwP0hZl4fO3TwjFvOnEIUPA 6kadOkvbvG6PwGkm8KZN8+JpftSTepIIZG//Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iRnOHW85ber6rEBMF9aSOiya3DnQUvC1KMV9/MXVUmIsNVP2fZ/O/USd2YrGKT70Dd p/da44aMH9pPFUmnb6WRqL8y5FMIpsQ1GVc6Imza5cR7DdmA7ir52Yj+T/RNyuX0FXHS RaV0kZWAYjnGwhycxfDo0uY+yXkdcTyQltGXk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19496.50093.690339.748543@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: <AANLkTiluqFq6tNfBO19-jba2AAL1quEQROBNkE03qI2R@xxxxxxxxxxxxxx> <19496.50093.690339.748543@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx


2010/6/28 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
eXeC001er writes ("[Xen-devel] [PATCH] blktap2 control function (version 2)"):
> Patch description:

Thanks for your contribution.

> -    if not os.access(disk, os.R_OK):
> -        msg = "Disk isn't accessible"
> -        log.error(msg)
> -        raise VmError(msg)
> +    attempt = 0
> +    while True:
> +        if not os.access(disk, os.R_OK) and attempt > 3:
> +            msg = "Disk isn't accessible"
> +            log.error(msg)
> +            raise VmError(msg)
> +        else:
> +            break
> +        attempt = attempt + 1

Um, can you explain why this is necessary or reasonable ?  Why three
tries ?  Why do we need to poll for this at all ?  Surely if this
helps in any particular situation it means we have a race, which
should be fixed.

(sometimes) When i use pygrub i have error: Disk isn't accessible.


> diff -r 7dcfdd45bc9e tools/python/xen/xend/XendDomainInfo.py
> --- a/tools/python/xen/xend/XendDomainInfo.py Tue Jun 22 07:31:14 2010 +0100
> +++ b/tools/python/xen/xend/XendDomainInfo.py Sun Jun 27 14:12:26 2010 +0400
> @@ -3269,7 +3269,7 @@
>                      log.info("Unmounting %s from %s." %
>                               (fn, BOOTLOADER_LOOPBACK_DEVICE))
>
> -                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
> +                    dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE, force = True)

I don't understand this area of the code at all well but this change
seems plausible.

You  can see method 'destroyDevice' in class 'XendDomainInfo' in tools/python/xen/xend/XendDomainInfo.py (line 1302 +- 10 lines) (related to "bug-fix 1 and 3" in my list)


> diff -r 7dcfdd45bc9e tools/python/xen/util/blkif.py
> --- a/tools/python/xen/util/blkif.py  Tue Jun 22 07:31:14 2010 +0100
> +++ b/tools/python/xen/util/blkif.py  Sun Jun 27 14:12:26 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]

I'm not sure I understand this.  Is it related to this:
> 2. Bug fix for error: "File 'vhd:/path/.../disk.img' doesn't exist." (not
> correct parsing)
?

yes 
 
> 3. Bug fix for error: "Error: Device 51952 not connected" (in config file
> for DomU we should be use prefix "tap2:tapdisk:xxx" (tap2:xxx) for devices
> from (aio, ram, qcow, vhd, remus) or "tap:tapdisk:xxx" (tap:xxx) for devices
> from (sync, vmdk, qcow2, ioemu))

I haven't tried tap2 at all myself.  Is it fully supported everywhere
now ?

see above
 

Later:
> blktap2_ctrl_func.patch - for xen-4.x-testing only (because in xen-unstable
> i see previous version of patch)

Does that mean that xen-unstable needs fixing too ?  I'd rather apply
a change to xen-unstable first and test it there.

xen-unstable have my previous patch, but it can lead to regression (if use 'tap:xxx' instead  'tap:tapdisk:xxx')
 

Ian.

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