Skip to contentSkip to conversation

Allow blktap to be able to be booted as systemvolume for PV-on-HVM(TAKE 3)

PATCH In review Kasai Takanori 2 participants 3 messages Oct 15, 2007 – Oct 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow blktap to be able to be booted as systemvolume for PV-on-HVM(TAKE 3)

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.

Best Regards,

--
Takanori Kasai

----- Original Message ----- From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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)

Quoted 26 lines

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.

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

Quoted 45 lines

----- Original Message -----
From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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

Quoted 36 lines

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.

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,

# HG changeset patch
# User [email protected]
# Date 1192443563 -32400
# Node ID e2ea4abce3ca927ef8cc413b2a4071a2dc12dad0
# Parent 22175cd36a10a418d62328a87ad16dc41213b04e
Allow blktap to be able to be booted as system volume for PV-on-HVM.

tools/ioemu/xenstore.c +26 -1
diff -r 22175cd36a10 -r e2ea4abce3ca tools/ioemu/xenstore.c
@@ -82,7 +82,7 @@ void xenstore_parse_domain_config(int do
     char **e = NULL;
     char *buf = NULL, *path;
     char *fpath = NULL, *bpath = NULL,
-        *dev = NULL, *params = NULL, *type = NULL;
+        *dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
     int i, is_scsi;
     unsigned int len, num, hd_index;
 
@@ -123,6 +123,14 @@ void xenstore_parse_domain_config(int do
         dev = xs_read(xsh, XBT_NULL, buf, &len);
         if (dev == NULL)
             continue;
+        /* Change xvdN to look like hdN */
+        if (!strncmp(dev, "xvd", 3 )) {
+            fprintf(logfile, "Change xvd%c to look like hd%c\n",
+                    dev[3], dev[3]);
+            memmove(dev, dev+1, strlen(dev));
+            dev[0] = 'h';
+            dev[1] = 'd';
+        }
         is_scsi = !strncmp(dev, "sd", 2);
         if ((strncmp(dev, "hd", 2) && !is_scsi) || strlen(dev) != 3 )
             continue;
@@ -140,6 +148,22 @@ void xenstore_parse_domain_config(int do
         params = xs_read(xsh, XBT_NULL, buf, &len);
         if (params == NULL)
             continue;
+        /* read the name of the device */
+        if (pasprintf(&buf, "%s/type", bpath) == -1)
+            continue;
+        free(drv);
+        drv = xs_read(xsh, XBT_NULL, buf, &len);
+        if (drv == NULL)
+            continue;
+        /* Strip off blktap sub-type prefix aio: - QEMU can autodetect this */
+        if (!strcmp(drv, "tap") && params[0]) {
+            char *offset = strchr(params, ':'); 
+            if (!offset)
+                continue ;
+            memmove(params, offset+1, strlen(offset+1)+1 );
+            fprintf(logfile, "Strip off blktap sub-type prefix to %s\n", params); 
+        }
+
         /* 
          * check if device has a phantom vbd; the phantom is hooked
          * to the frontend device (for ease of cleanup), so lookup 
@@ -202,6 +226,7 @@ void xenstore_parse_domain_config(int do
     free(buf);
     free(path);
     free(e);
+    free(drv);
     return;
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

RE: [PATCH] [IOEMU] Allow blktap to be able to be booted assystemvolume for PV-on-HVM(TAKE 3)

Hi Kasai,

It seems there is a bug caused by this patch.
If providing both hda and xvda, there would be two hda devices given to Qemu. And the image of xvda would be recover the real hda. If xvda doesn't include booting system, HVM booting failed. So how about have a little modify? If there is a hdx device, don't translate xvdx to related hdx.

Best Regards,
Yongkang You

Quoted 113 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kasai Takanori
Sent: Monday, October 15, 2007 6:43 PM
To: xen-devel
Subject: [Xen-devel] [PATCH] [IOEMU] Allow blktap to be able to be booted assystemvolume for PV-on-HVM(TAKE 3)

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.

Best Regards,

--
Takanori Kasai

----- Original Message -----
From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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)

Quoted 26 lines

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.

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

Quoted 12 lines

----- Original Message -----
From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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

Quoted 4 lines

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

Quoted 6 lines
Quoted 6 lines

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.

Quoted 2 lines
Quoted 2 lines

qemu: could not open hard disk image

'aio:/xen/test/rhel5ga_full.img'

Quoted 10 lines
Quoted 10 lines

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.

Quoted 8 lines
Quoted 8 lines

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

Quoted 4 lines
Quoted 4 lines

... <<= /* 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

Quoted 3 lines
Quoted 2 lines

Best Regards,

#2 lore raw

Re: [Xen-devel] [PATCH] [IOEMU] Allow blktap to be able to be booted as system volume for PV-on-HVM(TAKE 3)

Hi Yongkang,

Thank you for reply.

There is a problem when hdN and xvdN are specified at the same time. Because the patch has already been applied, the hot fix is sent by the addition.

It corrects as follows.
- Whether hdN is defined first is checked.
- If hdN is defined, xvdN is not replaced with hdN.

I will make the hot fix of the addition and contribute to the community.

Best Regards,

--
Takanori Kasai

----- Original Message ----- From: "You, Yongkang" <[email protected]>
To: "Kasai Takanori" <[email protected]>; "xen-devel" <[email protected]>
Sent: Tuesday, October 16, 2007 12:05 PM
Subject: RE: [Xen-devel] [PATCH] [IOEMU] Allow blktap to be able to be booted assystemvolume for PV-on-HVM(TAKE 3)

Quoted 123 lines

Hi Kasai,

It seems there is a bug caused by this patch.
If providing both hda and xvda, there would be two hda devices given to Qemu. And the image of xvda would be recover the real hda. If xvda doesn't include booting system, HVM booting failed. So how about have a little modify? If there is a hdx device, don't translate xvdx to related hdx.

Best Regards,
Yongkang You

Quoted 113 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kasai Takanori
Sent: Monday, October 15, 2007 6:43 PM
To: xen-devel
Subject: [Xen-devel] [PATCH] [IOEMU] Allow blktap to be able to be booted assystemvolume for PV-on-HVM(TAKE 3)

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.

Best Regards,

--
Takanori Kasai

----- Original Message -----
From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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)

Quoted 26 lines

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.

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

Quoted 12 lines

----- Original Message -----
From: "Kasai Takanori" <[email protected]>
To: "xen-devel" <[email protected]>
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

Quoted 4 lines

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

Quoted 6 lines
Quoted 6 lines

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.

Quoted 2 lines
Quoted 2 lines

qemu: could not open hard disk image

'aio:/xen/test/rhel5ga_full.img'

Quoted 10 lines
Quoted 10 lines

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.

Quoted 8 lines
Quoted 8 lines

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

Quoted 4 lines
Quoted 4 lines

... <<= /* 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

Quoted 3 lines
Quoted 2 lines

Best Regards,