--- xen-3.1.0-src.new/tools/ioemu/xenstore.c 2007-05-18 10:45:21.000000000 -0400 +++ xen-3.1.0-src/tools/ioemu/xenstore.c 2007-06-22 13:48:55.000000000 -0400 @@ -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; - int i, is_scsi; + int i, is_scsi, is_tap = 0; unsigned int len, num, hd_index; for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) @@ -123,6 +123,14 @@ void xenstore_parse_domain_config(int do dev = xs_read(xsh, XBT_NULL, buf, &len); if (dev == NULL) continue; + /* Force xvdN to look like hdN */ + if (!strncmp(dev, "xvd", 3)) { + memmove(dev, dev+1, strlen(dev)); + dev[0] = 'h'; + dev[1] = 'd'; + is_tap = 1; + fprintf(stderr, "Got blktap '%s'\n", dev); + } is_scsi = !strncmp(dev, "sd", 2); if ((strncmp(dev, "hd", 2) && !is_scsi) || strlen(dev) != 3 ) continue; @@ -140,6 +148,14 @@ void xenstore_parse_domain_config(int do params = xs_read(xsh, XBT_NULL, buf, &len); if (params == NULL) continue; + /* Strip off blktap sub-type prefix aio: etc */ + if (is_tap) { + char *offset = strchr(params, ':'); + if (!offset) + continue; + memmove(params, offset+1, strlen(offset+1)+1); + fprintf(stderr, "Got params '%s'\n", params); + } /* * check if device has a phantom vbd; the phantom is hooked * to the frontend device (for ease of cleanup), so lookup