From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: [PATCH]: blktap2 : control function Date: Sat, 22 May 2010 00:28:12 +0300 Message-ID: <20100521212812.GZ17817@reaktio.net> References: <20100521202727.GY17817@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: eXeC001er Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On Sat, May 22, 2010 at 01:23:46AM +0400, eXeC001er wrote: > resend. > with additional >=20 Now it's OK. Hopefully someone familiar with the code can review it.. -- Pasi > 2010/5/22 Pasi K=C3=83=E2=82=ACrkk=C3=83=E2=82=ACinen <[1]pasik@iki.= fi> >=20 > On Fri, May 21, 2010 at 08:51:12PM +0400, eXeC001er wrote: > > =C3=82 =C3=82 Hi. > > =C3=82 =C3=82 I tried to create small patch for=C3=83* blktap2 = : control function: > > >=20 > This patch is horribly broken at least for me.. It looks really we= ird. > You might want to re-send it in a proper format.. >=20 > .. Or if it works for others just forget about this rant:) >=20 > -- Pasi > > =C3=82 =C3=82 diff -r 840f269d95fb tools/python/xen/xend/XendDo= mainInfo.py > > =C3=82 =C3=82 --- a/tools/python/xen/xend/XendDomainInfo.py =C3= =82 Wed May 19 > 22:59:52 2010 > > =C3=82 =C3=82 +0100 > > =C3=82 =C3=82 +++ b/tools/python/xen/xend/XendDomainInfo.py =C3= =82 Fri May 21 > 20:17:15 2010 > > =C3=82 =C3=82 +0400 > > =C3=82 =C3=82 @@ -3292,6 +3292,7 @@ > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 fn =3D > BOOTLOADER_LOOPBACK_DEVICE > > =C3=82 =C3=82 =C3=83* > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 try: > > =C3=82 =C3=82 + =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3= =83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* time.sle= ep(5) > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 blcfg =3D > bootloader(blexec, fn, self, False, > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* > =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82= =C3=83* bootloader_args, > > =C3=82 =C3=82 kernel, ramdisk, args) > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 finally: > > =C3=82 =C3=82 @@ -3299,7 +3300,7 @@ > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* > =C3=82 [1][2]log.info("Unmounting %s from %s." % > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* > =C3=82 =C3=83* =C3=82 =C3=83* (fn, > > =C3=82 =C3=82 BOOTLOADER_LOOPBACK_DEVICE)) > > =C3=82 =C3=82 =C3=83* > > =C3=82 =C3=82 - =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3= =83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3= =83* =C3=82 =C3=83* > dom0.destroyDevice('tap', > > =C3=82 =C3=82 BOOTLOADER_LOOPBACK_DEVICE) > > =C3=82 =C3=82 + =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3= =83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3= =83* =C3=82 =C3=83* > dom0.destroyDevice(devtype, > > =C3=82 =C3=82 BOOTLOADER_LOOPBACK_DEVICE) > > =C3=82 =C3=82 =C3=83* > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 if blcfg is None: > > =C3=82 =C3=82 =C3=83* =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3=82 =C3=83* =C3= =82 msg =3D "Had a > bootloader specified, but can't > > =C3=82 =C3=82 find disk" > > =C3=82 =C3=82 With this patch DomU boot from VHD disk without e= rror. > > =C3=82 =C3=82 But i can not fix other bug: > > =C3=82 =C3=82 if after DomU (boot disk is blktap2-type) stopped= i can not > start=C3=83* it > > =C3=82 =C3=82 again, because i get error "raise VmError("Device= %s is already > > =C3=82 =C3=82 connected." % dev_str)" in "DevController.py". > > =C3=82 =C3=82 but i found workaround: > > =C3=82 =C3=82 stop blktap2_mount: echo 1 >=C3=83* /sys/class/bl= ktap2/blktapX/remove > > =C3=82 =C3=82 remove records from xenstore:=C3=83* > > =C3=82 =C3=82 xenstore-rm /vm/00000000-0000-0000-0000-000000000= 000 > > =C3=82 =C3=82 xenstore-write /local/domain/0/vm "" > > =C3=82 =C3=82 Now i can run my DomU again. > > > > References > > > > =C3=82 =C3=82 Visible links > > =C3=82 =C3=82 1. [3]http://log.info/ >=20 > > _______________________________________________ > > Xen-devel mailing list > > [4]Xen-devel@lists.xensource.com > > [5]http://lists.xensource.com/xen-devel >=20 > References >=20 > Visible links > 1. mailto:pasik@iki.fi > 2. http://log.info/ > 3. http://log.info/ > 4. mailto:Xen-devel@lists.xensource.com > 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 =3D "/dev/%s" %(fn,) > =20 > if typ in ("tap", "tap2"): > - (taptype, fn) =3D fn.split(":", 1) > + (taptype, fn) =3D fn.split(":", 2)[1:] > return (fn, taptype) > =20 > 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 =3D BOOTLOADER_LOOPBACK_DEVICE > =20 > try: > + time.sleep(5) > blcfg =3D bootloader(blexec, fn, self, False, > bootloader_args, kernel, ramdisk, a= rgs) > finally: > @@ -3299,7 +3300,7 @@ > log.info("Unmounting %s from %s." % > (fn, BOOTLOADER_LOOPBACK_DEVICE)) > =20 > - dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVI= CE) > + dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DE= VICE) > =20 > if blcfg is None: > msg =3D "Had a bootloader specified, but can't find di= sk"