From: eXeC001er Subject: [PATCH]: blktap2 : control function Date: Fri, 21 May 2010 20:51:12 +0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1984674359==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel List-Id: xen-devel@lists.xenproject.org --===============1984674359== Content-Type: multipart/alternative; boundary=0016e656ad16a789a304871d7fd2 --0016e656ad16a789a304871d7fd2 Content-Type: text/plain; charset=UTF-8 Hi. I tried to create small patch for blktap2 : control function: 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 @@ 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. --0016e656ad16a789a304871d7fd2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi.

I tried to create small patch for=C2=A0blktap2 : con= trol function:

diff -r 840f269d95fb tools/pyt= hon/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDo= mainInfo.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 @@
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 fn =3D BOOTLOADER_LOOPBACK_DEVICE
=C2=A0
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 try:<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0time.sle= ep(5)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 blcfg =3D bootloader(blexec, fn, self, False,
=C2=A0=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bootloader_args, kernel, ramdi= sk, args)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 finally:
@@ = -3299,7 +3300,7 @@
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 log.info(&q= uot;Unmounting %s from %s." %
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(fn, BOOTLOADER_LOOPBACK_DEVICE))
=C2=A0
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_D= EVICE)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE)
<= div>=C2=A0
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if blc= fg is None:
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 msg =3D = "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=C2=A0it again, because i get error "raise VmError("Dev= ice %s is already connected." % dev_str)" in "DevController.= py".

but i found workaround:

stop b= lktap2_mount: echo 1 >=C2=A0/sys/class/blktap2/blktapX/remove
= remove records from xenstore:=C2=A0
xenstore-rm /vm/00000000-0000= -0000-0000-000000000000
xenstore-write /local/domain/0/vm ""

Now i can run my DomU again.
--0016e656ad16a789a304871d7fd2-- --===============1984674359== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1984674359==--