]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xl: fix tap:aio disk parsing
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 Feb 2011 18:41:34 +0000 (18:41 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 Feb 2011 18:41:34 +0000 (18:41 +0000)
Fix "tap:aio" parsing in xl after 22921

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c

index 0fad4711ce4421a78bac567cd680d0ea8185aff9..fe136eeab6b2205e211b8b898a04802430d7978d 100644 (file)
@@ -451,8 +451,6 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2)
     char *p, *end, *tok;
 
     memset(disk, 0, sizeof(*disk));
-    disk->format = DISK_FORMAT_RAW;
-    disk->backend = DISK_BACKEND_TAP;
 
     for(tok = p = buf2, end = buf2 + strlen(buf2) + 1; p < end; p++) {
         switch(state){
@@ -484,7 +482,11 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2)
             }
             break;
         case DSTATE_TAP:
-            if ( *p == ':' ) {
+            if (*p == ',') {
+                disk->format = DISK_FORMAT_RAW;
+                disk->backend = DISK_BACKEND_TAP;
+                state = DSTATE_PHYSPATH;
+            } else if ( *p == ':' ) {
                 *p = '\0';
                 if (!strcmp(tok, "aio")) {
                     tok = p + 1;
@@ -510,8 +512,10 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2)
 
                 tok = p + 1;
                 state = DSTATE_PHYSPATH;
+                break;
+            } else {
+                break;
             }
-            break;
         case DSTATE_PHYSPATH:
             if ( *p == ',' ) {
                 int ioemu_len;