[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxlu: correctly parse disk "backendtype" field



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1317914343 -3600
# Node ID 3be536f7001f1521ad11d54a84338db45bad8d8f
# Parent  af624488efe23e2f7b880b5333909113652989b4
libxlu: correctly parse disk "backendtype" field

Currently it tries to parse the value from the full "backendtype=FOO" string
but really it needs to parse from the equals.

Before:
# xl -N block-attach d32-1 
backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
command line: config parsing error in disk specification: unknown value for 
backendtype: near `backendtype=phy' in 
`backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b'

After [in new syntax, not yet in this tree -iwj]:
# xl -N block-attach d32-1 
backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
disk: {
    "backend_domid": 0,
    "pdev_path": "/dev/VG/debian-x86_32-1b",
    "vdev": "xvdb",
    "backend": "phy",
    "format": "raw",
    "script": null,
    "removable": 0,
    "readwrite": 1,
    "is_cdrom": 0
}

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r af624488efe2 -r 3be536f7001f tools/libxl/libxlu_disk_l.c
--- a/tools/libxl/libxlu_disk_l.c       Thu Oct 06 16:15:33 2011 +0100
+++ b/tools/libxl/libxlu_disk_l.c       Thu Oct 06 16:19:03 2011 +0100
@@ -1261,7 +1261,7 @@
 /* rule 8 can match eol */
 YY_RULE_SETUP
 #line 142 "libxlu_disk_l.l"
-{ STRIP(','); setbackendtype(DPC,yytext); }
+{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
        YY_BREAK
 case 9:
 /* rule 9 can match eol */
diff -r af624488efe2 -r 3be536f7001f tools/libxl/libxlu_disk_l.l
--- a/tools/libxl/libxlu_disk_l.l       Thu Oct 06 16:15:33 2011 +0100
+++ b/tools/libxl/libxlu_disk_l.l       Thu Oct 06 16:19:03 2011 +0100
@@ -139,7 +139,7 @@
 devtype=[^,]*,?        { xlu__disk_err(DPC,yytext,"unknown value for type"); }
 
 access=[^,]*,? { STRIP(','); setaccess(DPC, FROMEQUALS); }
-backendtype=[^,]*? { STRIP(','); setbackendtype(DPC,yytext); }
+backendtype=[^,]*? { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 
 vdev=[^,]*,?   { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
 script=[^,]*,? { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.