mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
XM/XenAPI: Add cdrom support when creating domains by xm through Xen API.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
This commit is contained in:
1 parent
61341026d9
commit
be2dc0b642
1 file changed
+5
-2
@@ -31,6 +31,7 @@ import xen.util.xsm.xsm as security
|
||||
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
|
||||
|
||||