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-devel

RE: [Xen-devel] drbd: and hvm

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] drbd: and hvm
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Apr 2010 17:33:17 +1000
Delivery-date: Tue, 06 Apr 2010 00:34:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D019193E3@trantor>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AEC6C66638C05B468B556EA548C1A77D019193E3@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrVWIclHmENPf9KRoWulIhW3msIogAAnS0g
Thread-topic: [Xen-devel] drbd: and hvm
> 
> What is it that prevents drbd: devices from not working under HVM?
Could
> the fix just be as simple as mapping 'drbd:name-of-resource' to
> '/dev/drbd/by-res/<name-of-resource>'?
> 

The following patch maps it correctly, but it only works if the device
is already 'primary', which kind of defeats the purpose... qemu-dm must
be trying to open the device before the drbd script switches the local
node to 'primary'. Might it still be a useful addition to qemu-dm
though? (eg it would work in a multiple-primary setup).

James

diff --git a/xenstore.c b/xenstore.c
index 05a1c22..b53f474 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -513,6 +513,14 @@ void xenstore_parse_domain_config(int hvm_domid)
             params = newparams;
            format = &bdrv_raw;
         }
+        /* handle drbd mapping */
+        if (!strcmp(drv, "drbd")) {
+            char *newparams = malloc(17 + strlen(params) + 1);
+            sprintf(newparams, "/dev/drbd/by-res/%s", params);
+            free(params);
+            params = newparams;
+           format = &bdrv_raw;
+        }

 #if 0
        /* Phantom VBDs are disabled because the use of paths

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>