From: "Kasai Takanori" Subject: [PATCH] [IOEMU] Allow blktap to be able to be booted as systemvolume for PV-on-HVM(TAKE 3) Date: Mon, 15 Oct 2007 19:43:21 +0900 Message-ID: <03c001c80f18$3c31d670$e16f210a@VF03007L> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_03BD_01C80F63.A46CECC0" 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 This is a multi-part message in MIME format. ------=_NextPart_000_03BD_01C80F63.A46CECC0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit Hi All, I sent the patch to make blktap work with PV-on-HVM. I corrected the part that had been pointed out in the Xen community. ・All xvdN disk is looked like hdN. ・All tap disks are checked.(tap:aio, tap:sync, tap:vmdk, etc.) We cannot use blktap for the volume of the system with PV-on-HVM and are embarrassed. Could you apply this patch? Or, please give the comment to me. Signed-off-by: Takanori Kasai Best Regards, -- Takanori Kasai ----- Original Message ----- From: "Kasai Takanori" To: "xen-devel" Sent: Thursday, July 12, 2007 9:13 AM Subject: [Xen-devel] [PATCH] Allow blktap to be able to be booted as systemvolume for PV-on-HVM(TAKE 2) > Hi All, > > I sent the patch to make blktap work with PV-on-HVM. > For system volume to boot hda or xvda, > I corrected the patch. > > Signed-off-by: Takanori Kasai > > This patch made it possible to use either. > > disk = [ 'tap:aio:/xen/test/rhel5ga_full.img,hda,w' ] > or > disk = [ 'tap:aio:/xen/test/rhel5ga_full.img,xvda,w' ] > > It is assumed that hda is a volume of the system > if both xvda and hda are specified. > > disk = [ 'file:/xen/test/rhel5ga_full.img,hda,w', > 'tap:aio:/xen/test/drive2.img,xvda,w' ] > > Best Regards, > > -- > Takanori Kasai > > > ----- Original Message ----- > From: "Kasai Takanori" > To: "xen-devel" > Sent: Friday, July 06, 2007 7:50 PM > Subject: [Xen-devel] [PATCH] Allow blktap to be able to be booted as > systemvolume for PV-on-HVM > > >> Hi All, >> >> We were testing the PV driver on the HVM domain. >> When blktap was booting system volume, PV-on-HVM domain was not able to be >> started. >> >> The configuration file is specified as follows. >> disk = [ 'tap:aio:/xen/test/rhel5ga_full.img,hda,w' ] >> >> The error occurred by the initialization of system volume in qemu-dm. >> >> qemu: could not open hard disk image 'aio:/xen/test/rhel5ga_full.img' >> >> It is because "aio:" is added to the head of params in xenstore. >> However, qemu-dm open device by params. >> >> This patch corrected the problem of params on the qemu-dm. >> >> Signed-off-by: Takanori Kasai >> Signed-off-by: Tomonari Horikoshi >> Signed-off-by: Tsunehisa Doi >> >> The execution result is as follows. >> >> # xm create -f rhel5ga_vti.conf >> Using config file "./rhel5ga_vti.conf". >> Started domain RHEL5GA-test2 >> # xm block-list RHEL5GA-test2 >> Vdev BE handle state evt-ch ring-ref BE-path >> 768 0 0 1 -1 -1 /local/domain/0/backend/tap/75/768 >> ... <<= /* Waiting for booting process */ >> # xm block-list RHEL5GA-test2 >> Vdev BE handle state evt-ch ring-ref BE-path >> 768 0 0 4 7 8 /local/domain/0/backend/tap/75/768 >> >> Best Regards, > ------=_NextPart_000_03BD_01C80F63.A46CECC0 Content-Type: application/octet-stream; name="allow-blktap-system-volume-3.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="allow-blktap-system-volume-3.patch" # HG changeset patch=0A= # User kasai.takanori@jp.fujitsu.com=0A= # Date 1192443563 -32400=0A= # Node ID e2ea4abce3ca927ef8cc413b2a4071a2dc12dad0=0A= # Parent 22175cd36a10a418d62328a87ad16dc41213b04e=0A= Allow blktap to be able to be booted as system volume for PV-on-HVM.=0A= =0A= Signed-off-by: Takanori Kasai =0A= =0A= diff -r 22175cd36a10 -r e2ea4abce3ca tools/ioemu/xenstore.c=0A= --- a/tools/ioemu/xenstore.c Fri Oct 12 15:37:13 2007 +0100=0A= +++ b/tools/ioemu/xenstore.c Mon Oct 15 19:19:23 2007 +0900=0A= @@ -82,7 +82,7 @@ void xenstore_parse_domain_config(int do=0A= char **e =3D NULL;=0A= char *buf =3D NULL, *path;=0A= char *fpath =3D NULL, *bpath =3D NULL,=0A= - *dev =3D NULL, *params =3D NULL, *type =3D NULL;=0A= + *dev =3D NULL, *params =3D NULL, *type =3D NULL, *drv =3D NULL;=0A= int i, is_scsi;=0A= unsigned int len, num, hd_index;=0A= =0A= @@ -123,6 +123,14 @@ void xenstore_parse_domain_config(int do=0A= dev =3D xs_read(xsh, XBT_NULL, buf, &len);=0A= if (dev =3D=3D NULL)=0A= continue;=0A= + /* Change xvdN to look like hdN */=0A= + if (!strncmp(dev, "xvd", 3 )) {=0A= + fprintf(logfile, "Change xvd%c to look like hd%c\n",=0A= + dev[3], dev[3]);=0A= + memmove(dev, dev+1, strlen(dev));=0A= + dev[0] =3D 'h';=0A= + dev[1] =3D 'd';=0A= + }=0A= is_scsi =3D !strncmp(dev, "sd", 2);=0A= if ((strncmp(dev, "hd", 2) && !is_scsi) || strlen(dev) !=3D 3 )=0A= continue;=0A= @@ -140,6 +148,22 @@ void xenstore_parse_domain_config(int do=0A= params =3D xs_read(xsh, XBT_NULL, buf, &len);=0A= if (params =3D=3D NULL)=0A= continue;=0A= + /* read the name of the device */=0A= + if (pasprintf(&buf, "%s/type", bpath) =3D=3D -1)=0A= + continue;=0A= + free(drv);=0A= + drv =3D xs_read(xsh, XBT_NULL, buf, &len);=0A= + if (drv =3D=3D NULL)=0A= + continue;=0A= + /* Strip off blktap sub-type prefix aio: - QEMU can autodetect = this */=0A= + if (!strcmp(drv, "tap") && params[0]) {=0A= + char *offset =3D strchr(params, ':'); =0A= + if (!offset)=0A= + continue ;=0A= + memmove(params, offset+1, strlen(offset+1)+1 );=0A= + fprintf(logfile, "Strip off blktap sub-type prefix to = %s\n", params); =0A= + }=0A= +=0A= /* =0A= * check if device has a phantom vbd; the phantom is hooked=0A= * to the frontend device (for ease of cleanup), so lookup =0A= @@ -202,6 +226,7 @@ void xenstore_parse_domain_config(int do=0A= free(buf);=0A= free(path);=0A= free(e);=0A= + free(drv);=0A= return;=0A= }=0A= =0A= ------=_NextPart_000_03BD_01C80F63.A46CECC0 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 ------=_NextPart_000_03BD_01C80F63.A46CECC0--