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

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]: blktap2 : control function
From: eXeC001er <execooler@xxxxxxxxx>
Date: Sat, 22 May 2010 12:05:25 +0400
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 22 May 2010 01:06:25 -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=17ZkENI8Px6bkPf9JYfyuvQmo4d36WNbFGUQpshsmHE=; b=onA8X3c/XnWYfzap2i3XYw0EXZp1eKLXIpJTDLnI0Tzjh5xObZgy42wdi/uBI76cxZ Ey0joqmiHatlLmZroQEt4bhPQgdVyzvzVSOvp7eu+/IDK2mcneTjn6+Mnd/5e9FZUf9l JkYxK8iVSMXHwoXHgSdHpZdsAMnRqhnp4cDQI=
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=fnIO2PYYEmzz1K4u7Vu2CkOQ9GeF7cvwkZTVNLGQ1RZ3Dti97XlVJq8t07P6HCiq8Y A7FMhLFsMEGnbbVd+ZQsIPizXu/y/00tQYpSpgK3nCsppZWoG0fzPPBMRKsiXibSXT3C TqbZ+UW61Y/2DWsIq8AaLOQtgeJhAeeq2q0dE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BF72CFA.9020409@xxxxxxxx>
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: <AANLkTimvs-DX-SNhhSDg7p27csdZX_8NfXHTPpCUE9q5@xxxxxxxxxxxxxx> <20100521202727.GY17817@xxxxxxxxxxx> <AANLkTil4aNHL83LZlImRKdNabAiZHCp2LgEOlzPJR6yP@xxxxxxxxxxxxxx> <20100521212812.GZ17817@xxxxxxxxxxx> <4BF72CFA.9020409@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
without this 'sleep' bootloader return error: 'Disk isn't accessible' from this block:

XendBootloader.py : def bootloader (....)
if not os.access(disk, os.R_OK):
        msg = "Disk isn't accessible"
        log.error(msg)
        raise VmError(msg)

2010/5/22 Jeremy Fitzhardinge <jeremy@xxxxxxxx>
On 05/21/2010 02:28 PM, Pasi Kärkkäinen wrote:
> On Sat, May 22, 2010 at 01:23:46AM +0400, eXeC001er wrote:
>
>>    resend.
>>    with additional
>>
>>
> Now it's OK.
> Hopefully someone familiar with the code can review it..
>

The sleep(5) is almost certainly not the correct fix.

   J

