XM/XenAPI: Add CDROM Support to XM on Xen API
PATCH 1/1 XM/XenAPI: Add CDROM Support to XM on Xen API
Currently all the VBD devices are recognized as hard disks when creating domains by xm command through xen api. Attached patch correctly sets vbd_type param to 'CD' if the device is supposed to be seen as a cdrom from the guest.
Regards,
-----------------------
Yosuke Iwamatsu
NEC Corporation
XM/XenAPI: Add cdrom support when creating domains by xm through Xen API.
Signed-off-by Yosuke Iwamatsu <[email protected]>
tools/python/xen/xm/xenapi_create.py +5 -2
@@ -31,6 +31,7 @@ import sys import sys import os import traceback +import re def log(_, msg): #print "> " + msg
@@ -707,9 +708,11 @@ class sxp2xml: = get_child_by_name(vbd_sxp, "mode") != "w" \ and "RO" or "RW" vbd.attributes["device"] \ - = get_child_by_name(vbd_sxp, "dev") + = re.sub(":cdrom$", "", get_child_by_name(vbd_sxp, "dev")) vbd.attributes["bootable"] = "1" - vbd.attributes["type"] = "disk" + vbd.attributes["type"] \ + = re.search(":cdrom$", get_child_by_name(vbd_sxp, "dev")) \ + and "CD" or "disk" vbd.attributes["qos_algorithm_type"] = "" return vbd
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel