# HG changeset patch
# User root@xxxxxxxxxxxxxxxxxxxxx
# Date 1290076616 18000
# Node ID 4b9c3e5d05b045b4b93afa12e78afbef41ca7aa1
# Parent 819ce8194667bb673138ad12e781432cebf2028a
xc: use Xcext library rather than Xc where appropriate.
The xc bindings have been split into xc and xcext with the latter
containing bits of xc functionality which are not present in the
upstream xen tree..
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xapi/monitor.ml
--- a/ocaml/xapi/monitor.ml Thu Nov 18 05:36:56 2010 -0500
+++ b/ocaml/xapi/monitor.ml Thu Nov 18 05:36:56 2010 -0500
@@ -92,14 +92,14 @@ let update_vcpus xc doms =
(* Runstate info is per-domain rather than per-vcpu *)
let dss =
try
- let ri = Xc.domain_get_runstate_info xc domid in
- (VM uuid, ds_make ~name:"runstate_entry_time" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xc.state_entry_time) /. 1.0e9)) ~description:""
~ty:Rrd.Derive ~default:false ~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_fullrun" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xc.time0) /. 1.0e9)) ~description:"Fraction of time that
all VCPUs are running" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_full_contention"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xc.time1) /. 1.0e9))
~description:"Fraction of time that all VCPUs are runnable (i.e., waiting for
CPU)" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_concurrency_hazard"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xc.time2) /. 1.0e9))
~description:"Fraction of time that some VCPUs are running and some are
runnable" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_blocked" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xc.time3) /. 1.0e9)) ~description:"Fraction of time that
all VCPUs are blocked or offline" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_partial_run" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xc.time4) /. 1.0e9)) ~description:"Fraction of time that
some VCPUs are running, and some are blocked" ~ty:Rrd.Derive ~default:false
~min:0.0 ())::
- (VM uuid, ds_make ~name:"runstate_partial_contention"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xc.time5) /. 1.0e9))
~description:"Fraction of time that some VCPUs are runnable and some are
blocked" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::dss
+ let ri = Xcext.domain_get_runstate_info xc domid in
+ (VM uuid, ds_make ~name:"runstate_entry_time" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xcext.state_entry_time) /. 1.0e9)) ~description:""
~ty:Rrd.Derive ~default:false ~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_fullrun" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xcext.time0) /. 1.0e9)) ~description:"Fraction of time that
all VCPUs are running" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_full_contention"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xcext.time1) /. 1.0e9))
~description:"Fraction of time that all VCPUs are runnable (i.e., waiting for
CPU)" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_concurrency_hazard"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xcext.time2) /. 1.0e9))
~description:"Fraction of time that some VCPUs are running and some are
runnable" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_blocked" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xcext.time3) /. 1.0e9)) ~description:"Fraction of time that
all VCPUs are blocked or offline" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_partial_run" ~value:(Rrd.VT_Float
((Int64.to_float ri.Xcext.time4) /. 1.0e9)) ~description:"Fraction of time that
some VCPUs are running, and some are blocked" ~ty:Rrd.Derive ~default:false
~min:0.0 ())::
+ (VM uuid, ds_make ~name:"runstate_partial_contention"
~value:(Rrd.VT_Float ((Int64.to_float ri.Xcext.time5) /. 1.0e9))
~description:"Fraction of time that some VCPUs are runnable and some are
blocked" ~ty:Rrd.Derive ~default:false ~min:0.0 ())::dss
with e ->
dss
in
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops-ts/OMakefile
--- a/ocaml/xenops-ts/OMakefile Thu Nov 18 05:36:56 2010 -0500
+++ b/ocaml/xenops-ts/OMakefile Thu Nov 18 05:36:56 2010 -0500
@@ -3,6 +3,6 @@ OCAML_LIBS = ../util/stats ../xeno
OCAML_CLIBS += $(XEN_OCAML_CLIBS)
OCAML_LINK_FLAGS += $(XEN_OCAML_LINK_FLAGS)
CFLAGS += $(XEN_CFLAGS)
-OCAMLPACKS = xc xs stdext log cdrom netdev
+OCAMLPACKS = xc xcext xs stdext log cdrom netdev
OCamlProgram(runtest, runtest test ../xenops/xenvmlib)
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops/OMakefile
--- a/ocaml/xenops/OMakefile Thu Nov 18 05:36:56 2010 -0500
+++ b/ocaml/xenops/OMakefile Thu Nov 18 05:36:56 2010 -0500
@@ -4,7 +4,7 @@ OCAML_CLIBS += $(XEN_OCAML_CLIBS)
OCAML_LINK_FLAGS+= $(XEN_OCAML_LINK_FLAGS)
CFLAGS += $(XEN_CFLAGS)
-OCAMLPACKS = threads xc xs stdext log cdrom netdev
+OCAMLPACKS = threads xc xcext xs stdext log cdrom netdev
OCAMLFLAGS += -thread
LIBFILES = xenops_helpers xenbus balloon xenguestHelper domain hotplug device
io statdev xal netman memory watch device_common squeeze squeeze_xen
squeezed_rpc squeezed_state squeezed_rpc
diff -r 819ce8194667 -r 4b9c3e5d05b0 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
@@ -242,7 +242,7 @@ let shutdown_wait_for_ack ?(timeout=60.)
let di = Xc.domain_getinfo xc domid in
if di.Xc.hvm_guest then begin
- if Xc.hvm_check_pvdriver xc domid
+ if Xcext.hvm_check_pvdriver xc domid
then debug "HVM guest with PV drivers: not expecting any
acknowledgement"
else Xc.domain_shutdown xc domid (shutdown_to_xc_shutdown req)
end else begin
@@ -409,11 +409,11 @@ let build_pre ~xc ~xs ~vcpus ~xen_max_mi
maybe (fun opt -> try f opt with exn -> warn "exception setting %s:
%s" name (Printexc.to_string exn)) opt
in
- maybe_exn_ign "timer mode" (fun mode -> Xc.domain_set_timer_mode xc
domid mode) timer_mode;
- maybe_exn_ign "hpet" (fun hpet -> Xc.domain_set_hpet xc domid hpet)
hpet;
- maybe_exn_ign "vpt align" (fun vpt_align -> Xc.domain_set_vpt_align xc
domid vpt_align) vpt_align;
+ maybe_exn_ign "timer mode" (fun mode -> Xcext.domain_set_timer_mode xc
domid mode) timer_mode;
+ maybe_exn_ign "hpet" (fun hpet -> Xcext.domain_set_hpet xc domid hpet)
hpet;
+ maybe_exn_ign "vpt align" (fun vpt_align -> Xcext.domain_set_vpt_align
xc domid vpt_align) vpt_align;
- Xc.domain_setvmxassist xc domid use_vmxassist;
+ Xcext.domain_setvmxassist xc domid use_vmxassist;
Xc.domain_max_vcpus xc domid vcpus;
Xc.domain_setmaxmem xc domid (Memory.kib_of_mib xen_max_mib);
Xc.domain_set_memmap_limit xc domid (Memory.kib_of_mib xen_max_mib);
@@ -822,10 +822,10 @@ let suspend ~xc ~xs ~hvm domid fd flags
);
debug "Suspend for domid %d finished" domid
-let send_s3resume ~xc domid = Xc.domain_send_s3resume xc domid
+let send_s3resume ~xc domid = Xcext.domain_send_s3resume xc domid
-let trigger_power ~xc domid = Xc.domain_trigger_power xc domid
-let trigger_sleep ~xc domid = Xc.domain_trigger_sleep xc domid
+let trigger_power ~xc domid = Xcext.domain_trigger_power xc domid
+let trigger_sleep ~xc domid = Xcext.domain_trigger_sleep xc domid
let vcpu_affinity_set ~xc domid vcpu cpumap =
let bitmap = ref Int64.zero in
@@ -901,7 +901,7 @@ let set_machine_address_size ~xc domid w
let suppress_spurious_page_faults ~xc domid =
debug "suppress spurious page faults for dom%d" domid;
- Xc.domain_suppress_spurious_page_faults xc domid
+ Xcext.domain_suppress_spurious_page_faults xc domid
type cpuid_reg = Eax | Ebx | Ecx | Edx
type cpuid_rtype = Clear | Set | Default | Same | Keep
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|