> -- Pasi
>
>
>>    2010/5/22 Pasi KÀrkkÀinen <[1]pasik@xxxxxx>
>>
>>      On Fri, May 21, 2010 at 08:51:12PM +0400, eXeC001er wrote:
>>      > Â  Â Hi.
>>      > Â  Â I tried to create small patch forÃ* blktap2 : control function:
>>      >
>>
>>      This patch is horribly broken at least for me.. It looks really weird.
>>      You might want to re-send it in a proper format..
>>
>>      .. Or if it works for others just forget about this rant:)
>>
>>      -- Pasi
>>      > Â  Â diff -r 840f269d95fb tools/python/xen/xend/XendDomainInfo.py
>>      >   Â --- a/tools/python/xen/xend/XendDomainInfo.py   Wed May 19
>>      22:59:52 2010
>>      > Â  Â +0100
>>      >   Â +++ b/tools/python/xen/xend/XendDomainInfo.py   Fri May 21
>>      20:17:15 2010
>>      > Â  Â +0400
>>      > Â  Â @@ -3292,6 +3292,7 @@
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â fn =
>>      BOOTLOADER_LOOPBACK_DEVICE
>>      > Â  Â Ã*
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â try:
>>      > Â  Â + Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* time.sleep(5)
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â blcfg =
>>      bootloader(blexec, fn, self, False,
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã*
>>      Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* bootloader_args,
>>      > Â  Â kernel, ramdisk, args)
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â finally:
>>      > Â  Â @@ -3299,7 +3300,7 @@
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã*
>>      Â [1][2]log.info("Unmounting %s from %s." %
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã*
>>      Â Ã* Â Ã* (fn,
>>      > Â  Â BOOTLOADER_LOOPBACK_DEVICE))
>>      > Â  Â Ã*
>>      > Â  Â - Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã*
>>      dom0.destroyDevice('tap',
>>      > Â  Â BOOTLOADER_LOOPBACK_DEVICE)
>>      > Â  Â + Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã*
>>      dom0.destroyDevice(devtype,
>>      > Â  Â BOOTLOADER_LOOPBACK_DEVICE)
>>      > Â  Â Ã*
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â if blcfg is None:
>>      > Â  Â Ã* Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â Ã* Â msg = "Had a
>>      bootloader specified, but can't
>>      > Â  Â find disk"
>>      > Â  Â With this patch DomU boot from VHD disk without error.
>>      > Â  Â But i can not fix other bug:
>>      > Â  Â if after DomU (boot disk is blktap2-type) stopped i can not
>>      startÃ* it
>>      > Â  Â again, because i get error "raise VmError("Device %s is already
>>      > Â  Â connected." % dev_str)" in "DevController.py".
>>      > Â  Â but i found workaround:
>>      > Â  Â stop blktap2_mount: echo 1 >Ã* /sys/class/blktap2/blktapX/remove
>>      > Â  Â remove records from xenstore:Ã*
>>      > Â  Â xenstore-rm /vm/00000000-0000-0000-0000-000000000000
>>      > Â  Â xenstore-write /local/domain/0/vm ""
>>      > Â  Â Now i can run my DomU again.
>>      >
>>      > References
>>      >
>>      > Â  Â Visible links
>>      > Â  Â 1. [3]http://log.info/
>>
>>      > _______________________________________________
>>      > Xen-devel mailing list
>>      > [4]Xen-devel@xxxxxxxxxxxxxxxxxxx
>>      > [5]http://lists.xensource.com/xen-devel
>>
>> References
>>
>>    Visible links
>>    1. mailto:pasik@xxxxxx
>>    2. http://log.info/
>>    3. http://log.info/
>>    4. mailto:Xen-devel@xxxxxxxxxxxxxxxxxxx
>>    5. http://lists.xensource.com/xen-devel
>>
>
>> diff -r d0420ab97345 tools/python/xen/util/blkif.py
>> --- a/tools/python/xen/util/blkif.py Fri May 21 16:21:39 2010 +0100
>> +++ b/tools/python/xen/util/blkif.py Sat May 22 01:21:15 2010 +0400
>> @@ -87,7 +87,7 @@
>>                  fn = "/dev/%s" %(fn,)
>>
>>          if typ in ("tap", "tap2"):
>> -            (taptype, fn) = fn.split(":", 1)
>> +            (taptype, fn) = fn.split(":", 2)[1:]
>>      return (fn, taptype)
>>
>>  def blkdev_uname_to_file(uname):
>> diff -r d0420ab97345 tools/python/xen/xend/XendDomainInfo.py
>> --- a/tools/python/xen/xend/XendDomainInfo.py        Fri May 21 16:21:39 2010 +0100
>> +++ b/tools/python/xen/xend/XendDomainInfo.py        Sat May 22 01:21:15 2010 +0400
>> @@ -3292,6 +3292,7 @@
>>                  fn = BOOTLOADER_LOOPBACK_DEVICE
>>
>>              try:
>> +                time.sleep(5)
>>                  blcfg = bootloader(blexec, fn, self, False,
>>                                     bootloader_args, kernel, ramdisk, args)
>>              finally:
>> @@ -3299,7 +3300,7 @@
>>                      log.info("Unmounting %s from %s." %
>>                               (fn, BOOTLOADER_LOOPBACK_DEVICE))
>>
>> -                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
>> +                    dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE)
>>
>>              if blcfg is None:
>>                  msg = "Had a bootloader specified, but can't find disk"
>>
>
> _______________________________________________
> Xen-devel mailing list

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