aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlu_disk_l.c
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-07-26 10:35:36 +0100
committerIan Jackson <ian.jackson@eu.citrix.com>2012-07-26 10:35:36 +0100
commita413f5a5f4463bc805c297bc2d328f1da17f3b1b (patch)
tree08eb3b82767b221c3568794c4a9c9894e37199d8 /tools/libxl/libxlu_disk_l.c
parentc902f397d67d3fa959d46a0373230da3f8c8af92 (diff)
downloadxen-a413f5a5f4463bc805c297bc2d328f1da17f3b1b.tar.gz
xen-a413f5a5f4463bc805c297bc2d328f1da17f3b1b.tar.bz2
xen-a413f5a5f4463bc805c297bc2d328f1da17f3b1b.zip
xl: support xend empty cdrom device syntax
xend accepts `,hdc:cdrom,r' as an empty CDROM drive. However this is not consistent with the existing xl syntax in docs/misc/xl-disk-configuration.txt which requires `,,hdc:cdrom,r' (the additional positional paramter is the format). We fix this by spotting the case specially: when the target is empty and the format contains a colon, reinterpret the format as <vdev>:<devtype>. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxlu_disk_l.c')
-rw-r--r--tools/libxl/libxlu_disk_l.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index b4ad65108a..f6903853ee 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -1404,7 +1404,11 @@ YY_RULE_SETUP
SAVESTRING("target", pdev_path, yytext);
} else if (!DPC->had_depr_prefix &&
DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) {
- setformat(DPC,yytext);
+ if (!*DPC->disk->pdev_path && vdev_and_devtype(DPC,yytext)) {
+ DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY;
+ } else {
+ setformat(DPC,yytext);
+ }
} else if (!DPC->disk->vdev) {
if (!vdev_and_devtype(DPC,yytext))
SAVESTRING("vdev", vdev, yytext);
@@ -1419,7 +1423,7 @@ YY_RULE_SETUP
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 233 "libxlu_disk_l.l"
+#line 237 "libxlu_disk_l.l"
{
BEGIN(LEXERR);
yymore();
@@ -1427,17 +1431,17 @@ YY_RULE_SETUP
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 237 "libxlu_disk_l.l"
+#line 241 "libxlu_disk_l.l"
{
xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
}
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 240 "libxlu_disk_l.l"
+#line 244 "libxlu_disk_l.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1441 "libxlu_disk_l.c"
+#line 1445 "libxlu_disk_l.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(LEXERR):
yyterminate();
@@ -2529,4 +2533,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 240 "libxlu_disk_l.l"
+#line 244 "libxlu_disk_l.l"