From 2ead8ce99bf4595cb845671976f5dcfa68f12df8 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Mon, 10 Aug 2009 18:18:12 +0100 Subject: [PATCH] add a config option to not start qemu in the pv case. solve the problem on relying on vnc to start qemu or not. --- xenvm/vmact.ml | 8 +++++--- xenvm/vmconfig.ml | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xenvm/vmact.ml b/xenvm/vmact.ml index 786c514..c3e9461 100644 --- a/xenvm/vmact.ml +++ b/xenvm/vmact.ml @@ -271,11 +271,13 @@ let add_devices xc xs domid state restore = Device.PCI.add ~xc ~xs ~hvm:cfg.hvm ~msitranslate ~pci_power_mgmt devs domid devid ) pcis; - if (not cfg.hvm) && cfg.vnc <> (-1) then ( - Device.Vfb.add ~xc ~xs ~hvm:cfg.hvm domid + if (not cfg.hvm) then ( + let protocol = devproto_of_state state in + Device.Vfb.add ~xc ~xs ~hvm:cfg.hvm ~protocol domid; + Device.Vkb.add ~xc ~xs ~hvm:cfg.hvm ~protocol domid ); - if cfg.hvm || cfg.vnc <> (-1) then ( + if cfg.hvm || cfg.qemu_pv then ( (* add device model *) let dmpath = "/opt/xensource/libexec/qemu-dm-wrapper" in let dmstart = if restore then Device.Dm.restore else Device.Dm.start in diff --git a/xenvm/vmconfig.ml b/xenvm/vmconfig.ml index 3a2ef95..c6969f9 100644 --- a/xenvm/vmconfig.ml +++ b/xenvm/vmconfig.ml @@ -132,6 +132,7 @@ type config = { global_pci_power_mgmt: int; sound: string option; inject_sci: int; + qemu_pv: bool; } let default_nic = @@ -340,6 +341,7 @@ let get cfg field = | "inject-sci" -> string_of_int cfg.inject_sci | "sound" -> string_of_string_option cfg.sound | "notify" -> string_of_notify cfg.notify + | "qemu-pv" -> string_of_bool cfg.qemu_pv | _ -> raise (Unknown_field field) let set cfg field value = @@ -375,6 +377,7 @@ let set cfg field value = | "inject-sci" -> { cfg with inject_sci = int_of_string 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 } | _ -> raise (Unknown_field field) let list_add cfg field value = @@ -450,6 +453,7 @@ let empty = global_pci_power_mgmt = 0; inject_sci = 0; sound = None; + qemu_pv = true; (* list_{get/del/add} *) disks = []; -- 2.39.5