From: Vincent Hanquez Date: Tue, 7 Jul 2009 21:59:44 +0000 (+0100) Subject: Merge commit 'prashanthm/master' X-Git-Url: http://xenbits.xen.org/gitweb?a=commitdiff_plain;h=fc912aefbac997a96084cb86ee7d3347cc119791;p=xenclient%2Ftoolstack.git Merge commit 'prashanthm/master' Conflicts: xenvm/vmact.ml xenvm/vmconfig.ml --- fc912aefbac997a96084cb86ee7d3347cc119791 diff --cc xenvm/vmact.ml index 7ee8fac,24b6c23..c3956d6 --- a/xenvm/vmact.ml +++ b/xenvm/vmact.ml @@@ -152,22 -152,14 +152,29 @@@ let add_devices xc xs domid state resto (* add pcis *) List.iter (fun (devid, devs) -> let bind = ref false in + let dev_msitranslate = ref None in ++ let dev_power_mgmt = ref None in let devs = List.map (fun dev -> bind := !bind || dev.pci_bind; + maybe (fun x -> dev_msitranslate := Some x) dev.pci_msitranslate; ++ maybe (fun x -> dev_power_mgmt := Some x) dev.pci_power_mgmt; (dev.pci_domain, dev.pci_bus, dev.pci_slot, dev.pci_func) ) devs in if !bind then Device.PCI.bind devs; - Device.PCI.add ~xc ~xs ~hvm:cfg.hvm ~msitranslate:cfg.pci_msitranslate - ~pci_power_mgmt:cfg.pci_power_mgmt devs domid devid + (* if the device has defined a msitranslate value, use it, - otherwise use the global one *) ++ otherwise use the global one. same for power_mgmt *) + let msitranslate = + match !dev_msitranslate with + | None -> cfg.global_pci_msitranslate + | Some i -> i + in - Device.PCI.add ~xc ~xs ~hvm:cfg.hvm ~msitranslate devs domid devid ++ let pci_power_mgmt = ++ match !dev_power_mgmt with ++ | None -> cfg.global_pci_power_mgmt ++ | Some i -> i ++ in ++ Device.PCI.add ~xc ~xs ~hvm:cfg.hvm ~msitranslate ~pci_power_mgmt devs domid devid ) cfg.pcis; (* add device model *) diff --cc xenvm/vmconfig.ml index 96651f1,e2ea52f..9ea0fd5 --- a/xenvm/vmconfig.ml +++ b/xenvm/vmconfig.ml @@@ -116,7 -110,8 +116,8 @@@ type config = vpt_align: int option; extra_local_watches: string list; extra_vm_watches: string list; - pci_msitranslate: int; - pci_power_mgmt: int; + global_pci_msitranslate: int; ++ global_pci_power_mgmt: int; sound: string option; inject_sci: int; } @@@ -295,7 -267,8 +296,8 @@@ let get cfg field | "vpt-align" -> string_of_int_option cfg.vpt_align | "power-management" -> string_of_int cfg.power_management | "oem-features" -> string_of_int cfg.oem_features - | "pci-msitranslate" -> string_of_int cfg.pci_msitranslate - | "pci-power-management" -> string_of_int cfg.pci_power_mgmt + | "pci-msitranslate" -> string_of_int cfg.global_pci_msitranslate ++ | "pci-power-management" -> string_of_int cfg.global_pci_power_mgmt | "inject-sci" -> string_of_int cfg.inject_sci | _ -> raise (Unknown_field field) @@@ -326,7 -299,8 +328,8 @@@ let set cfg field value | "vpt-align" -> { cfg with vpt_align = int_option_of_string value } | "power-management" -> { cfg with power_management = int_of_string value } | "oem-features" -> { cfg with oem_features = int_of_string value } - | "pci-msitranslate" -> { cfg with pci_msitranslate = int_of_string value } - | "pci-power-management" -> { cfg with pci_power_mgmt = int_of_string value } + | "pci-msitranslate" -> { cfg with global_pci_msitranslate = int_of_string value } ++ | "pci-power-management" -> { cfg with global_pci_power_mgmt = int_of_string value } | "inject-sci" -> { cfg with inject_sci = int_of_string value } | _ -> raise (Unknown_field field) @@@ -635,7 -603,8 +640,8 @@@ let of_file error_report file snapshot_mode = !snapshot_mode; extra_local_watches = List.rev !extra_local_watches; extra_vm_watches = List.rev !extra_vm_watches; - pci_msitranslate = !pci_msitranslate; - pci_power_mgmt = !pci_power_mgmt; + global_pci_msitranslate = !pci_msitranslate; ++ global_pci_power_mgmt = !pci_power_mgmt; sound = !sound; inject_sci = !inject_sci; }