WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 5 of 6] HACK/PoC: adjust for minor differences in upstr

To: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 5 of 6] HACK/PoC: adjust for minor differences in upstream Xc bindings
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 18 Nov 2010 10:50:27 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 18 Nov 2010 03:12:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1290077422@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1290077422@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.5.2
# 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

<Prev in Thread] Current Thread [Next in Thread>