[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] XM/XenAPI: Add cdrom support when creating domains by xm through Xen API.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1210668535 -3600
# Node ID 9da75b15001555824e9951d8f5b0c6a73302a1ae
# Parent  90022855084754ad7800478a71ce0d7310b2f0fb
XM/XenAPI: Add cdrom support when creating domains by xm through Xen API.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/xenapi_create.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r 900228550847 -r 9da75b150015 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Tue May 13 09:48:40 2008 +0100
+++ b/tools/python/xen/xm/xenapi_create.py      Tue May 13 09:48:55 2008 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.