2011-05-31 19:35:29 +02:00
|
|
|
Index: xen-4.1.1-testing/tools/ioemu-qemu-xen/xenstore.c
|
2010-09-28 00:07:21 +02:00
|
|
|
===================================================================
|
2011-05-31 19:35:29 +02:00
|
|
|
--- xen-4.1.1-testing.orig/tools/ioemu-qemu-xen/xenstore.c
|
|
|
|
+++ xen-4.1.1-testing/tools/ioemu-qemu-xen/xenstore.c
|
2011-03-21 17:47:37 +01:00
|
|
|
@@ -449,7 +449,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;
|
2011-03-21 17:47:37 +01:00
|
|
|
@@ -533,12 +533,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;
|
2011-03-21 17:47:37 +01:00
|
|
|
@@ -546,6 +541,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 */
|
2011-03-21 17:47:37 +01:00
|
|
|
if ((!strcmp(drv, "tap") || !strcmp(drv, "qdisk")) && params[0]) {
|
2008-04-12 21:41:18 +02:00
|
|
|
char *offset = strchr(params, ':');
|
2011-05-10 18:44:09 +02:00
|
|
|
@@ -657,6 +681,12 @@ void xenstore_parse_domain_config(int hv
|
|
|
|
format = &bdrv_host_device;
|
|
|
|
else
|
|
|
|
format = &bdrv_raw;
|
|
|
|
+ } else if (!strcmp(drv,"iscsi")) {
|
|
|
|
+ format = &bdrv_raw;
|
|
|
|
+ } else if (!strcmp(drv,"npiv")) {
|
|
|
|
+ format = &bdrv_raw;
|
|
|
|
+ } else if (!strcmp(drv,"dmmd")) {
|
|
|
|
+ format = &bdrv_raw;
|
|
|
|
} else {
|
|
|
|
format = bdrv_find_format(drv);
|
|
|
|
if (!format) {
|