All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: James Harper <james.harper@bendigoit.com.au>,
	xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] make qemu handle drbd properly
Date: Fri, 28 Jan 2011 08:39:46 -0700	[thread overview]
Message-ID: <4D42E342.10504@novell.com> (raw)
In-Reply-To: <19777.52207.697582.311875@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

Ian Jackson wrote:
> James Harper writes ("[Xen-devel] [PATCH] make qemu handle drbd properly"):
>   
>> This attached patch allows qemu to accept a drbd: prefix and interpret
>> it as a drbd resource. It then searches for it in /dev/drbd/by-res/
>> (which must be mapped via udev). It's against 4.0-testing.
>>     
>
> Jim, did any of your drbd tests involve HVM domains ?
>   

No, they did not :(.

But we have a similar hack (err, patch - attached for reference) for
other external block scripts that we support. Interestingly, drbd is
missing from the patch. I stumbled across this patch several months ago,
but the original author is gone and I have not had time to consider a
solution that will accommodate arbitrary external block scripts.

Jim



[-- Attachment #2: xen-qemu-iscsi-fix.patch --]
[-- Type: text/x-diff, Size: 2313 bytes --]

Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/xenstore.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
@@ -399,7 +399,7 @@ void xenstore_parse_domain_config(int hv
     char *buf = NULL;
     char *fpath = NULL, *bpath = NULL, *btype = NULL,
         *dev = NULL, *params = NULL, *drv = NULL;
-    int i, ret, is_tap;
+    int i, j, ret, is_tap;
     unsigned int len, num, hd_index, pci_devid = 0;
     BlockDriverState *bs;
     BlockDriver *format;
@@ -491,12 +491,7 @@ void xenstore_parse_domain_config(int hv
             continue;
         free(danger_type);
         danger_type = xs_read(xsh, XBT_NULL, danger_buf, &len);
-        if (pasprintf(&buf, "%s/params", bpath) == -1)
-            continue;
-        free(params);
-        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;
@@ -504,6 +499,35 @@ void xenstore_parse_domain_config(int hv
         drv = xs_read(xsh, XBT_NULL, buf, &len);
         if (drv == NULL)
             continue;
+
+        free(params);
+        if (!strcmp(drv,"iscsi") || !strcmp(drv, "npiv") ||
+            !strcmp(drv,"dmmd")) {
+          if (pasprintf(&buf, "%s/node", bpath) == -1)
+             continue;
+
+          /* wait for block-[iscsi|npiv|dmmd] script to complete and populate the
+           * node entry.  try 30 times (30 secs) */
+          for (j = 0; j < 30; j++) {
+            params = xs_read(xsh, XBT_NULL, buf, &len);
+            if (params != NULL)
+               break;
+	    sleep(1);
+          }
+          if (params == NULL) {
+             fprintf(stderr, "qemu: %s device not found -- timed out \n", drv);
+            continue;
+          }
+        }
+        else
+        {
+          if (pasprintf(&buf, "%s/params", bpath) == -1)
+              continue;
+           params = xs_read(xsh, XBT_NULL, buf, &len);
+           if (params == NULL)
+             continue;
+        }
+
         /* Obtain blktap sub-type prefix */
         if (!strcmp(drv, "tap") && params[0]) {
             char *offset = strchr(params, ':'); 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2011-01-28 15:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Acu93M69hrwjXAfcQG+0NjGopOq6NQ==>
2011-01-27  4:43 ` [PATCH] make qemu handle drbd properly James Harper
2011-01-27 19:47   ` Ian Jackson
2011-01-28 15:39     ` Jim Fehlig [this message]
2011-01-28 17:33       ` Ian Jackson
2011-06-25 16:47   ` Shriram Rajagopalan
2011-06-28 12:54     ` Ian Jackson
2011-08-30  4:11       ` Shriram Rajagopalan
2011-08-30  4:40         ` James Harper
2011-08-30 10:36           ` Stefano Stabellini
2011-08-30 12:46             ` James Harper
2011-08-30 14:37               ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D42E342.10504@novell.com \
    --to=jfehlig@novell.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=james.harper@bendigoit.com.au \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.