WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] ioemu: Allow blktap to be able to be boot

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: Allow blktap to be able to be booted as system volume for PV-on-HVM
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Oct 2007 11:40:11 -0700
Delivery-date: Mon, 15 Oct 2007 11:40:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192447475 -3600
# Node ID 2372f89c0447e055506489688f53c9c69b6080d9
# Parent  c19c51317eebe8e852dd4ad90ca19880397fa3b4
ioemu: Allow blktap to be able to be booted as system volume for PV-on-HVM

 - All xvdN disk is looked like hdN.
 - All tap disks are checked.(tap:aio, tap:sync, tap:vmdk, etc.)

Signed-off-by: Takanori Kasai <kasai.takanori@xxxxxxxxxxxxxx>
---
 tools/ioemu/xenstore.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletion(-)

diff -r c19c51317eeb -r 2372f89c0447 tools/ioemu/xenstore.c
--- a/tools/ioemu/xenstore.c    Mon Oct 15 12:20:43 2007 +0100
+++ b/tools/ioemu/xenstore.c    Mon Oct 15 12:24:35 2007 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: Allow blktap to be able to be booted as system volume for PV-on-HVM, Xen patchbot-unstable <=