aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlu_disk_l.l
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.l
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.l')
-rw-r--r--tools/libxl/libxlu_disk_l.l6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
index 7e0a63532b..f4e6b1abf3 100644
--- a/tools/libxl/libxlu_disk_l.l
+++ b/tools/libxl/libxlu_disk_l.l
@@ -217,7 +217,11 @@ phy:/.* { DPC->had_depr_prefix=1; DEPRECATE(0); }
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);