2010-03-02 01:46:54 +01:00
|
|
|
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
|
|
|
|
===================================================================
|
|
|
|
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
|
|
|
|
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
|
|
|
|
@@ -398,7 +398,7 @@ void xenstore_parse_domain_config(int hv
|
2009-05-04 18:38:09 +02:00
|
|
|
char *buf = NULL;
|
2008-04-12 21:41:18 +02:00
|
|
|
char *fpath = NULL, *bpath = NULL, *btype = NULL,
|
2009-05-04 18:38:09 +02:00
|
|
|
*dev = NULL, *params = NULL, *drv = NULL;
|
2010-01-16 01:12:54 +01:00
|
|
|
- int i, ret, is_tap;
|
|
|
|
+ int i, j, ret, is_tap;
|
2008-07-19 01:04:37 +02:00
|
|
|
unsigned int len, num, hd_index, pci_devid = 0;
|
2008-04-12 21:41:18 +02:00
|
|
|
BlockDriverState *bs;
|
2008-07-19 01:04:37 +02:00
|
|
|
BlockDriver *format;
|
2010-03-02 01:46:54 +01:00
|
|
|
@@ -485,12 +485,7 @@ void xenstore_parse_domain_config(int hv
|
2008-04-12 21:41:18 +02:00
|
|
|
continue;
|
2009-05-04 18:38:09 +02:00
|
|
|
free(danger_type);
|
|
|
|
danger_type = xs_read(xsh, XBT_NULL, danger_buf, &len);
|
2008-04-12 21:41:18 +02:00
|
|
|
- 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;
|
2010-03-02 01:46:54 +01:00
|
|
|
@@ -498,6 +493,35 @@ void xenstore_parse_domain_config(int hv
|
2008-04-12 21:41:18 +02:00
|
|
|
drv = xs_read(xsh, XBT_NULL, buf, &len);
|
|
|
|
if (drv == NULL)
|
|
|
|
continue;
|
|
|
|
+
|
|
|
|
+ free(params);
|
2010-01-16 01:12:54 +01:00
|
|
|
+ if (!strcmp(drv,"iscsi") || !strcmp(drv, "npiv") ||
|
|
|
|
+ !strcmp(drv,"dmmd")) {
|
2008-04-12 21:41:18 +02:00
|
|
|
+ if (pasprintf(&buf, "%s/node", bpath) == -1)
|
|
|
|
+ continue;
|
|
|
|
+
|
2010-01-16 01:12:54 +01:00
|
|
|
+ /* wait for block-[iscsi|npiv|dmmd] script to complete and populate the
|
2008-04-12 21:41:18 +02:00
|
|
|
+ * 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) {
|
2009-09-27 00:20:08 +02:00
|
|
|
+ fprintf(stderr, "qemu: %s device not found -- timed out \n", drv);
|
2008-04-12 21:41:18 +02:00
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
2009-05-04 18:38:09 +02:00
|
|
|
+ {
|
2008-04-12 21:41:18 +02:00
|
|
|
+ if (pasprintf(&buf, "%s/params", bpath) == -1)
|
|
|
|
+ continue;
|
|
|
|
+ params = xs_read(xsh, XBT_NULL, buf, &len);
|
|
|
|
+ if (params == NULL)
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
2008-07-19 01:04:37 +02:00
|
|
|
/* Obtain blktap sub-type prefix */
|
2008-04-12 21:41:18 +02:00
|
|
|
if (!strcmp(drv, "tap") && params[0]) {
|
|
|
|
char *offset = strchr(params, ':');
|