aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/check-xl-disk-parse
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-07-26 10:35:35 +0100
committerIan Campbell <ian.campbell@citrix.com>2012-07-26 10:35:35 +0100
commit79702808336453e6ec75777ea94f01027d439ebd (patch)
treeb6d7941b4a0cfaaf9cf546055d415eed96c9471c /tools/libxl/check-xl-disk-parse
parent214825a938dc04280f42efec9c2341e547c47890 (diff)
downloadxen-79702808336453e6ec75777ea94f01027d439ebd.tar.gz
xen-79702808336453e6ec75777ea94f01027d439ebd.tar.bz2
xen-79702808336453e6ec75777ea94f01027d439ebd.zip
xl: support empty CDROM devices
The important change here is to xlu_disk_parse to correctly set format == EMPTY for CDROM devices which are empty. Test cases are added which check for correctness here. xend accepts ',hdc:cdrom,r'[0] as an empty CDROM drive however this is not consistent with the xl syntax in docs/misc/xl-disk-configuration.txt which requires ',,hdc:cdrom,r' (the additional positional paramter is the format). I'm not sure if/how this can be fixed. Note that xend does not accept ',,hdc:cdrom,r' There are several incidental cleanups included the the cdrom-{insert,eject} commands: - add a dry-run mode - use the non-deprecated disk specification syntax - check for and report errors from libxl_cdrom_insert [0] http://wiki.xen.org/wiki/CD_Rom_Support_in_Xen Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.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/check-xl-disk-parse')
-rwxr-xr-xtools/libxl/check-xl-disk-parse35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/libxl/check-xl-disk-parse b/tools/libxl/check-xl-disk-parse
index 67805e56ed..7a337802d5 100755
--- a/tools/libxl/check-xl-disk-parse
+++ b/tools/libxl/check-xl-disk-parse
@@ -107,4 +107,39 @@ disk: {
EOF
one 0 backendtype=phy,vdev=xvdb,access=w,target=/dev/vg/guest-volume
+expected <<EOF
+disk: {
+ "backend_domid": 0,
+ "pdev_path": "",
+ "vdev": "hdc",
+ "backend": "unknown",
+ "format": "empty",
+ "script": null,
+ "removable": 1,
+ "readwrite": 0,
+ "is_cdrom": 1
+}
+
+EOF
+one 0 devtype=cdrom,,,hdc
+one 0 ,,hdc:cdrom,r
+one 0 vdev=hdc,access=r,devtype=cdrom,target=
+one 0 ,empty,hdc:cdrom,r
+
+expected <<EOF
+disk: {
+ "backend_domid": 0,
+ "pdev_path": null,
+ "vdev": "hdc",
+ "backend": "unknown",
+ "format": "empty",
+ "script": null,
+ "removable": 1,
+ "readwrite": 0,
+ "is_cdrom": 1
+}
+
+EOF
+one 0 vdev=hdc,access=r,devtype=cdrom,format=empty
+
complete