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 xvd* to co-exist with hd*.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: Allow xvd* to co-exist with hd*.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Oct 2007 09:40:09 -0700
Delivery-date: Wed, 17 Oct 2007 09:40:45 -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 1192524008 -3600
# Node ID 05337cb5206fd3a553d9c3a0c752996bc40e189c
# Parent  d915111f8246bacfda168effafade68e1262e7cb
ioemu: Allow xvd* to co-exist with hd*.
 - Whether hdN is defined first is checked.
 - If hdN is defined, xvdN is not replaced with hdN.

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

diff -r d915111f8246 -r 05337cb5206f tools/ioemu/xenstore.c
--- a/tools/ioemu/xenstore.c    Tue Oct 16 09:30:20 2007 +0100
+++ b/tools/ioemu/xenstore.c    Tue Oct 16 09:40:08 2007 +0100
@@ -83,7 +83,7 @@ void xenstore_parse_domain_config(int do
     char *buf = NULL, *path;
     char *fpath = NULL, *bpath = NULL,
         *dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
-    int i, is_scsi;
+    int i, is_scsi, is_hdN = 0;
     unsigned int len, num, hd_index;
 
     for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
@@ -123,8 +123,29 @@ void xenstore_parse_domain_config(int do
         dev = xs_read(xsh, XBT_NULL, buf, &len);
         if (dev == NULL)
             continue;
+        if (!strncmp(dev, "hd", 2)) {
+            is_hdN = 1;
+            break;
+        }
+    }
+        
+    for (i = 0; i < num; i++) {
+        /* read the backend path */
+        if (pasprintf(&buf, "%s/device/vbd/%s/backend", path, e[i]) == -1)
+            continue;
+        free(bpath);
+        bpath = xs_read(xsh, XBT_NULL, buf, &len);
+        if (bpath == NULL)
+            continue;
+        /* read the name of the device */
+        if (pasprintf(&buf, "%s/dev", bpath) == -1)
+            continue;
+        free(dev);
+        dev = xs_read(xsh, XBT_NULL, buf, &len);
+        if (dev == NULL)
+            continue;
         /* Change xvdN to look like hdN */
-        if (!strncmp(dev, "xvd", 3 )) {
+        if (!is_hdN && !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));

_______________________________________________
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 xvd* to co-exist with hd*., Xen patchbot-unstable <=