|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-API] [PATCH 5 of 6] HACK/PoC: adjust for minor differences in upstr
# HG changeset patch
# User root@xxxxxxxxxxxxxxxxxxxxx
# Date 1290076616 18000
# Node ID 13460a457762df182fec2b1f4860d640934f73ad
# Parent 2e6a1485047a2e91c2e90d8ffdbf6c9a9814588c
HACK/PoC: adjust for minor differences in upstream Xc bindings
Just a PoC at this stage. It might be better to push the interface differences
to xen-api-libs.hg now to reduce the churn when rebasing to 4.1
Not-Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 2e6a1485047a -r 13460a457762 ocaml/xenops/domain.ml
--- a/ocaml/xenops/domain.ml Thu Nov 18 05:36:56 2010 -0500
+++ b/ocaml/xenops/domain.ml Thu Nov 18 05:36:56 2010 -0500
@@ -837,7 +837,9 @@ let vcpu_affinity_set ~xc domid vcpu cpu
Array.iteri (fun i has_affinity ->
if has_affinity then bitmap := bit_set !bitmap i
) cpumap;
- Xc.vcpu_affinity_set xc domid vcpu !bitmap
+ (*Xc.vcpu_affinity_set xc domid vcpu !bitmap*)
+ Xc.vcpu_affinity_set xc domid vcpu cpumap
+
let vcpu_affinity_get ~xc domid vcpu =
let bitmap = Xc.vcpu_affinity_get xc domid vcpu in
@@ -845,8 +847,9 @@ let vcpu_affinity_get ~xc domid vcpu =
let bit_isset bitmap n =
(Int64.logand bitmap (Int64.shift_left 1L n)) > 0L in
(* set bit in the array that are set in the bitmap *)
- for i = 0 to 63 do cpumap.(i) <- bit_isset bitmap i done;
- cpumap
+ (*for i = 0 to 63 do cpumap.(i) <- bit_isset bitmap i done;*)
+ (*cpumap*)
+ bitmap
let get_uuid ~xc domid =
Uuid.uuid_of_int_array (Xc.domain_getinfo xc domid).Xc.handle
@@ -961,19 +964,20 @@ let cpuid_set ~xc ~hvm domid cfg =
let tmp = Array.create 4 None in
let cfgout = List.map (fun (node, constr) ->
cpuid_cfg_to_xc_cpuid_cfg tmp constr;
- let ret = Xc.domain_cpuid_set xc domid hvm node tmp in
+ let ret = Xc.domain_cpuid_set xc domid (*hvm*) node tmp in
let ret = cpuid_cfg_of_xc_cpuid_cfg ret in
(node, ret)
) cfg in
cfgout
let cpuid_apply ~xc ~hvm domid =
- Xc.domain_cpuid_apply xc domid hvm
+ (*Xc.domain_cpuid_apply xc domid hvm*)
+ Xc.domain_cpuid_apply_policy xc domid
-let cpuid_check cfg =
+let cpuid_check ~xc cfg =
let tmp = Array.create 4 None in
List.map (fun (node, constr) ->
cpuid_cfg_to_xc_cpuid_cfg tmp constr;
- let (success, cfgout) = Xc.cpuid_check node tmp in
+ let (success, cfgout) = Xc.cpuid_check xc node tmp in
(success, (node, (cpuid_cfg_of_xc_cpuid_cfg cfgout)))
) cfg
diff -r 2e6a1485047a -r 13460a457762 ocaml/xenops/domain.mli
--- a/ocaml/xenops/domain.mli Thu Nov 18 05:36:56 2010 -0500
+++ b/ocaml/xenops/domain.mli Thu Nov 18 05:36:56 2010 -0500
@@ -206,4 +206,4 @@ val cpuid_rtype_of_char : char -> cpuid_
val cpuid_set : xc: Xc.handle -> hvm: bool -> domid -> cpuid_config ->
cpuid_config
val cpuid_apply : xc: Xc.handle -> hvm: bool -> domid -> unit
-val cpuid_check : cpuid_config -> (bool * ((int64 * int64 option) * (cpuid_reg
* cpuid_rtype array) list)) list
+val cpuid_check : xc: Xc.handle -> cpuid_config -> (bool * ((int64 * int64
option) * (cpuid_reg * cpuid_rtype array) list)) list
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
|
|
|
|