From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH]: blktap2 : control function Date: Fri, 21 May 2010 18:01:46 -0700 Message-ID: <4BF72CFA.9020409@goop.org> References: <20100521202727.GY17817@reaktio.net> <20100521212812.GZ17817@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100521212812.GZ17817@reaktio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: =?UTF-8?B?UGFzaSBLw6Rya2vDpGluZW4=?= Cc: Xen-devel , eXeC001er List-Id: xen-devel@lists.xenproject.org On 05/21/2010 02:28 PM, Pasi K=C3=A4rkk=C3=A4inen wrote: > On Sat, May 22, 2010 at 01:23:46AM +0400, eXeC001er wrote: > =20 >> resend. >> with additional >> >> =20 > Now it's OK. > Hopefully someone familiar with the code can review it.. > =20 The sleep(5) is almost certainly not the correct fix. J > -- Pasi > > =20 >> 2010/5/22 Pasi K=C3=83=E2=82=ACrkk=C3=83=E2=82=ACinen <[1]pasik@iki= .fi> >> >> 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: >> > >> >> This patch is horribly broken at least for me.. It looks really w= eird. >> You might want to re-send it in a proper format.. >> >> .. Or if it works for others just forget about this rant:) >> >> -- Pasi >> > =C3=82 =C3=82 diff -r 840f269d95fb tools/python/xen/xend/XendD= omainInfo.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 = error. >> > =C3=82 =C3=82 But i can not fix other bug: >> > =C3=82 =C3=82 if after DomU (boot disk is blktap2-type) stoppe= d i can not >> start=C3=83* it >> > =C3=82 =C3=82 again, because i get error "raise VmError("Devic= e %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/b= lktap2/blktapX/remove >> > =C3=82 =C3=82 remove records from xenstore:=C3=83* >> > =C3=82 =C3=82 xenstore-rm /vm/00000000-0000-0000-0000-00000000= 0000 >> > =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/ >> >> > _______________________________________________ >> > Xen-devel mailing list >> > [4]Xen-devel@lists.xensource.com >> > [5]http://lists.xensource.com/xen-devel >> >> References >> >> 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 >> =20 > =20 >> 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, = args) >> finally: >> @@ -3299,7 +3300,7 @@ >> log.info("Unmounting %s from %s." % >> (fn, BOOTLOADER_LOOPBACK_DEVICE)) >> =20 >> - dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEV= ICE) >> + dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_D= EVICE) >> =20 >> if blcfg is None: >> msg =3D "Had a bootloader specified, but can't find d= isk" >> =20 > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > =20