]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
add optional cdrom-pt option to xenvm
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 11 Jan 2010 12:03:12 +0000 (12:03 +0000)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 11 Jan 2010 12:03:12 +0000 (12:03 +0000)
if cdrom-pt is specified, it will pass the argument to qemu as -cdrom-pt
"path", otherwise no extra argument are added. the qemu-dm-wrapper need to be
tweaked (remove the cdrom-pt option) when the upper layer know about the
option.

xenvm/vmact.ml
xenvm/vmconfig.ml

index 6b193a7b95348a9192bfd65c8049995885ee394c..9e27d1321545ece458be1aa86b94785eecbc2a23 100644 (file)
@@ -209,6 +209,14 @@ let get_pcis cfg =
 let dm_info_of_cfg cfg =
        let nics = get_nics cfg in
        let nics = List.map (fun nic -> nic.nic_mac, nic.nic_bridge, if nic.nic_model="" then None else Some nic.nic_model) nics in
+
+       let extrahvm =
+               (match cfg.cdrom_pt with
+                       | None      -> []
+                       | Some path -> [ ("-cdrom-pt", Some path) ]
+               ) @ cfg.extrahvm
+               in
+
        let disp =
                match cfg.display with
                | DisplayNone    -> Device.Dm.NONE
@@ -232,7 +240,7 @@ let dm_info_of_cfg cfg =
                Device.Dm.oem_features = cfg.oem_features;
                Device.Dm.inject_sci = cfg.inject_sci;
                Device.Dm.videoram = (match cfg.videoram with None -> 8 | Some i -> i);
-               Device.Dm.extras = cfg.extrahvm;
+               Device.Dm.extras = extrahvm;
        }
 
 let rm_snapshots disks =
index 62e0b2606578f335bc311fbe9ed742cfcb486bbe..12652a1030ae8551dace19f3f6dd39c0285cf8b1 100644 (file)
@@ -158,6 +158,7 @@ type config = {
        sound: string option;
        inject_sci: int;
        qemu_pv: bool;
+       cdrom_pt: string option;
        cpus_affinity: (int * (int list)) list;
 }
 
@@ -497,6 +498,7 @@ let get cfg field =
        | "sound"      -> string_of_string_option cfg.sound
        | "notify"     -> string_of_notify cfg.notify
        | "qemu-pv"    -> string_of_bool cfg.qemu_pv
+       | "cdrom-pt"   -> string_of_string_option cfg.cdrom_pt
        | _            -> raise (Unknown_field field)
 
 let set cfg field value =
@@ -534,6 +536,7 @@ let set cfg field value =
        | "sound"            -> { cfg with sound = string_option_of_string value }
        | "notify"           -> { cfg with notify = config_notify_of_string value }
        | "qemu-pv"          -> { cfg with qemu_pv = bool_of_string value }
+       | "cdrom-pt"         -> { cfg with cdrom_pt = string_option_of_string value }
        | _           -> raise (Unknown_field field)
 
 let list_add cfg field value =
@@ -621,6 +624,7 @@ let empty =
                inject_sci = 0;
                sound = None;
                qemu_pv = true;
+               cdrom_pt = None;
 
                (* list_{get/del/add} *)
                disks = [];