Skip to contentSkip to conversation

XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1)

PATCH New Ian Campbell 11 participants 66 messages Nov 18, 2010 – Jan 6, 2011 17 messages not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

The following series against xen-api-libs.hg, xen-api.hg and xen-unstable.hg (to be posted as replies to this mail shortly) lays some groundwork to allow XCP to be used against xen-unstable (and therefore eventually the 4.1 release).

I have very much glossed over (i.e. hacked up the bare minimum of) the actual toolstack port to xen-unstable, since my primary aim was simply to do the groundwork to allow the use of the in-tree bindings in order to ensure that Xen 4.1.0 is released with something with a baseline level of usefulness to XCP. However I did do enough to allow installation and starting of a PV guest and a successful "quicktest -all" run (100% pass, FWIW).

I have arranged that the xen-api-libs.hg and xen-api.hg patches which can be applied now without compromising the existing Xen 3.4 based XCP platform are at the head of the relevant series and that the stuff which depends on the transition to Xen 4.1 comes afterwards and have the REBASE-4.1 prefix (followed by my hacks and other bits and pieces, marked with HACK, they are just for reference and should be applied to /dev/null only). The intention is that the xen-unstable bits can be applied before Xen 4.1 in order that the infrastructure is in place when XCP comes to rebase.

For my testing I have been using the build-xapi-toolstack.sh script from
http://xenbits.xen.org/xapi/install.html so in actual fact some of the patches right at the start of the xen-api-libs.hg and xen-api.hg series as well as the entire xen-dist-ocaml.hg series are actually fixes for issues I encountered when using that script and doing RPM builds outside /usr/src hopefully it is obvious what is what.

While doing this work I started to wonder if using the xb, xs, xc, xl etc names at the toplevel of the ocaml module namespace was wise/polite? I'm not sure what support ocaml has for module namepacing but perhaps we should move the in-tree bindings to e.g. xen.lowlevel.{xb,xs,xc,xl} (to arbitrarily pick up the convention used in the python bindings)?

I also wonder about maintaining non-Xen specific support libraries (such as uuid, log and mmap) in the xen source tree. Perhaps these could be pushed further down into the ocaml ecosystem and become prerequisites of Xen? (assuming there is nothing similar already in the wider ocaml world). Some of the modules have grown slightly different interfaces in xen-api-libs.hg vs xen-unstable.hg, in some cases (e.g. uuid module) resynchronising is simple, in others (e.g. log module) it is not so trivial. This would be partially solved by namespacing the two sets of modules I guess but that seems non-optimal in terms of number of module to maintain.

Ian.

#1 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-dist-ocaml.hg

The following short series of patches makes xen-dist-ocaml.hg easier to use from build-xapi-toolstack.sh.

A message that is not in the archive (sent off-list or not yet received): patchbomb.1290077407-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#3 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004675 18000
# Node ID 01cface0904c7c5d18703ad3f11909ab2f50471c # Parent c8f620542215cbb770e5f56e62eb43559e4a52d8 Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir	/data/rpmbuild
%_tmppath	/data/tmp
Makefile +4 -4
diff -r c8f620542215 -r 01cface0904c Makefile
@@ -8,10 +8,10 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_RPMSDIR?=/usr/src/redhat/RPMS
-RPM_SOURCESDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_RPMSDIR?=$(shell rpm --eval='%_rpmdir')
+RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
 RPMBUILD?=rpmbuild
 
 DIST?=/data
#4 lore raw

PATCH 1/1 Define $(RPM) for use in Makefile

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004675 18000
# Node ID cf457090b419139cf5a67382e4ce8a44f03c4539 # Parent 01cface0904c7c5d18703ad3f11909ab2f50471c Define $(RPM) for use in Makefile

Makefile +1 -0
diff -r 01cface0904c -r cf457090b419 Makefile
@@ -8,6 +8,7 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
+RPM?=rpm
 RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
 RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
 RPM_RPMSDIR?=$(shell rpm --eval='%_rpmdir')
#5 lore raw

PATCH 1/1 Install additional packages

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004675 18000
# Node ID 56f040418b89013cc5773c8a4da3644a59e91a6a # Parent cf457090b419139cf5a67382e4ce8a44f03c4539 Install additional packages

These were built but not installed but were used by something down the build chain.

Makefile +4 -0
diff -r cf457090b419 -r 56f040418b89 Makefile
@@ -46,6 +46,10 @@ build: srpm $(MY_SOURCES)/MANIFEST
 	$(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb $(RPM_SPECSDIR)/omake.spec
 	$(RPM) -ihv $(RPM_BINDIR)/omake* || echo omake is already installed
 	$(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb $(RPM_SPECSDIR)/xmlm.spec $(RPM_SPECSDIR)/getopt.spec $(RPM_SPECSDIR)/type-conv.spec
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-xmlm*.rpm || echo ocaml-xmlm is already installed
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-getopt*.rpm || echo ocaml-getopt is already installed
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-type-conv*.rpm || echo ocaml-type-conv is already installed
+
 
 .PHONY: srpm
 srpm:

A message that is not in the archive (sent off-list or not yet received): 1290077348.31507.5282.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#7 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-api-libs.hg

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1.

This is the xen-api-libs.hg portion.

Only the first three patches are for immediate consideration, the others all depend on actually moving to Xen 4.1.

A message that is not in the archive (sent off-list or not yet received): patchbomb.1290077414-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#9 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004595 18000
# Node ID cdd93d37eb6036e9901ecc0cd1f949901ff1aea4 # Parent 3be1829b46b70a8ae4b2013fc20b71a76f3b55ee Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir        /data/rpmbuild
%_tmppath       /data/tmp
Makefile.in +2 -2
diff -r 3be1829b46b7 -r cdd93d37eb60 Makefile.in
@@ -211,8 +211,8 @@ cleanxen:
 	$(MAKE) -C xsrpc clean
 	$(MAKE) -C eventchn clean
 
-RPM_SPECSDIR=/usr/src/redhat/SPECS
-RPM_SOURCEDIR=/usr/src/redhat/SOURCES
+RPM_SPECSDIR=$(shell rpm --eval='%_specdir')
+RPM_SOURCEDIR=$(shell rpm --eval='%_sourcedir')
 XEN_RELEASE=xcp0.2
 
 $(RPM_SPECSDIR)/xapi-libs.spec: xapi.spec.in
Makefile.xcp +3 -3
diff -r 3be1829b46b7 -r cdd93d37eb60 Makefile.xcp
@@ -6,9 +6,9 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_SOURCEDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_SOURCEDIR?=$(shell rpm --eval='%_sourcedir')
 XEN_RELEASE?=unknown
 endif
 
#10 lore raw

PATCH 1/1 xc: split xc non-upstream bindings into xcext module

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004595 18000
# Node ID be3de1c0aa0687ef9fa6ad2ac5cfa1a74fb14484 # Parent cdd93d37eb6036e9901ecc0cd1f949901ff1aea4
xc: split xc non-upstream bindings into xcext module.

move anything which is not provided by upstream libxc and the associated ocaml bindings in a separate xcext library to ease replacement of xc library by upstream version.

Some of this functionality could potentially be upstreamed straight away but other bits rely on stuff from the XCP hypervisor patch queue.

One change of not is that Xcext.hvm_check_pvdriver expects that domid is always an HVM domain. This matches the existing callsites (and the name) and reduces cross talk between xc and xcext.

Makefile.in +5 -0
diff -r cdd93d37eb60 -r be3de1c0aa06 Makefile.in
@@ -41,6 +41,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xc
 	$(MAKE) -C xb
 	$(MAKE) -C xs
+	$(MAKE) -C xcext
 	$(MAKE) -C xsrpc
 	$(MAKE) -C eventchn
 	$(MAKE) -C cpuid
@@ -81,6 +82,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xc install
 	$(MAKE) -C xb install
 	$(MAKE) -C xs install
+	$(MAKE) -C xcext install
 	$(MAKE) -C xsrpc install
 	$(MAKE) -C eventchn install
 	$(MAKE) -C cpuid install
@@ -122,6 +124,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xs uninstall
 	$(MAKE) -C xb uninstall
 	$(MAKE) -C xc uninstall
+	$(MAKE) -C xcext uninstall
 	$(MAKE) -C mmap uninstall
 	$(MAKE) -C cpuid uninstall
 	$(MAKE) -C vhd uninstall
@@ -160,6 +163,7 @@ doc:
 	$(MAKE) -C xb doc
 	$(MAKE) -C xc doc
 	$(MAKE) -C xs doc
+	$(MAKE) -C xcext doc
 	$(MAKE) -C xml-light2 doc
 	$(MAKE) -C rpc-light doc
 	$(MAKE) -C http-svr doc
@@ -208,6 +212,7 @@ cleanxen:
 	$(MAKE) -C xc clean
 	$(MAKE) -C xb clean
 	$(MAKE) -C xs clean
+	$(MAKE) -C xcext clean
 	$(MAKE) -C xsrpc clean
 	$(MAKE) -C eventchn clean
 
cpuid/META.in +1 -1
diff -r cdd93d37eb60 -r be3de1c0aa06 cpuid/META.in
@@ -1,5 +1,5 @@
 version = "@VERSION@"
 description = "Cpuid extension"
-requires = "stdext xc xen-utils"
+requires = "stdext xc xcext xen-utils"
 archive(byte) = "cpuid.cma"
 archive(native) = "cpuid.cmxa"
cpuid/Makefile +2 -2
diff -r cdd93d37eb60 -r be3de1c0aa06 cpuid/Makefile
@@ -2,7 +2,7 @@ CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
 OCAMLOPT = ocamlopt
-INCLUDES = -I ../stdext -I ../xc -I ../xen-utils
+INCLUDES = -I ../stdext -I ../xc -I ../xcext -I ../xen-utils
 
 LDFLAGS = -cclib -L./
 
@@ -65,7 +65,7 @@ uninstall:
 
 .PHONY: doc
 doc: $(INTF)
-	python ../doc/doc.py $(DOCDIR) "cpuid" "package" "$(OBJS)" "." "stdext xc xen-utils" ""
+	python ../doc/doc.py $(DOCDIR) "cpuid" "package" "$(OBJS)" "." "stdext xc xcext xen-utils" ""
 	
 clean:
 	rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) *~ *.rej
cpuid/cpuid.ml +1 -1
diff -r cdd93d37eb60 -r be3de1c0aa06 cpuid/cpuid.ml
@@ -138,7 +138,7 @@ let is_maskable manufacturer family mode
 
 let get_features_from_xen () =
 	let features = 
-	  try Xc.with_intf (fun xc -> Xc.get_boot_cpufeatures xc) 
+	  try Xc.with_intf (fun xc -> Xcext.get_boot_cpufeatures xc) 
 	  with _ -> 0l, 0l, 0l, 0l, 0l, 0l, 0l, 0l 
 	in
 	match features with
xapi-libs.spec +8 -0
diff -r cdd93d37eb60 -r be3de1c0aa06 xapi-libs.spec
@@ -341,6 +341,14 @@ rm -rf $RPM_BUILD_ROOT
    /usr/lib/ocaml/xc/xc.cmi
    /usr/lib/ocaml/xc/xc.cmx
    /usr/lib/ocaml/xc/xc.cmxa
+   /usr/lib/ocaml/xcext/META
+   /usr/lib/ocaml/xcext/dllxcext_stubs.so
+   /usr/lib/ocaml/xcext/libxcext_stubs.a
+   /usr/lib/ocaml/xcext/xcext.a
+   /usr/lib/ocaml/xcext/xcext.cma
+   /usr/lib/ocaml/xcext/xcext.cmi
+   /usr/lib/ocaml/xcext/xcext.cmx
+   /usr/lib/ocaml/xcext/xcext.cmxa
    /usr/lib/ocaml/xs/META
    /usr/lib/ocaml/xs/queueop.cmx
    /usr/lib/ocaml/xs/xs.a
xc/xc.h +0 -27
diff -r cdd93d37eb60 -r be3de1c0aa06 xc/xc.h
@@ -31,20 +31,9 @@
 #include <xen/hvm/params.h>
 #include "xc_e820.h"
 
-#ifndef XEN_DOMCTL_get_runstate_info
-#warning "runstate info is missing"
-typedef struct {
-	int32_t state;
-	uint32_t missed_changes;
-	uint64_t state_entry_time;
-	uint64_t time[6];
-} xen_domctl_runstate_info_t;
-#endif
-
 typedef xen_domctl_getdomaininfo_t xc_domaininfo_t;
 typedef xen_domctl_getvcpuinfo_t xc_vcpuinfo_t;
 typedef xen_sysctl_physinfo_t xc_physinfo_t;
-typedef xen_domctl_runstate_info_t xc_runstate_info_t;
 
 struct xc_core_header {
 	unsigned int xch_magic;
@@ -111,14 +100,11 @@ int xc_domain_memory_populate_physmap(in
                                       unsigned int extent_order,
                                       unsigned int address_bits,
                                       xen_pfn_t *extent_start);
-int xc_domain_setvmxassist(int handle, unsigned int domid, int use_vmxassist);
 int xc_domain_max_vcpus(int handle, unsigned int domid, unsigned int max);
 int xc_domain_sethandle(int handle, unsigned int domid,
                         xen_domain_handle_t dhandle);
 int xc_vcpu_getinfo(int handle, unsigned int domid, unsigned int vcpu,
                     xc_vcpuinfo_t *info);
-int xc_get_runstate_info(int handle, unsigned int domid,
-			 xc_runstate_info_t *info);
 int xc_domain_ioport_permission(int handle, unsigned int domid,
                                 unsigned int first_port, unsigned int nr_ports,
                                 unsigned int allow_access);
@@ -158,7 +144,6 @@ int xc_shadow_allocation_set(int handle,
 			     uint32_t mb);
 int xc_domain_get_pfn_list(int handle, unsigned int domid,
                            xen_pfn_t *pfn_array, unsigned long max_pfns);
-int xc_hvm_check_pvdriver(int handle, unsigned int domid);
 
 int xc_domain_assign_device(int handle, unsigned int domid,
                             int domain, int bus, int slot, int func);
@@ -177,18 +162,6 @@ int xc_domain_cpuid_set(int xc, unsigned
 int xc_domain_cpuid_apply(int xc, unsigned int domid, int hvm);
 int xc_cpuid_check(uint32_t input, uint32_t optsubinput,
                    char *config[4], char *config_out[4]);
-int xc_domain_suppress_spurious_page_faults(int xc, uint32_t domid);
-
-int xc_domain_send_s3resume(int handle, unsigned int domid);
-int xc_domain_set_vpt_align(int handle, unsigned int domid, int vpt_align);
-int xc_domain_set_hpet(int handle, unsigned int domid, int hpet);
-int xc_domain_set_timer_mode(int handle, unsigned int domid, int mode);
-int xc_domain_get_acpi_s_state(int handle, unsigned int domid);
-int xc_domain_trigger_power(int handle, unsigned int domid);
-int xc_domain_trigger_sleep(int handle, unsigned int domid);
-
-int xc_get_boot_cpufeatures(int handle, uint32_t *, uint32_t *, uint32_t *,
-	uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 #if XEN_SYSCTL_INTERFACE_VERSION >= 6
 #define SAFEDIV(a, b)					(((b) >= 0) ? (a) / (b) : (a))
xc/xc.ml +0 -37
diff -r cdd93d37eb60 -r be3de1c0aa06 xc/xc.ml
@@ -26,18 +26,6 @@ type vcpuinfo =
 	cpumap: int32;
 }
 
-type runstateinfo = {
-  state : int32;
-  missed_changes: int32;
-  state_entry_time : int64;
-  time0 : int64;
-  time1 : int64;
-  time2 : int64;
-  time3 : int64;
-  time4 : int64;
-  time5 : int64;
-}
-
 type domaininfo =
 {
 	domid             : domid;
@@ -138,9 +126,6 @@ external _domain_sethandle: handle -> do
 let domain_sethandle handle n uuid =
 	_domain_sethandle handle n (Uuid.int_array_of_uuid uuid)
 
-external domain_setvmxassist: handle -> domid -> bool -> unit
-       = "stub_xc_domain_setvmxassist"
-
 external domain_max_vcpus: handle -> domid -> int -> unit
        = "stub_xc_domain_max_vcpus"
 
@@ -168,8 +153,6 @@ external domain_getinfo: handle -> domid
 
 external domain_get_vcpuinfo: handle -> int -> int -> vcpuinfo
        = "stub_xc_vcpu_getinfo"
-external domain_get_runstate_info : handle -> int -> runstateinfo
-  = "stub_xc_get_runstate_info"
 
 external domain_ioport_permission: handle -> domid -> int -> int -> bool -> unit
        = "stub_xc_domain_ioport_permission"
@@ -243,23 +226,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_suppress_spurious_page_faults: handle -> domid -> unit
-       = "stub_xc_domain_suppress_spurious_page_faults"
-
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external domain_trigger_power: handle -> domid -> unit = "stub_xc_domain_trigger_power"
-external domain_trigger_sleep: handle -> domid -> unit = "stub_xc_domain_trigger_sleep"
-
-(** check if some hvm domain got pv driver or not *)
-external hvm_check_pvdriver: handle -> domid -> bool
-       = "stub_xc_hvm_check_pvdriver"
-
 external version: handle -> version = "stub_xc_version_version"
 external version_compile_info: handle -> compile_info
        = "stub_xc_version_compile_info"
@@ -270,9 +236,6 @@ external version_capabilities: handle ->
 external watchdog : handle -> int -> int32 -> int
   = "stub_xc_watchdog"
 
-external get_boot_cpufeatures: handle ->
-	(int32 * int32 * int32 * int32 * int32 * int32 * int32 * int32) = "stub_xc_get_boot_cpufeatures"
-
 (* core dump structure *)
 type core_magic = Magic_hvm | Magic_pv
 
xc/xc.mli +0 -37
diff -r cdd93d37eb60 -r be3de1c0aa06 xc/xc.mli
@@ -19,17 +19,6 @@ type vcpuinfo = {
   cputime : int64;
   cpumap : int32;
 }
-type runstateinfo = {
-  state : int32;
-  missed_changes: int32;
-  state_entry_time : int64;
-  time0 : int64;
-  time1 : int64;
-  time2 : int64;
-  time3 : int64;
-  time4 : int64;
-  time5 : int64;
-}
 type domaininfo = {
   domid : domid;
   dying : bool;
@@ -89,8 +78,6 @@ val domain_create : handle -> int32 -> d
 external _domain_sethandle : handle -> domid -> int array -> unit
   = "stub_xc_domain_sethandle"
 val domain_sethandle : handle -> domid -> 'a Uuid.t -> unit
-external domain_setvmxassist: handle -> domid -> bool -> unit
-  = "stub_xc_domain_setvmxassist"
 external domain_max_vcpus : handle -> domid -> int -> unit
   = "stub_xc_domain_max_vcpus"
 external domain_pause : handle -> domid -> unit = "stub_xc_domain_pause"
@@ -107,8 +94,6 @@ external domain_getinfo : handle -> domi
   = "stub_xc_domain_getinfo"
 external domain_get_vcpuinfo : handle -> int -> int -> vcpuinfo
   = "stub_xc_vcpu_getinfo"
-external domain_get_runstate_info : handle -> int -> runstateinfo
-  = "stub_xc_get_runstate_info"
 external domain_ioport_permission: handle -> domid -> int -> int -> bool -> unit
        = "stub_xc_domain_ioport_permission"
 external domain_iomem_permission: handle -> domid -> nativeint -> nativeint -> bool -> unit
@@ -158,21 +143,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit
-  = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external domain_trigger_power: handle -> domid -> unit
-  = "stub_xc_domain_trigger_power"
-external domain_trigger_sleep: handle -> domid -> unit
-  = "stub_xc_domain_trigger_sleep"
-
-external hvm_check_pvdriver : handle -> domid -> bool
-  = "stub_xc_hvm_check_pvdriver"
 external version : handle -> version = "stub_xc_version_version"
 external version_compile_info : handle -> compile_info
   = "stub_xc_version_compile_info"
@@ -201,9 +171,6 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_suppress_spurious_page_faults: handle -> domid -> unit
-       = "stub_xc_domain_suppress_spurious_page_faults"
-
 external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
@@ -212,7 +179,3 @@ external domain_cpuid_apply: handle -> d
        = "stub_xc_domain_cpuid_apply"
 external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
-
-external get_boot_cpufeatures: handle ->
-	(int32 * int32 * int32 * int32 * int32 * int32 * int32 * int32) = "stub_xc_get_boot_cpufeatures"
-
xc/xc_lib.c +0 -190

220 lines not on this page · raw message

xc/xc_stubs.c +0 -164

194 lines not on this page · raw message

xcext/META.in new file +5 -0
diff -r cdd93d37eb60 -r be3de1c0aa06 xcext/META.in
@@ -0,0 +1,5 @@
+version = "@VERSION@"
+description = "Xen Control Interface (extensions)"
+requires = "mmap,uuid,xc"
+archive(byte) = "xcext.cma"
+archive(native) = "xcext.cmxa"
xcext/Makefile new file +71 -0

71 lines not on this page · raw message

xcext/xcext.h new file +70 -0

70 lines not on this page · raw message

xcext/xcext.ml new file +52 -0

52 lines not on this page · raw message

xcext/xcext.mli new file +55 -0

55 lines not on this page · raw message

xcext/xcext_lib.c new file +372 -0

372 lines not on this page · raw message

xcext/xcext_stubs.c new file +210 -0

210 lines not on this page · raw message

#11 lore raw

Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Quoted 11 lines · Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004595 18000
# Node ID be3de1c0aa0687ef9fa6ad2ac5cfa1a74fb14484 # Parent cdd93d37eb6036e9901ecc0cd1f949901ff1aea4
xc: split xc non-upstream bindings into xcext module.

move anything which is not provided by upstream libxc and the associated ocaml bindings in a separate xcext library to ease replacement of xc library by upstream version.

Quoted 7 lines

Some of this functionality could potentially be upstreamed straight away but other bits rely on stuff from the XCP hypervisor patch queue.

One change of not is that Xcext.hvm_check_pvdriver expects that domid is always an HVM domain. This matches the existing callsites (and the name) and reduces cross talk between xc and xcext.

This is breaking xiu. as i said before the xc C library in XCP is different than the one in opensource; There's an injection layer that give the ability to catch stuff and redirect them to userspace, where we can simulate lots of things. Last time i checked this was still used by a bunch of people for testing.

Signature · 1 line
Vincent
#12 lore raw

Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Quoted 15 lines · Vincent Hanquez
Quoted 14 lines · Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004595 18000
# Node ID be3de1c0aa0687ef9fa6ad2ac5cfa1a74fb14484 # Parent cdd93d37eb6036e9901ecc0cd1f949901ff1aea4
xc: split xc non-upstream bindings into xcext module.

move anything which is not provided by upstream libxc and the associated ocaml bindings in a separate xcext library to ease replacement of xc library by upstream version.

Some of this functionality could potentially be upstreamed straight away but other bits rely on stuff from the XCP hypervisor patch queue.

Quoted 7 lines
Quoted 4 lines

One change of not is that Xcext.hvm_check_pvdriver expects that domid is always an HVM domain. This matches the existing callsites (and the name) and reduces cross talk between xc and xcext.

This is breaking xiu. as i said before the xc C library in XCP is different than the one in opensource;

That would be fine (or at least I'd have no grounds to complain ;-)) for out-of-tree bindings but I don't think it is acceptable for in tree bindings to duplicate infrastructure libraries in this way.

Quoted 4 lines

There's an injection layer that give the ability to catch stuff and redirect them to userspace, where
we can simulate lots of things. Last time i checked this was still used by a bunch of people for testing.

Absolutely, I think the XIU stuff is really very useful indeed. I think it even has the potential for wider usefulness than just XCP.

Addressing this is next on my list so my plan is only half baked (if that!) but I think the hooks necessary to support an injection infrastructure of this type could be integrated into libxc without too much pain. Doing this would allow xl, libvirt etc to also use the XIU functionality for testing which I think would be really cool.

I've several possible approaches in mind:

* Just whack the hooks and injection layer into libxc itself, there aren't really that many hook points or that much code in the injection layer...
* Turn xc_injection_lib.c into a LD_PRELOAD'able library. Requires moving various, do_{domctl,ioctl,etc} stuff out of line in the library -- which I think is a good idea anyway.
* Add functionality to libxc to allow it to dlopen a backend (e.g. pointed to by an envvar) containing the hook implementation with explicit calls to the layer as necessary.

Probably the second two are pretty much equivalent modulo the name of the environment variable being either LD_PRELOAD or something else.

Initially I think I prefer the dynamic loading approaches to dropping the injection stuff directly into libxc. In particular the dynamic options allow the injection layer and XIU backend to live together whereas the first option effectively has the injection layer in xen-unstable.hg and the XIU backend possibly somewhere else which doesn't seem helpful.

The dynamic solution also allows for other injection layers and backends but I'm not sure how useful that actually is. Perhaps a valgrind friendly backend or something like that, dunno.

Ian.

#13 lore raw

Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Quoted 31 lines · Ian Campbell

Absolutely, I think the XIU stuff is really very useful indeed. I think it even has the potential for wider usefulness than just XCP.

Addressing this is next on my list so my plan is only half baked (if that!) but I think the hooks necessary to support an injection infrastructure of this type could be integrated into libxc without too much pain. Doing this would allow xl, libvirt etc to also use the XIU functionality for testing which I think would be really cool.

I've several possible approaches in mind:

* Just whack the hooks and injection layer into libxc itself, there aren't really that many hook points or that much code in the injection layer...
* Turn xc_injection_lib.c into a LD_PRELOAD'able library. Requires moving various, do_{domctl,ioctl,etc} stuff out of line in the library -- which I think is a good idea anyway.
* Add functionality to libxc to allow it to dlopen a backend (e.g. pointed to by an envvar) containing the hook implementation with explicit calls to the layer as necessary.

Probably the second two are pretty much equivalent modulo the name of the environment variable being either LD_PRELOAD or something else.

Initially I think I prefer the dynamic loading approaches to dropping the injection stuff directly into libxc. In particular the dynamic options allow the injection layer and XIU backend to live together whereas the first option effectively has the injection layer in xen-unstable.hg and the XIU backend possibly somewhere else which doesn't seem helpful.

Quoted 3 lines

The dynamic solution also allows for other injection layers and backends but I'm not sure how useful that actually is. Perhaps a valgrind friendly backend or something like that, dunno

I pretty much agree with you, however just a bit of comments.

option 1 is more dynamic than option 2. you can mix and match backend just setting/unsetting your XIU environment before any XC call technically. this isn't possible with LD_PRELOAD, since it's one shot during the start of your program.

3 is pretty much equivalent to 1 and best technically IMO. it's just a bit more efforts to do, hence why option 1 is the one available now.

Signature · 1 line
Vincent

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw

Re: [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Quoted 4 lines · Vincent Hanquez

option 1 is more dynamic than option 2. you can mix and match backend just setting/unsetting your XIU environment before any XC call technically. this isn't possible with LD_PRELOAD, since it's one shot during the start of your program.

True, I hadn't thought of it that way.

Quoted 1 line

3 is pretty much equivalent to 1 and best technically IMO.

Agreed.

Quoted 1 line

it's just a bit more efforts to do,

It turns out to have been a mornings work to implement the hooks support in libxc plus a simple "ENOSYS stub". I'm hoping it will be an afternoons work to port xc_lib_injection.c over, but perhaps I'm over ambitious ;-)

Ian.

A message that is not in the archive (sent off-list or not yet received): 1290094550.31507.5391.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#17 lore raw

[Xen-devel] Re: [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Ian Campbell writes ("[Xen-devel] Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module"):

Quoted 3 lines

* Add functionality to libxc to allow it to dlopen a backend (e.g. pointed to by an envvar) containing the hook implementation with explicit calls to the layer as necessary.

I think this is the best approach. You could put the hook function pointers in the xc handle struct.

Quoted 2 lines

Probably the second two are pretty much equivalent modulo the name of the environment variable being either LD_PRELOAD or something else.

LD_PRELOAD is a sledgehammer to crack a nut for this, I think. Also, I generally think that the existence of LD_PRELOAD should not be used as an excuse for not providing a properly-supported interface.

Ian.

A message that is not in the archive (sent off-list or not yet received): 19686.46942.593712.651242-msK/[email protected]

#19 lore raw

Re: [Xen-devel] Re: [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Quoted 7 lines · Ian Jackson

Ian Campbell writes ("[Xen-devel] Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module"):

Quoted 3 lines

* Add functionality to libxc to allow it to dlopen a backend (e.g. pointed to by an envvar) containing the hook implementation with explicit calls to the layer as necessary.

I think this is the best approach. You could put the hook function pointers in the xc handle struct.

I've currently made them global (and it works ok for the cases I've tried) but I think adding them to the xc_handle would indeed be better.

Next I need to decide what to do with the event channel interfaces in libxenctrl which also need this treatment but which currently use a straight integer as the handle.

I shall probably convert the evtchn interfaces to use an xc_interface style opaque pointer as a handle, possibly/probably even reusing the existing xc_handle type in some way since it already contains broadly the right set of stuff.

Quoted 6 lines
Quoted 2 lines

Probably the second two are pretty much equivalent modulo the name of the environment variable being either LD_PRELOAD or something else.

LD_PRELOAD is a sledgehammer to crack a nut for this, I think. Also, I generally think that the existence of LD_PRELOAD should not be used as an excuse for not providing a properly-supported interface.

Agreed.

Ian.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): m2n.s.1PKW6s-0019ae-QGMSyCZBOSwv4zxTlrOuLwNdhmdF6hFW@public.gmane.org

#22 lore raw

Re: [Xen-devel] Re: [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

Ian Campbell writes ("Re: [Xen-devel] Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module"):

Quoted 4 lines

I shall probably convert the evtchn interfaces to use an xc_interface style opaque pointer as a handle, possibly/probably even reusing the existing xc_handle type in some way since it already contains broadly the right set of stuff.

Have fun with that. I ducked that one when I was doing the xc_handle type change ...

Ian.

#23 lore raw

Re: Re: [Xen-API] [PATCH 2 of 4] xc: split xc non-upstream bindings into xcext module

In reply to Vincent Hanquez
Quoted 20 lines · Vincent Hanquez
Quoted 11 lines · Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004595 18000
# Node ID be3de1c0aa0687ef9fa6ad2ac5cfa1a74fb14484 # Parent cdd93d37eb6036e9901ecc0cd1f949901ff1aea4
xc: split xc non-upstream bindings into xcext module.

move anything which is not provided by upstream libxc and the associated ocaml bindings in a separate xcext library to ease replacement of xc library by upstream version.

Quoted 7 lines

Some of this functionality could potentially be upstreamed straight away but other bits rely on stuff from the XCP hypervisor patch queue.

One change of not is that Xcext.hvm_check_pvdriver expects that domid is always an HVM domain. This matches the existing callsites (and the name) and reduces cross talk between xc and xcext.

Quoted 6 lines

This is breaking xiu. as i said before the xc C library in XCP is different than the one in opensource;
There's an injection layer that give the ability to catch stuff and redirect them to userspace, where
we can simulate lots of things. Last time i checked this was still used by a bunch of people for testing.

Is this not suitable for upstreaming?

Gianni

#24 lore raw

PATCH 1/1 add configure-time option to use system installed Xen library bindings

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004595 18000
# Node ID 83a3a9308e561806013a111a58f65991d37b9c17
# Parent be3de1c0aa0687ef9fa6ad2ac5cfa1a74fb14484
add configure-time option to use system installed Xen library bindings.

Could be made to auto detect the Xen version but for now requires the user to explicitly opt in.

Makefile.in +42 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 Makefile.in
@@ -5,9 +5,13 @@ HAVE_LINUX_CDROM = @LINUX_CDROM@
 HAVE_XMLM = @OCAML_PKG_xmlm@
 HAVE_TYPECONV = @OCAML_PKG_type_conv@
 
+include config.mk
+
 .PHONY: all
 all:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid
+endif
 ifeq ($(HAVE_TYPECONV),type-conv)
 	$(MAKE) -C rpc-light
 endif
@@ -36,21 +40,29 @@ endif
 .PHONY: allxen
 allxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap
+endif
 	$(MAKE) -C netdev
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc
 	$(MAKE) -C xb
 	$(MAKE) -C xs
+endif
 	$(MAKE) -C xcext
 	$(MAKE) -C xsrpc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn
+endif
 	$(MAKE) -C cpuid
 	$(MAKE) -C vhd
 	$(MAKE) -C tapctl
 endif
 
 install:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid install
+endif
 	$(MAKE) -C stdext install
 	$(MAKE) -C log install
 	$(MAKE) -C stunnel install
@@ -77,21 +89,29 @@ endif
 
 installxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap install
+endif
 	$(MAKE) -C netdev install
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc install
 	$(MAKE) -C xb install
 	$(MAKE) -C xs install
+endif
 	$(MAKE) -C xcext install
 	$(MAKE) -C xsrpc install
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn install
+endif
 	$(MAKE) -C cpuid install
 	$(MAKE) -C vhd install
 	$(MAKE) -C tapctl install
 endif
 
 uninstall:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid uninstall
+endif
 	$(MAKE) -C stdext uninstall
 	$(MAKE) -C log uninstall
 	$(MAKE) -C stunnel uninstall
@@ -118,14 +138,20 @@ endif
 
 uninstallxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn uninstall
+endif
 	$(MAKE) -C xsrpc uninstall
 	$(MAKE) -C netdev uninstall
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xs uninstall
 	$(MAKE) -C xb uninstall
 	$(MAKE) -C xc uninstall
+endif
 	$(MAKE) -C xcext uninstall
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap uninstall
+endif
 	$(MAKE) -C cpuid uninstall
 	$(MAKE) -C vhd uninstall
 	$(MAKE) -C tapctl uninstall
@@ -156,25 +182,33 @@ binuninstall:
 
 .PHONY: doc
 doc:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid doc
+endif
 	$(MAKE) -C stdext doc
 	$(MAKE) -C sexpr doc
 	$(MAKE) -C log doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xb doc
 	$(MAKE) -C xc doc
 	$(MAKE) -C xs doc
+endif
 	$(MAKE) -C xcext doc
 	$(MAKE) -C xml-light2 doc
 	$(MAKE) -C rpc-light doc
 	$(MAKE) -C http-svr doc
 	$(MAKE) -C camldm doc
 	$(MAKE) -C cdrom doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn doc
+endif
 	$(MAKE) -C pciutil doc
 	$(MAKE) -C rss doc
 	$(MAKE) -C stunnel doc
 	$(MAKE) -C xsrpc doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap doc
+endif
 	$(MAKE) -C netdev doc
 	$(MAKE) -C forking_executioner doc
 	$(MAKE) -C mlvm doc
@@ -185,7 +219,9 @@ doc:
 
 .PHONY: clean
 clean:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid clean
+endif
 	$(MAKE) -C camldm clean
 	$(MAKE) -C stdext clean
 	$(MAKE) -C log clean
@@ -207,14 +243,20 @@ clean:
 	$(MAKE) -C xen-utils clean
 
 cleanxen:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap clean
+endif
 	$(MAKE) -C netdev clean
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc clean
 	$(MAKE) -C xb clean
 	$(MAKE) -C xs clean
+endif
 	$(MAKE) -C xcext clean
 	$(MAKE) -C xsrpc clean
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn clean
+endif
 
 RPM_SPECSDIR=$(shell rpm --eval='%_specdir')
 RPM_SOURCEDIR=$(shell rpm --eval='%_sourcedir')
camldm/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 camldm/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
cdrom/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 cdrom/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
close-and-exec/Makefile +3 -1
diff -r be3de1c0aa06 -r 83a3a9308e56 close-and-exec/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -29,7 +31,7 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 closeandexec: closeandexec.cmxa closeandexec_main.cmx all
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -I ../stdext -I ../uuid uuid.cmxa unix.cmxa threads.cmxa stdext.cmxa closeandexec.cmxa closeandexec_main.cmx -o $@ 
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -I ../stdext $(OCAML_UUID_INC) uuid.cmxa unix.cmxa threads.cmxa stdext.cmxa closeandexec.cmxa closeandexec_main.cmx -o $@ 
 
 closeandexec.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)
configure.ac +7 -1
diff -r be3de1c0aa06 -r 83a3a9308e56 configure.ac
@@ -30,6 +30,11 @@ AC_CHECK_HEADERS([xen/xen.h],[XEN=1],[XE
 AC_CHECK_HEADERS([libdevmapper.h], [DEVICE_MAPPER=1], [DEVICE_MAPPER=0])
 AC_CHECK_HEADERS([linux/cdrom.h], [LINUX_CDROM=1], [LINUX_CDROM=0])
 
+HAVE_XEN_SYSTEM_BINDINGS=0 # could do more intelligent detection here... 
+AC_ARG_WITH(xen-system-bindings, AS_HELP_STRING([--without-xen-system-bindings],[do not use the system installed xen bindings]),
+	[if test "x$withval" = "xno"; then WITH_XEN_SYSTEM_BINDINGS=0; else WITH_XEN_SYSTEM_BINDINGS=1; fi],
+	[WITH_XEN_SYSTEM_BINDINGS=$HAVE_XEN_SYSTEM_BINDINGS])
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_DECLS([XS_RESTRICT],[],[],[
 [
@@ -54,8 +59,9 @@ fi
 AC_CHECK_OCAML_PKG([xmlm])
 AC_CHECK_OCAML_PKG([type-conv])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile config.mk])
 AC_SUBST([XEN])
+AC_SUBST([WITH_XEN_SYSTEM_BINDINGS])
 AC_SUBST([DEVICE_MAPPER])
 AC_SUBST([LINUX_CDROM])
 AC_SUBST([OCAML_PKG_xmlm])
cpuid/Makefile +3 -1
diff -r be3de1c0aa06 -r 83a3a9308e56 cpuid/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
 OCAMLOPT = ocamlopt
-INCLUDES = -I ../stdext -I ../xc -I ../xcext -I ../xen-utils
+INCLUDES = -I ../stdext $(OCAML_XC_INC) -I ../xcext -I ../xen-utils
 
 LDFLAGS = -cclib -L./
 
doc/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 doc/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 .PHONY: clean
 clean:
 	rm -rf components.js content
eventchn/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 eventchn/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
forking_executioner/Makefile +7 -5
diff -r be3de1c0aa06 -r 83a3a9308e56 forking_executioner/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -31,19 +33,19 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 test_forker: test_forker.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../uuid -I ../stdext uuid.cmxa rpc.cmx jsonrpc.cmx -I ../log unix.cmxa stdext.cmxa  test_forker.cmx -o $@
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light $(OCAML_UUID_INC) -I ../stdext uuid.cmxa rpc.cmx jsonrpc.cmx -I ../log unix.cmxa stdext.cmxa  test_forker.cmx -o $@
 
 fe: fe_debug.cmx child.cmx fe_main.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../stdext -I ../uuid -I ../log log.cmxa uuid.cmxa unix.cmxa rpc.cmx jsonrpc.cmx stdext.cmxa fe_debug.cmx child.cmx fe_main.cmx -o $@ 
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../stdext $(OCAML_UUID_INC) -I ../log log.cmxa uuid.cmxa unix.cmxa rpc.cmx jsonrpc.cmx stdext.cmxa fe_debug.cmx child.cmx fe_main.cmx -o $@ 
 
 %.cmo: %.ml
-	$(OCAMLC) -c -I ../log -I ../uuid -I ../stdext -thread -o $@  $<
+	$(OCAMLC) -c -I ../log $(OCAML_UUID_INC) -I ../stdext -thread -o $@  $<
 
 %.cmi: %.mli
-	$(OCAMLC) -c -I ../log -I ../uuid -I ../stdext -o $@  $<
+	$(OCAMLC) -c -I ../log $(OCAML_UUID_INC) -I ../stdext -o $@  $<
 
 %.cmx: %.ml
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../log -I ../uuid -c -I ../stdext -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../log $(OCAML_UUID_INC) -c -I ../stdext -o $@ $<
 
 META: META.in
 	sed 's/@VERSION@/$(VERSION)/g' < $< > $@
http-svr/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 http-svr/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
log/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 log/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 OCAMLLOC := $(shell ocamlc -where)
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml -I$(OCAMLLOC)
mk/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 mk/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 ifdef B_BASE
 include $(B_BASE)/common.mk
 include $(B_BASE)/rpmbuild.mk
mlvm/Makefile +3 -2
diff -r be3de1c0aa06 -r 83a3a9308e56 mlvm/Makefile
@@ -1,3 +1,4 @@
+include ../config.mk
 
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -18,7 +19,7 @@ INTF = $(foreach obj, $(LIBOBJS),$(obj).
 CMDOBJS = messages.cmx mlvm.cmx
 OCAMLC = ocamlfind ocamlc -g
 OCAMLOPT = ocamlfind ocamlopt 
-COMPFLAG = -dtypes -g -I ../stdext -I ../camldm -I ../uuid -for-pack Lvm -pp '${PP}' -I ../rpc-light
+COMPFLAG = -dtypes -g -I ../stdext -I ../camldm $(OCAML_UUID_INC) -for-pack Lvm -pp '${PP}' -I ../rpc-light
 
 LIBS = lvm.cma lvm.cmxa
 
@@ -27,7 +28,7 @@ DOCDIR = /myrepos/xen-api-libs.hg/doc
 default : $(LIBS)
 
 test_allocator: default
-	$(OCAMLOPT) -package kaputt -linkpkg -dtypes -g  -I ../stdext -I ../camldm -I ../uuid -I +kaputt unix.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx ../camldm/camldm.cmxa ../uuid/uuid.cmxa ../stdext/stdext.cmxa ./lvm.cmxa test_allocator.ml -o $@
+	$(OCAMLOPT) -package kaputt -linkpkg -dtypes -g  -I ../stdext -I ../camldm $(OCAML_UUID_INC) -I +kaputt unix.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx ../camldm/camldm.cmxa $(OCAML_UUID_DIR)/uuid.cmxa ../stdext/stdext.cmxa ./lvm.cmxa test_allocator.ml -o $@
 
 lvm.cmx: $(foreach obj,$(LIBOBJS),$(obj).cmx)
 	$(OCAMLOPT) -pack -g -o $@ $(foreach obj,$(LIBOBJS),$(obj).cmx)
mmap/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 mmap/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
netdev/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 netdev/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
pciutil/Makefile +3 -1
diff -r be3de1c0aa06 -r 83a3a9308e56 pciutil/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -29,7 +31,7 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 pciutil: pciutil_main.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ./ -I ../stdext -I ../uuid unix.cmxa uuid.cmxa stdext.cmxa pciutil.cmx -o $@ $^
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ./ -I ../stdext $(OCAML_UUID_INC) unix.cmxa uuid.cmxa stdext.cmxa pciutil.cmx -o $@ $^
 
 pciutil.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)
rpc-light/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 rpc-light/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 OCAMLC = ocamlfind ocamlc
 OCAMLOPT = ocamlfind ocamlopt
 OCAMLFLAGS = -annot -g
rss/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 rss/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
sexpr/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 sexpr/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
stdext/Makefile +13 -8
diff -r be3de1c0aa06 -r 83a3a9308e56 stdext/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 OCAMLLOC := $(shell ocamlc -where)
@@ -17,6 +19,9 @@ OCAMLDESTDIR ?= $(OCAMLLIBDIR)
 
 FEPP = camlp4o -I ../rpc-light -I $(shell ocamlfind query type-conv) pa_type_conv.cmo pa_rpc.cma
 
+OCAML_UUID_INC = -I $(OCAML_UUID_DIR)
+OCAML_UUID_LIB = $(OCAML_UUID_DIR)/uuid.cmxa
+
 OCAML_TEST_INC = -I $(shell ocamlfind query oUnit)
 OCAML_TEST_LIB = $(shell ocamlfind query oUnit)/oUnit.cmxa
 
@@ -75,10 +80,10 @@ base64pp: base64_main.ml all libstdext_s
 	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
 
 fe_cli: fe_cli.ml all libstdext_stubs.a
-	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
+	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa $(OCAML_UUID_LIB) ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
 
 fe_test: fe_test.ml all libstdext_stubs.a
-	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -I ../uuid -o $@ $< -ccopt -L.
+	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa $(OCAML_UUID_LIB) ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg $(OCAML_UUID_INC) -o $@ $< -ccopt -L.
 
 extentlistset_test: extentlistset_test.ml all libstdext_stubs.a
 	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
@@ -111,10 +116,10 @@ fe.cmo: fe.ml
 	$(OCAMLC) -pp '$(FEPP)' -I ../jsonrpc -I ../rpc-light -c -o $@ $<
 
 forkhelpers.cmo: forkhelpers.ml forkhelpers.cmi
-	$(OCAMLC) -thread -I ../uuid -c -o $@ $<
+	$(OCAMLC) -thread $(OCAML_UUID_INC) -c -o $@ $<
 
 filenameext.cmo: filenameext.ml filenameext.cmi
-	$(OCAMLC) -c -I ../uuid -o $@ $<
+	$(OCAMLC) -c $(OCAML_UUID_INC) -o $@ $<
 
 %.cmo: %.ml %.cmi
 	$(OCAMLC) -c -o $@ $<
@@ -126,7 +131,7 @@ forkhelpers.cmi: forkhelpers.mli
 	$(OCAMLC) -thread -c -o $@ $<
 
 filenameext.cmi: filenameext.mli
-	$(OCAMLC) -c -I ../uuid -o $@ $<
+	$(OCAMLC) -c $(OCAML_UUID_INC) -o $@ $<
 
 fe.cmi: fe.cmo
 	$(OCAMLC) -pp '$(FEPP)' -c -o $@ $<
@@ -144,13 +149,13 @@ fecomms.cmx : fecomms.ml
 	$(OCAMLOPT) -I ../rpc-light -c -o $@ $<
 
 forkhelpers.cmx: forkhelpers.ml forkhelpers.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -thread -c -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAML_UUID_INC) -thread -c -o $@ $<
 
 filenameext.cmx: filenameext.ml filenameext.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c -I ../uuid -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c $(OCAML_UUID_INC) -o $@ $<
 
 %.cmx: %.ml %.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -c -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAML_UUID_INC) -c -o $@ $<
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
stunnel/Makefile +5 -3
diff -r be3de1c0aa06 -r 83a3a9308e56 stunnel/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
@@ -31,13 +33,13 @@ stunnel.cma: $(foreach obj,$(OBJS),$(obj
 	$(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo)
 
 %.cmo: %.ml
-	$(OCAMLC) -c -I ../stdext -I ../uuid -I ../log -o $@ $<
+	$(OCAMLC) -c -I ../stdext $(OCAML_UUID_INC) -I ../log -o $@ $<
 
 %.cmi: %.mli
-	$(OCAMLC) -c -I ../stdext -I ../uuid -o $@ $<
+	$(OCAMLC) -c -I ../stdext $(OCAML_UUID_INC) -o $@ $<
 
 %.cmx: %.ml
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c -I ../stdext -I ../uuid -I ../log -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c -I ../stdext $(OCAML_UUID_INC) -I ../log -o $@ $<
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
tapctl/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 tapctl/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
tests/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 tests/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 OCAMLC = ocamlfind ocamlc -g -package "unix,stdext,xc,xb,xs,mmap"
 OCAMLOPT = ocamlfind ocamlopt -package "unix,stdext,xc,xb,xs,mmap"
 
uuid/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 uuid/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
vhd/Makefile +1 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 vhd/Makefile
@@ -1,3 +1,4 @@
+include ../config.mk
 
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
xb/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 xb/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap
 OCAMLC = ocamlc -g -I ../mmap
xc/Makefile +4 -2
diff -r be3de1c0aa06 -r 83a3a9308e56 xc/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap -I./
-OCAMLC = ocamlc -g -I ../mmap -I ../uuid
+OCAMLC = ocamlc -g -I ../mmap $(OCAML_UUID_INC)
 OCAMLOPT = ocamlopt
-OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid
+OCAMLOPTFLAGS = -g -dtypes -I ../mmap $(OCAML_UUID_INC)
 
 LDFLAGS = -cclib -L./
 
xcext/Makefile +4 -2
diff -r be3de1c0aa06 -r 83a3a9308e56 xcext/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap -I./
-OCAMLC = ocamlc -g -I ../mmap -I ../uuid -I ../xc
+OCAMLC = ocamlc -g -I ../mmap -I ../uuid $(OCAML_XC_INC)
 OCAMLOPT = ocamlopt
-OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid -I ../xc
+OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid $(OCAML_XC_INC)
 
 LDFLAGS = -cclib -L./
 
xen-utils/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 xen-utils/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
xml-light2/Makefile +2 -0
diff -r be3de1c0aa06 -r 83a3a9308e56 xml-light2/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 OCAMLPACKS = xmlm
 
xs/Makefile +4 -2
diff -r be3de1c0aa06 -r 83a3a9308e56 xs/Makefile
@@ -1,12 +1,14 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
-OCAMLC = ocamlc -g -I ../xb/
+OCAMLC = ocamlc -g $(OCAML_XB_INC)
 OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
-OCAMLOPTFLAGS = -g -dtypes -I ../xb/
+OCAMLOPTFLAGS = -g -dtypes $(OCAML_XB_INC)
 
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
xsrpc/Makefile +4 -2
diff -r be3de1c0aa06 -r 83a3a9308e56 xsrpc/Makefile
@@ -1,12 +1,14 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
-OCAMLC = ocamlc -g -I ../xb/ -I ../xs/
+OCAMLC = ocamlc -g $(OCAML_XB_INC) $(OCAML_XS_INC)
 OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
-OCAMLOPTFLAGS = -g -dtypes -I ../xb/ -I ../xs/
+OCAMLOPTFLAGS = -g -dtypes $(OCAML_XB_INC) $(OCAML_XS_INC)
 
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
#25 lore raw

PATCH 1/1 REBASE-4.1: default to using system installed bindings if Xen is available

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290076585 18000
# Node ID e0b110816450f9eb6cbd5275aa1f96762f736155
# Parent 83a3a9308e561806013a111a58f65991d37b9c17
REBASE-4.1: default to using system installed bindings if Xen is available

(depends on global rebase to Xen 4.1)

configure.ac +1 -1
diff -r 83a3a9308e56 -r e0b110816450 configure.ac
@@ -30,7 +30,7 @@ AC_CHECK_HEADERS([xen/xen.h],[XEN=1],[XE
 AC_CHECK_HEADERS([libdevmapper.h], [DEVICE_MAPPER=1], [DEVICE_MAPPER=0])
 AC_CHECK_HEADERS([linux/cdrom.h], [LINUX_CDROM=1], [LINUX_CDROM=0])
 
-HAVE_XEN_SYSTEM_BINDINGS=0 # could do more intelligent detection here... 
+HAVE_XEN_SYSTEM_BINDINGS=$XEN # could do more intelligent detection here... 
 AC_ARG_WITH(xen-system-bindings, AS_HELP_STRING([--without-xen-system-bindings],[do not use the system installed xen bindings]),
 	[if test "x$withval" = "xno"; then WITH_XEN_SYSTEM_BINDINGS=0; else WITH_XEN_SYSTEM_BINDINGS=1; fi],
 	[WITH_XEN_SYSTEM_BINDINGS=$HAVE_XEN_SYSTEM_BINDINGS])
#26 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-api.hg

In reply to a message not in the archive

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1

This is the xen-api.hg portion.

Only the first two patches are for immediate consideration, the others all depend on actually moving to Xen 4.1

#27 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User [email protected]
# Date 1290076616 18000
# Node ID 819ce8194667bb673138ad12e781432cebf2028a # Parent 7438d990fed8255bba2d592f767de133bd45863a Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir        /data/rpmbuild
%_tmppath       /data/tmp
Makefile +3 -3
diff -r 7438d990fed8 -r 819ce8194667 Makefile
@@ -107,9 +107,9 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_SOURCESDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
 RPMBUILD?=rpmbuild
 XEN_RELEASE?=unknown
 endif
#28 lore raw

PATCH 1/1 xc: use Xcext library rather than Xc where appropriate

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# 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..

ocaml/xapi/monitor.ml +8 -8
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xapi/monitor.ml
@@ -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
ocaml/xenops-ts/OMakefile +1 -1
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops-ts/OMakefile
@@ -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)
ocaml/xenops/OMakefile +1 -1
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops/OMakefile
@@ -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
ocaml/xenops/domain.ml +9 -9
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops/domain.ml
@@ -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

A message that is not in the archive (sent off-list or not yet received): patchbomb.1290077422-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#30 lore raw

PATCH 1/1 REBASE-4.1: vmops: apply CPUID to all domains

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290076616 18000
# Node ID 810786855fe641b7db0074cfcb2b2a3a4dfd34a0 # Parent 4b9c3e5d05b045b4b93afa12e78afbef41ca7aa1 REBASE-4.1: vmops: apply CPUID to all domains.

Not just when xenclient is enabled.

I think the indentation was confusing here and the PCI passthrough bit wasn't actually guarded by Xapi_globs.xenclient_enabled.

Required on newer hypervisor otherwise guest sees all cpuid leafs == 0.

ocaml/xapi/vmops.ml +3 -4
diff -r 4b9c3e5d05b0 -r 810786855fe6 ocaml/xapi/vmops.ml
@@ -1052,11 +1052,10 @@ let start_paused ?(progress_cb = fun _ -
 
 		      let hvm = Helpers.is_hvm snapshot in			
 
-		      if Xapi_globs.xenclient_enabled then 
-			Domain.cpuid_apply ~xc ~hvm domid;
+		      Domain.cpuid_apply ~xc ~hvm domid;
 
-			  (* XXX: PCI passthrough needs a lot of work *)
-			  let pcidevs = (match pcidevs with Some x -> x | None -> pcidevs_of_vm ~__context ~vm) in
+		      (* XXX: PCI passthrough needs a lot of work *)
+		      let pcidevs = (match pcidevs with Some x -> x | None -> pcidevs_of_vm ~__context ~vm) in
 
 		      (* Don't attempt to attach empty VBDs to PV guests: they can't handle them *)
 		      let vbds = 
#31 lore raw

PATCH 1/1 HACK/PoC: adjust for minor differences in upstream Xc bindings

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # 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

ocaml/xenops/domain.ml +11 -7
diff -r 2e6a1485047a -r 13460a457762 ocaml/xenops/domain.ml
@@ -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
ocaml/xenops/domain.mli +1 -1
diff -r 2e6a1485047a -r 13460a457762 ocaml/xenops/domain.mli
@@ -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
#32 lore raw

PATCH 1/1 REBASE-4.1: xenops: update PV console path in xenstore

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290076616 18000
# Node ID 2e6a1485047a2e91c2e90d8ffdbf6c9a9814588c # Parent 810786855fe641b7db0074cfcb2b2a3a4dfd34a0 REBASE-4.1: xenops: update PV console path in xenstore.

This was changed in more recent xenconsoled in order to better support multiple consoles.

ocaml/xenops/device.ml +3 -3
diff -r 810786855fe6 -r 2e6a1485047a ocaml/xenops/device.ml
@@ -845,11 +845,11 @@ module PV_Vnc = struct
 
 let vncterm_wrapper = "/opt/xensource/libexec/vncterm-wrapper"
 
-let vnc_port_path domid = sprintf "/local/domain/%d/serial/0/vnc-port" domid
+let vnc_port_path domid = sprintf "/local/domain/%d/console/vnc-port" domid
 
 let pid ~xs domid =
 	try
-		let pid = xs.Xs.read (sprintf "/local/domain/%d/serial/0/vncterm-pid" domid) in
+		let pid = xs.Xs.read (sprintf "/local/domain/%d/console/vncterm-pid" domid) in
 		Some (int_of_string pid)
 	with _ ->
 		None
@@ -896,7 +896,7 @@ let save ~xs domid =
 let start ?statefile ~xs domid =
 	let l = [ string_of_int domid; (* absorbed by vncterm-wrapper *)
 		  (* everything else goes straight through to vncterm-wrapper: *)
-		  "-x"; sprintf "/local/domain/%d/serial/0" domid;
+		  "-x"; sprintf "/local/domain/%d/console" domid;
 		] @ load_args statefile in
 	(* Now add the close fds wrapper *)
 	let pid = Forkhelpers.safe_close_and_exec None None None [] vncterm_wrapper l in
scripts/vncterm-wrapper +2 -2
diff -r 810786855fe6 -r 2e6a1485047a scripts/vncterm-wrapper
@@ -39,9 +39,9 @@ else
 fi
 
 echo vncterm-wrapper:
-xenstore-write -s /local/domain/$DOMID/serial/0/vncterm-pid $$
+xenstore-write -s /local/domain/$DOMID/console/vncterm-pid $$
 if [ -z "${XIU}" ]; then
 	exec /usr/lib/xen/bin/vncterm $VNCTERM_LISTEN $VNCVIEWER $* > /dev/null 2>&1
 else
-	exec xenstore-write -s /local/domain/$DOMID/serial/0/vnc-port 0
+	exec xenstore-write -s /local/domain/$DOMID/console/vnc-port 0
 fi
#33 lore raw

PATCH 1/1 HACK: xenguest updates for Xen 4.0/4.1

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290076616 18000
# Node ID 1b166fb9629c50be802c5cfc9c2722db80ec8a0e # Parent 13460a457762df182fec2b1f4860d640934f73ad
HACK: xenguest updates for Xen 4.0/4.1

Totally incomplete but enough to start a PV guest.

ocaml/xenguest/save_helpers.c +5 -136
diff -r 13460a457762 -r 1b166fb9629c ocaml/xenguest/save_helpers.c
@@ -22,150 +22,19 @@
  * Modifications (c) Citrix Systems Inc
  */
 
-#include <err.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <grp.h>
 
 #include <xs.h>
 #include <xenctrl.h>
 #include <xenguest.h>
 
-static char *qemu_active_path;
-static char *qemu_next_active_path;
-static int qemu_shmid = -1;
-static struct xs_handle *xs;
-
-
-/* Mark the shared-memory segment for destruction */
-static void qemu_destroy_buffer(void)
-{
-    if (qemu_shmid != -1)
-        shmctl(qemu_shmid, IPC_RMID, NULL);
-    qemu_shmid = -1;
+int switch_qemu_logdirty(int domid, unsigned enable, void *data)
+{	
+	return 1; /* XXX actually do something! */
 }
 
-/* Get qemu to change buffers. */
-void qemu_flip_buffer(int domid, int next_active)
+int do_domain_suspend(void* data)
 {
-    char digit = '0' + next_active;
-    unsigned int len;
-    char *active_str, **watch;
-    struct timeval tv;
-    fd_set fdset;
-    int rc;
-
-    /* Tell qemu that we want it to start writing log-dirty bits to the
-     * other buffer */
-    if (!xs_write(xs, XBT_NULL, qemu_next_active_path, &digit, 1)) {
-        errx(1, "can't write next-active to store path (%s)\n",
-              qemu_next_active_path);
-        exit(1);
-    }
-
-    /* Wait a while for qemu to signal that it has switched to the new
-     * active buffer */
- read_again:
-    tv.tv_sec = 60;
-    tv.tv_usec = 0;
-    FD_ZERO(&fdset);
-    FD_SET(xs_fileno(xs), &fdset);
-    rc = select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv);
-    if (rc == 0)
-        errx(1, "timed out waiting for qemu to switch buffers\n");
-    else if (rc < 0) {
-        if (errno == EINTR) 
-            goto read_again;
-        err(1, "error waiting for qemu to switch buffers");
-    }
-    watch = xs_read_watch(xs, &len);
-    free(watch);
-
-    active_str = xs_read(xs, XBT_NULL, qemu_active_path, &len);
-    if (active_str == NULL || active_str[0] - '0' != next_active)
-        /* Watch fired but value is not yet right */
-        goto read_again;
+	return 1; /* XXX actually do something! */
 }
 
-void * init_qemu_maps(int domid, unsigned int bitmap_size)
-{
-    key_t key;
-    char key_ascii[17] = {0,};
-    void *seg;
-    char *path, *p;
-    struct shmid_ds ds_buf;
-    struct group *gr;
-
-    /* Make a shared-memory segment */
-    do {
-        key = rand(); /* No security, just a sequence of numbers */
-        qemu_shmid = shmget(key, 2 * bitmap_size, 
-                       IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
-        if (qemu_shmid == -1 && errno != EEXIST)
-            errx(1, "can't get shmem to talk to qemu-dm");
-    } while (qemu_shmid == -1);
-
-    /* Remember to tidy up after ourselves */
-    atexit(qemu_destroy_buffer);
-
-    /* Change owner so that qemu can map it. */
-    gr = getgrnam("qemu_base");
-    if (!gr)
-        err(1, "can't get qemu gid");
-    if (shmctl(qemu_shmid, IPC_STAT, &ds_buf) < 0)
-        err(1, "can't get status of shm area");
-    ds_buf.shm_perm.gid = gr->gr_gid + (unsigned short)domid;
-    if (shmctl(qemu_shmid, IPC_SET, &ds_buf) < 0)
-        err(1, "can't change gid of shm area");
-
-    /* Map it into our address space */
-    seg = shmat(qemu_shmid, NULL, 0);
-    if (seg == (void *) -1)
-        errx(1, "can't map shmem to talk to qemu-dm");
-    memset(seg, 0, 2 * bitmap_size);
-
-    /* Write the size of it into the first 32 bits */
-    *(uint32_t *)seg = bitmap_size;
-
-    /* Tell qemu about it */
-    if ((xs = xs_daemon_open()) == NULL)
-        errx(1, "Couldn't contact xenstore");
-    if (!(path = xs_get_domain_path(xs, domid)))
-        errx(1, "can't get domain path in store");
-    if (!(path = realloc(path, strlen(path)
-                         + strlen("/logdirty/next-active") + 1)))
-        errx(1, "no memory for constructing xenstore path");
-    strcat(path, "/logdirty/");
-    p = path + strlen(path);
-
-    strcpy(p, "key");
-    snprintf(key_ascii, 17, "%16.16llx", (unsigned long long) key);
-    if (!xs_write(xs, XBT_NULL, path, key_ascii, 16))
-        errx(1, "can't write key (%s) to store path (%s)\n", key_ascii, path);
-
-    /* Watch for qemu's indication of the active buffer, and request it
-     * to start writing to buffer 0 */
-    strcpy(p, "active");
-    if (!xs_watch(xs, path, "qemu-active-buffer"))
-        errx(1, "can't set watch in store (%s)\n", path);
-    if (!(qemu_active_path = strdup(path)))
-        errx(1, "no memory for copying xenstore path");
-
-    strcpy(p, "next-active");
-    if (!(qemu_next_active_path = strdup(path)))
-        errx(1, "no memory for copying xenstore path");
-
-    qemu_flip_buffer(domid, 0);
-
-    free(path);
-    return seg;
-}
-
-/***********************************************************************/
ocaml/xenguest/xenguest_stubs.c +69 -52

282 lines not on this page · raw message

ocaml/xenops/xenops.ml +2 -2
diff -r 13460a457762 -r 1b166fb9629c ocaml/xenops/xenops.ml
@@ -29,8 +29,8 @@ let print_xen_physinfo ~xc =
 	printf "nr_cpus = %d\n" physinfo.Xc.nr_cpus;
 	printf "threads_per_core = %d\n" physinfo.Xc.threads_per_core;
 	printf "cores_per_socket = %d\n" physinfo.Xc.cores_per_socket;
-	printf "sockets_per_node = %d\n" physinfo.Xc.sockets_per_node;
-	printf "nr_nodes = %d\n" physinfo.Xc.nr_nodes;
+	(*printf "sockets_per_node = %d\n" physinfo.Xc.sockets_per_node;*)
+	(*printf "nr_nodes = %d\n" physinfo.Xc.nr_nodes;*)
 	printf "cpu_khz = %d\n" physinfo.Xc.cpu_khz;
 	printf "total_pages = %s (%Ld Mb)\n" (Nativeint.to_string physinfo.Xc.total_pages) totalmib;
 	printf "free_pages = %s (%Ld Mb)\n" (Nativeint.to_string physinfo.Xc.free_pages) freemib;
#34 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-unstable.hg

In reply to a message not in the archive

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1

This is the xen-unstable.hg portion.

All but the last patch are intended for immediate consideration.

A message that is not in the archive (sent off-list or not yet received): patchbomb.1290077432-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#36 lore raw

PATCH 1/1 libxc: rename safe_strerror to _xc_safestrerror and pass XC handle

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290077186 18000
# Node ID 61797efad6c24b6b63b03ac0a4532671a1a9a40a
# Parent a15b0a2dc276ae8eb8cff4cc58d5563848a39b9b
libxc: rename safe_strerror to _xc_safestrerror and pass XC handle.

tools/libxc/ia64/xc_ia64_linux_save.c +1 -1
diff -r a15b0a2dc276 -r 61797efad6c2 tools/libxc/ia64/xc_ia64_linux_save.c
@@ -660,7 +660,7 @@ xc_domain_save(xc_interface *xch, int io
                        FIXME: to be tracked.  */
                     fprintf(stderr, "cannot map mfn page %lx gpfn %lx: %s\n",
                             xc_ia64_p2m_mfn(&p2m_table, N),
-                            N, safe_strerror(errno));
+                            N, _xc_strerror(xch, errno));
                     goto out;
                 }
 
tools/libxc/xc_private.c +1 -1
diff -r a15b0a2dc276 -r 61797efad6c2 tools/libxc/xc_private.c
@@ -544,7 +544,7 @@ _xc_init_errbuf(void)
     pthread_key_create(&errbuf_pkey, _xc_clean_errbuf);
 }
 
-char *safe_strerror(int errcode)
+char *_xc_strerror(xc_interface *xch, int errcode)
 {
 #define XS_BUFSIZE 32
     char *errbuf;
tools/libxc/xc_private.h +2 -2
diff -r a15b0a2dc276 -r 61797efad6c2 tools/libxc/xc_private.h
@@ -74,7 +74,7 @@ struct xc_interface {
     const char *currently_progress_reporting;
 };
 
-char *safe_strerror(int errcode);
+char *_xc_strerror(xc_interface *xch, int errcode);
 void xc_report_error(xc_interface *xch, int code, const char *fmt, ...);
 void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level,
                 int code, const char *fmt, va_list args)
@@ -96,7 +96,7 @@ void xc_report_progress_step(xc_interfac
 
 #define ERROR(_m, _a...)  xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a )
 #define PERROR(_m, _a...) xc_report_error(xch,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, safe_strerror(errno))
+                  " (%d = %s)", ## _a , errno, _xc_strerror(xch, errno))
 
 /*
  * HYPERCALL ARGUMENT BUFFERS
#37 lore raw

PATCH 1/1 ocaml: resynchronise uuid library with xen-api-libs.hg

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290077186 18000
# Node ID 05cf9251ac48e7abeabdcf3c5a164b276bf393e9 # Parent 11cc3e6d573937508df213c0127c1dbbbd61af30
ocaml: resynchronise uuid library with xen-api-libs.hg

tools/ocaml/libs/uuid/uuid.ml +43 -32
diff -r 11cc3e6d5739 -r 05cf9251ac48 tools/ocaml/libs/uuid/uuid.ml
@@ -1,7 +1,5 @@
 (*
- * Copyright (C) 2006-2007 XenSource Ltd.
- * Copyright (C) 2008      Citrix Ltd.
- * Author Vincent Hanquez <[email protected]>
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published
@@ -14,9 +12,7 @@
  * GNU Lesser General Public License for more details.
  *)
 
-(** Type-safe UUIDs. *)
-
-(** Internally, a UUID is simply a string. *)
+(* Internally, a UUID is simply a string. *)
 type 'a t = string
 
 type cookie = string
@@ -24,6 +20,8 @@ type cookie = string
 let of_string s = s
 let to_string s = s
 
+let null = ""
+
 (* deprecated: we don't need to duplicate the uuid prefix/suffix *)
 let uuid_of_string = of_string
 let string_of_uuid = to_string
@@ -32,12 +30,34 @@ let string_of_cookie s = s
 
 let cookie_of_string s = s
 
-(** FIXME: using /dev/random is too slow but using /dev/urandom is too
-    deterministic. *)
-let dev_random = "/dev/urandom"
+let dev_random = "/dev/random"
+let dev_urandom = "/dev/urandom"
 
-let read_random n = 
-  let ic = open_in_bin dev_random in
+let rnd_array n =
+	let fstbyte i = 0xff land i in
+	let sndbyte i = fstbyte (i lsr 8) in
+	let thdbyte i = sndbyte (i lsr 8) in
+	let rec rnd_list n acc = match n with
+		| 0 -> acc
+		| 1 ->
+			let b = fstbyte (Random.bits ()) in
+			b :: acc
+		| 2 ->
+			let r = Random.bits () in
+			let b1 = fstbyte r in
+			let b2 = sndbyte r in
+			b1 :: b2 :: acc
+		| n -> 
+			let r = Random.bits () in
+			let b1 = fstbyte r in
+			let b2 = sndbyte r in
+			let b3 = thdbyte r in
+			rnd_list (n - 3) (b1 :: b2 :: b3 :: acc)
+	in
+	Array.of_list (rnd_list n [])
+
+let read_array dev n = 
+  let ic = open_in_bin dev in
   try
     let result = Array.init n (fun _ -> input_byte ic) in
     close_in ic;
@@ -52,30 +72,14 @@ let uuid_of_int_array uuid =
     uuid.(6) uuid.(7) uuid.(8) uuid.(9) uuid.(10) uuid.(11)
     uuid.(12) uuid.(13) uuid.(14) uuid.(15)
 
-(** Return a new random UUID *)
-let make_uuid() = uuid_of_int_array (read_random 16)
+let make_uuid_prng () = uuid_of_int_array (rnd_array 16)
+let make_uuid_urnd () = uuid_of_int_array (read_array dev_urandom 16)
+let make_uuid_rnd () = uuid_of_int_array (read_array dev_random 16)
+let make_uuid = make_uuid_urnd
 
-(** Return a new random, big UUID (hopefully big and random enough to be
-    unguessable) *)
 let make_cookie() =
-  let bytes = Array.to_list (read_random 64) in
+  let bytes = Array.to_list (read_array dev_urandom 64) in
   String.concat "" (List.map (Printf.sprintf "%1x") bytes)
-(*
-  let hexencode x = 
-    let nibble x =
-      char_of_int (if x < 10 
-		   then int_of_char '0' + x
-		   else int_of_char 'a' + (x - 10)) in
-    let result = String.make (String.length x * 2) ' ' in
-    for i = 0 to String.length x - 1 do
-      let byte = int_of_char x.[i] in
-      result.[i * 2 + 0] <- nibble((byte lsr 4) land 15);
-      result.[i * 2 + 1] <- nibble((byte lsr 0) land 15);
-    done;
-    result in
-  let n = 64 in
-  hexencode (String.concat "" (List.map (fun x -> String.make 1 (char_of_int x)) (Array.to_list (read_n_random_bytes n))))
-*)
 
 let int_array_of_uuid s =
   try
@@ -86,3 +90,10 @@ let int_array_of_uuid s =
              a10; a11; a12; a13; a14; a15; ]);
     Array.of_list !l
   with _ -> invalid_arg "Uuid.int_array_of_uuid"
+
+let is_uuid str =
+	try
+		Scanf.sscanf str
+			"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
+			(fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> true)
+	with _ -> false
tools/ocaml/libs/uuid/uuid.mli +39 -26

87 lines not on this page · raw message

#38 lore raw

Re: [PATCH 4 of 7] ocaml: resynchronise uuid library with xen-api-libs.hg

Quoted 13 lines · Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290077186 18000
# Node ID 05cf9251ac48e7abeabdcf3c5a164b276bf393e9 # Parent 11cc3e6d573937508df213c0127c1dbbbd61af30
ocaml: resynchronise uuid library with xen-api-libs.hg

diff -r 11cc3e6d5739 -r 05cf9251ac48 tools/ocaml/libs/uuid/uuid.ml

tools/ocaml/libs/uuid/uuid.ml line 3

Quoted 6 lines
tools/ocaml/libs/uuid/uuid.ml +1 -3
@@ -1,7 +1,5 @@
 (*
- * Copyright (C) 2006-2007 XenSource Ltd.
- * Copyright (C) 2008      Citrix Ltd.
- * Author Vincent Hanquez <[email protected]>
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
  *

Hmm, I can understand folding in the redundant copyright claims but what is the deal with assertion of authorship?

Gianni

#39 lore raw

Re: [PATCH 4 of 7] ocaml: resynchronise uuid library with xen-api-libs.hg

Quoted 10 lines · Gianni Tedesco
Quoted 9 lines · Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290077186 18000
# Node ID 05cf9251ac48e7abeabdcf3c5a164b276bf393e9 # Parent 11cc3e6d573937508df213c0127c1dbbbd61af30
ocaml: resynchronise uuid library with xen-api-libs.hg

Quoted 13 lines

tools/ocaml/libs/uuid/uuid.ml line 3

Quoted 10 lines

diff -r 11cc3e6d5739 -r 05cf9251ac48 tools/ocaml/libs/uuid/uuid.ml

tools/ocaml/libs/uuid/uuid.ml +1 -3
@@ -1,7 +1,5 @@
 (*
- * Copyright (C) 2006-2007 XenSource Ltd.
- * Copyright (C) 2008      Citrix Ltd.
- * Author Vincent Hanquez <[email protected]>
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
  *

Hmm, I can understand folding in the redundant copyright claims but what is the deal with assertion of authorship?

I literally did a cp from xen-api-libs.hg. AIUI the two modules have a shared ancestry with the xen-unstable version being imported from a snapshot of xen-api-libs at some point. It looks like the copyright headers were added to both trees independently after (or as part of) the import and so the two versions have diverged.

I'll redo this as a less automated import and retain the authorship statements in xen-unstable.hg -- doing otherwise was unintentional but still impolite, sorry about that Vincent.

Ian.

A message that is not in the archive (sent off-list or not yet received): 1290083222.31507.5290.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#41 lore raw

Re: [Xen-devel] [PATCH 4 of 7] ocaml: resynchronise uuid library with xen-api-libs.hg

Quoted 10 lines · Ian Campbell

I literally did a cp from xen-api-libs.hg. AIUI the two modules have a shared ancestry with the xen-unstable version being imported from a snapshot of xen-api-libs at some point. It looks like the copyright headers were added to both trees independently after (or as part of) the import and so the two versions have diverged.

I'll redo this as a less automated import and retain the authorship statements in xen-unstable.hg -- doing otherwise was unintentional but still impolite, sorry about that Vincent.

no worries no offenses taken, there's multiples versions of the same file, with different headers unfortunately.

authorship is mostly advisory: could be useful to track the author when wondering about a piece of code, or a design decision. Otherwise it's not bound to anything useful legally AFAIK.

Signature · 1 line
Vincent
#42 lore raw

PATCH 1/1 ocaml: xc bindings: use libxenctrl and libxenguest

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290077186 18000
# Node ID 4e6556dc40d36822bddf8ebb55294762e3279f33 # Parent ac5b6ac9ec0d6fafed037d89a9802c542a77b5ce
ocaml: xc bindings: use libxenctrl and libxenguest

Now that tools/libxc is licensed under LGPL I don't think there is any need for an LGPL reimplementation under tools/ocaml.

For the most part the conversion to the up-to-date libxc API (xc_lib.c essentially implemented the same interface as an older libxc) was pretty automatic. There are some functions which appear to no longer exist in libxc which I therefore simply removed the bindings for and a small number of interfaces which had changed.

Many of the functions bound by the stubs have no in-tree users (which I think is fine for a language binding) so I have no way to confirm correctness other than by eye. I was however able to confirm that oxenstored still worked and to build a XCP toolstack which could successfully start a PV guest.

Uses the new XC_OPENFLAG_NON_REENTRANT option to avoid potential conflicts between pthreads and the ocaml runtime.

Cc Vincent Hanquez <[email protected]>
tools/ocaml/Makefile.rules +3 -3
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/Makefile.rules
@@ -54,18 +54,18 @@ mk-caml-lib-bytecode = $(call quiet-comm
 
 mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1)
 mk-caml-lib-stubs = \
-	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
+	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $3 $2,MKLIB,$1)
 
 # define a library target <name>.cmxa and <name>.cma
 define OCAML_LIBRARY_template
  $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
-	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs, $(foreach obj,$($(1)_OBJS),$(obj).cmx))
+	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
  $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo)
 	$(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+)
  $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
 	$(call mk-caml-stubs,$$@, $$+)
  lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
-	$(call mk-caml-lib-stubs,$$@, $$+)
+	$(call mk-caml-lib-stubs,$$@, $$+, $(LIBS_$(1)))
 endef
 
 define OCAML_NOC_LIBRARY_template
tools/ocaml/libs/xc/Makefile +5 -3
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/libs/xc/Makefile
@@ -2,15 +2,17 @@ TOPLEVEL=../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
-CFLAGS += -I../mmap -I./
-OCAMLINCLUDE += -I ../mmap -I ../uuid
+CFLAGS += -I../mmap -I./ -I$(XEN_ROOT)/tools/libxc
+OCAMLINCLUDE += -I ../mmap -I ../uuid -I $(XEN_ROOT)/tools/libxc
 
 OBJS = xc
 INTF = xc.cmi
 LIBS = xc.cma xc.cmxa
 
+LIBS_xc = -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
+
 xc_OBJS = $(OBJS)
-xc_C_OBJS = xc_lib xc_stubs
+xc_C_OBJS = xc_stubs
 
 OCAML_LIBRARY = xc
 
tools/ocaml/libs/xc/xc.h deleted +0 -186

186 lines not on this page · raw message

tools/ocaml/libs/xc/xc.ml +6 -20
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/libs/xc/xc.ml
@@ -127,9 +127,6 @@ external _domain_sethandle: handle -> do
 let domain_sethandle handle n uuid =
 	_domain_sethandle handle n (Uuid.int_array_of_uuid uuid)
 
-external domain_setvmxassist: handle -> domid -> bool -> unit
-       = "stub_xc_domain_setvmxassist"
-
 external domain_max_vcpus: handle -> domid -> int -> unit
        = "stub_xc_domain_max_vcpus"
 
@@ -165,9 +162,9 @@ external domain_iomem_permission: handle
 external domain_irq_permission: handle -> domid -> int -> bool -> unit
        = "stub_xc_domain_irq_permission"
 
-external vcpu_affinity_set: handle -> domid -> int -> int64 -> unit
+external vcpu_affinity_set: handle -> domid -> int -> bool array -> unit
        = "stub_xc_vcpu_setaffinity"
-external vcpu_affinity_get: handle -> domid -> int -> int64
+external vcpu_affinity_get: handle -> domid -> int -> bool array
        = "stub_xc_vcpu_getaffinity"
 
 external vcpu_context_get: handle -> domid -> int -> string
@@ -207,13 +204,13 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
+external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
        = "stub_xc_domain_cpuid_set"
-external domain_cpuid_apply: handle -> domid -> bool -> unit
-       = "stub_xc_domain_cpuid_apply"
-external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
+external domain_cpuid_apply_policy: handle -> domid -> unit
+       = "stub_xc_domain_cpuid_apply_policy"
+external cpuid_check: handle -> (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
 
 external map_foreign_range: handle -> domid -> int
@@ -230,17 +227,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-(** check if some hvm domain got pv driver or not *)
-external hvm_check_pvdriver: handle -> domid -> bool
-       = "stub_xc_hvm_check_pvdriver"
-
 external version: handle -> version = "stub_xc_version_version"
 external version_compile_info: handle -> compile_info
        = "stub_xc_version_compile_info"
tools/ocaml/libs/xc/xc.mli +6 -18
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/libs/xc/xc.mli
@@ -80,8 +80,6 @@ val domain_create : handle -> int32 -> d
 external _domain_sethandle : handle -> domid -> int array -> unit
   = "stub_xc_domain_sethandle"
 val domain_sethandle : handle -> domid -> 'a Uuid.t -> unit
-external domain_setvmxassist: handle -> domid -> bool -> unit
-  = "stub_xc_domain_setvmxassist"
 external domain_max_vcpus : handle -> domid -> int -> unit
   = "stub_xc_domain_max_vcpus"
 external domain_pause : handle -> domid -> unit = "stub_xc_domain_pause"
@@ -104,9 +102,9 @@ external domain_iomem_permission: handle
        = "stub_xc_domain_iomem_permission"
 external domain_irq_permission: handle -> domid -> int -> bool -> unit
        = "stub_xc_domain_irq_permission"
-external vcpu_affinity_set : handle -> domid -> int -> int64 -> unit
+external vcpu_affinity_set : handle -> domid -> int -> bool array -> unit
   = "stub_xc_vcpu_setaffinity"
-external vcpu_affinity_get : handle -> domid -> int -> int64
+external vcpu_affinity_get : handle -> domid -> int -> bool array
   = "stub_xc_vcpu_getaffinity"
 external vcpu_context_get : handle -> domid -> int -> string
   = "stub_xc_vcpu_context_get"
@@ -147,16 +145,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit
-  = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external hvm_check_pvdriver : handle -> domid -> bool
-  = "stub_xc_hvm_check_pvdriver"
 external version : handle -> version = "stub_xc_version_version"
 external version_compile_info : handle -> compile_info
   = "stub_xc_version_compile_info"
@@ -185,12 +173,12 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
+external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
        = "stub_xc_domain_cpuid_set"
-external domain_cpuid_apply: handle -> domid -> bool -> unit
-       = "stub_xc_domain_cpuid_apply"
-external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
+external domain_cpuid_apply_policy: handle -> domid -> unit
+       = "stub_xc_domain_cpuid_apply_policy"
+external cpuid_check: handle -> (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
 
tools/ocaml/libs/xc/xc_cpufeature.h deleted +0 -116

116 lines not on this page · raw message

tools/ocaml/libs/xc/xc_cpuid.h deleted +0 -285

285 lines not on this page · raw message

tools/ocaml/libs/xc/xc_e820.h deleted +0 -20
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/libs/xc/xc_e820.h
@@ -1,20 +0,0 @@
-#ifndef __XC_E820_H__
-#define __XC_E820_H__
-
-#include <xen/hvm/e820.h>
-
-/*
- * PC BIOS standard E820 types and structure.
- */
-#define E820_RAM          1
-#define E820_RESERVED     2
-#define E820_ACPI         3
-#define E820_NVS          4
-
-struct e820entry {
-    uint64_t addr;
-    uint64_t size;
-    uint32_t type;
-} __attribute__((packed));
-
-#endif /* __XC_E820_H__ */
tools/ocaml/libs/xc/xc_lib.c deleted +0 -1537

1,537 lines not on this page · raw message

tools/ocaml/libs/xc/xc_stubs.c +299 -311

710 lines not on this page · raw message

tools/ocaml/xenstored/Makefile +2 -1
diff -r ac5b6ac9ec0d -r 4e6556dc40d3 tools/ocaml/xenstored/Makefile

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#43 lore raw

PATCH 1/1 HACK: Do not install some stuff which conflicts with out-off-tree XCP versions of the same

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
# Date 1290077186 18000
# Node ID 74b174ffed0167d7c1c5fe709176c43770cc9e13
# Parent 4e6556dc40d36822bddf8ebb55294762e3279f33
HACK: Do not install some stuff which conflicts with out-off-tree XCP versions of the same.

blktap issue is resolved by proper XCP packaging of the hypervisor tools rather than my rather ad-hoc approach.

ocaml namespacing issues need some more thought, as mentioned in the overall introductory email.

tools/Makefile +3 -3
diff -r 4e6556dc40d3 -r 74b174ffed01 tools/Makefile
@@ -21,8 +21,8 @@ SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += libaio
 SUBDIRS-$(CONFIG_Linux) += memshr 
-SUBDIRS-$(CONFIG_Linux) += blktap
-SUBDIRS-$(CONFIG_Linux) += blktap2
+#SUBDIRS-$(CONFIG_Linux) += blktap
+#SUBDIRS-$(CONFIG_Linux) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += libaio
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += xenbackendd
@@ -46,7 +46,7 @@ SUBDIRS-$(CONFIG_X86) += debugger/kdd
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 SUBDIRS-$(PYTHON_TOOLS) += python
-SUBDIRS-$(PYTHON_TOOLS) += pygrub
+#SUBDIRS-$(PYTHON_TOOLS) += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 endif
 
tools/blktap2/vhd/lib/Makefile +3 -3
diff -r 4e6556dc40d3 -r 74b174ffed01 tools/blktap2/vhd/lib/Makefile
@@ -63,9 +63,9 @@ libvhd.a: $(LIB-OBJS)
 
 install: all
 	$(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
-	$(INSTALL_DATA) $(LIBVHD) $(DESTDIR)$(INST-DIR)
-	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
-	ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
+	#$(INSTALL_DATA) $(LIBVHD) $(DESTDIR)$(INST-DIR)
+	#ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
+	#ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
 
 clean:
 	rm -rf *.a *.so* *.o *~ $(DEPS) $(LIBVHD)
tools/ocaml/libs/log/Makefile +4 -3
diff -r 4e6556dc40d3 -r 74b174ffed01 tools/ocaml/libs/log/Makefile
@@ -32,9 +32,10 @@ syslog.mli : syslog.ml
 
 .PHONY: install
 install: $(LIBS) META
-	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) log
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
+### XXX need resyncing with xen-api-libs
+#	mkdir -p $(OCAMLDESTDIR)
+#	ocamlfind remove -destdir $(OCAMLDESTDIR) log
+#	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
#44 lore raw

PATCH 1/1 libxc: allow caller to specify no re-entrancy protection when opening the interface

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290077186 18000
# Node ID 3de336d9c113359203885ca6cf6360e5250dfe82
# Parent 61797efad6c24b6b63b03ac0a4532671a1a9a40a
libxc: allow caller to specify no re-entrancy protection when opening the interface

Used by language bindings which provide their own re-entrancy which conflicts with pthreads.

tools/libxc/xc_private.c +28 -20
diff -r 61797efad6c2 -r 3de336d9c113 tools/libxc/xc_private.c
@@ -32,6 +32,7 @@ xc_interface *xc_interface_open(xentooll
                                 unsigned open_flags) {
     xc_interface xch_buf, *xch = &xch_buf;
 
+    xch->flags = open_flags;
     xch->fd = -1;
     xch->dombuild_logger_file = 0;
     xc_clear_last_error(xch);
@@ -546,30 +547,37 @@ _xc_init_errbuf(void)
 
 char *_xc_strerror(xc_interface *xch, int errcode)
 {
+    if ( xch->flags & XC_OPENFLAG_NON_REENTRANT )
+    {
+        return strerror(errcode);
+    }
+    else
+    {
 #define XS_BUFSIZE 32
-    char *errbuf;
-    static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-    char *strerror_str;
+        char *errbuf;
+        static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+        char *strerror_str;
 
-    pthread_once(&errbuf_pkey_once, _xc_init_errbuf);
+        pthread_once(&errbuf_pkey_once, _xc_init_errbuf);
 
-    errbuf = pthread_getspecific(errbuf_pkey);
-    if (errbuf == NULL) {
-        errbuf = malloc(XS_BUFSIZE);
-        pthread_setspecific(errbuf_pkey, errbuf);
+        errbuf = pthread_getspecific(errbuf_pkey);
+        if (errbuf == NULL) {
+            errbuf = malloc(XS_BUFSIZE);
+            pthread_setspecific(errbuf_pkey, errbuf);
+        }
+
+        /*
+         * Thread-unsafe strerror() is protected by a local mutex. We copy the
+         * string to a thread-private buffer before releasing the mutex.
+         */
+        pthread_mutex_lock(&mutex);
+        strerror_str = strerror(errcode);
+        strncpy(errbuf, strerror_str, XS_BUFSIZE);
+        errbuf[XS_BUFSIZE-1] = '\0';
+        pthread_mutex_unlock(&mutex);
+
+        return errbuf;
     }
-
-    /*
-     * Thread-unsafe strerror() is protected by a local mutex. We copy
-     * the string to a thread-private buffer before releasing the mutex.
-     */
-    pthread_mutex_lock(&mutex);
-    strerror_str = strerror(errcode);
-    strncpy(errbuf, strerror_str, XS_BUFSIZE);
-    errbuf[XS_BUFSIZE-1] = '\0';
-    pthread_mutex_unlock(&mutex);
-
-    return errbuf;
 }
 
 void bitmap_64_to_byte(uint8_t *bp, const uint64_t *lp, int nbits)
tools/libxc/xc_private.h +1 -0
diff -r 61797efad6c2 -r 3de336d9c113 tools/libxc/xc_private.h
@@ -67,6 +67,7 @@
 
 struct xc_interface {
     int fd;
+    int flags;
     xentoollog_logger *error_handler,   *error_handler_tofree;
     xentoollog_logger *dombuild_logger, *dombuild_logger_tofree;
     struct xc_error last_error; /* for xc_get_last_error */
tools/libxc/xenctrl.h +10 -1
diff -r 61797efad6c2 -r 3de336d9c113 tools/libxc/xenctrl.h
@@ -132,8 +132,17 @@ xc_interface *xc_interface_open(xentooll
    * if dombuild_logger=NULL, will log to a file
    */
 
+/*
+ * Note: if XC_OPENFLAG_NON_REENTRANT is passed then libxc must not be
+ * called reentrantly and the calling application is responsible for
+ * providing mutual exclusion surrounding all libxc calls itself.
+ *
+ * In particular xc_{get,clear}_last_error only remain valid for the
+ * duration of the critical section containing the call which failed.
+ */
 enum xc_open_flags {
-    XC_OPENFLAG_DUMMY =  01, /* do not actually open a xenctrl interface */
+    XC_OPENFLAG_DUMMY =  1<<0, /* do not actually open a xenctrl interface */
+    XC_OPENFLAG_NON_REENTRANT = 1<<1, /* assume library is only every called from a single thread */
 };
 
 /**
#45 lore raw

PATCH 1/1 ocaml: install built modules

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290077186 18000
# Node ID 11cc3e6d573937508df213c0127c1dbbbd61af30 # Parent 3de336d9c113359203885ca6cf6360e5250dfe82
ocaml: install built modules

Previously the install target was having no effect because it ended up calling the default target in the subdir Makefile instead of the install target.

Resolve this by tying the tools/ocaml Makefiles into the generic handling done by tools/Rules.mk.

Other changes arising in one way or another from this:
- Add libs/xl/META.in
- Update .hgignore for META files
- Create leading directories
- Remove existing module before installation in install targer (worksaround what appears to be a quirk of "ocamlfind install")
- Use the globally defined $(DESTDIR)
- Move "ocamlfind printfconf destdir" to a common variable, repurposing exising unused OCAMLDESTDIR, incorporating $(DESTDIR) at the same time.
- Drop a few unused variable definitions (mainly to avoid deciding if $(DESTDIR) made sense for them or not.
- Pass -destdir to ocamlfind in uninstall target for symmetry with install target.

.hgignore +1 -0
diff -r 3de336d9c113 -r 11cc3e6d5739 .hgignore
@@ -292,6 +292,7 @@
 ^tools/ioemu-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
+^tools/ocaml/.*/META$
 ^tools/ocaml/.*/\.ocamldep\.make$
 ^tools/ocaml/xenstored/oxenstored$
 ^xen/\.banner.*$
tools/ocaml/Makefile +5 -29
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/Makefile
@@ -1,43 +1,19 @@
 XEN_ROOT = ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_LIBS = \
-	libs/uuid libs/mmap \
-	libs/log libs/xc libs/eventchn \
-	libs/xb libs/xs libs/xl
-
 SUBDIRS_PROGRAMS = xenstored
 
-SUBDIRS = $(SUBDIRS_LIBS) $(SUBDIRS_PROGRAMS)
+SUBDIRS = libs $(SUBDIRS_PROGRAMS)
 
 .NOTPARALLEL:
 # targets here must be run in order, otherwise we can try
 # to build programs before the libraries are done
 
 .PHONY: all
-all: build
+all: subdirs-all
 
-.PHONY: build
-build: SUBDIRS
-
-.PHONY: SUBDIRS SUBDIRS_PROGRAMS SUBDIRS_LIBS
-SUBDIRS SUBDIRS_PROGRAMS SUBDIRS_LIBS:
-	@set -e; for d in $($@); do			\
-		echo " === building $$d";		\
-		$(MAKE) --no-print-directory -C $$d;	\
-	done
-
-.PHONY: install install-libs install-program
-install: install-libs install-program
-
-install-program: SUBDIRS_PROGRAMS
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) xenstored/oxenstored $(DESTDIR)$(SBINDIR)
-
-install-libs: SUBDIRS_LIBS
+.PHONY: install
+install: subdirs-install
 
 .PHONY: clean
-clean:
-	@for dir in $(SUBDIRS); do \
-		$(MAKE) --no-print-directory -C $$dir clean; \
-	done
+clean: subdirs-clean
tools/ocaml/common.make +1 -6
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/common.make
@@ -17,13 +17,8 @@ OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
 OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 
-#LDFLAGS = -cclib -L./
-
-DESTDIR ?= /
 VERSION := 4.1
 
-OCAMLABI = $(shell $(OCAMLC) -version)
-OCAMLLIBDIR = $(shell $(OCAMLC) -where)
-OCAMLDESTDIR ?= $(OCAMLLIBDIR)
+OCAMLDESTDIR ?= $(DESTDIR)$(shell ocamlfind printconf destdir)
 
 o= >[email protected] && mv -f [email protected] $@
tools/ocaml/libs/Makefile new file +16 -0
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/Makefile
@@ -0,0 +1,16 @@
+XEN_ROOT = ../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS= \
+	uuid mmap \
+	log xc eventchn \
+	xb xs xl
+
+.PHONY: all
+all: subdirs-all
+
+.PHONY: install
+install: subdirs-install
+
+.PHONY: clean
+clean: subdirs-clean
tools/ocaml/libs/eventchn/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/eventchn/Makefile
@@ -19,11 +19,13 @@ OCAML_LIBRARY = eventchn
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) eventchn
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove eventchn
+	ocamlfind remove -destdir $(OCAMLDESTDIR) eventchn
 
 include $(TOPLEVEL)/Makefile.rules
 
tools/ocaml/libs/log/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/log/Makefile
@@ -32,11 +32,13 @@ syslog.mli : syslog.ml
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) log
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove log
+	ocamlfind remove -destdir $(OCAMLDESTDIR) log
 
 include $(TOPLEVEL)/Makefile.rules
 
tools/ocaml/libs/mmap/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/mmap/Makefile
@@ -18,11 +18,13 @@ OCAML_LIBRARY = mmap
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) mmap
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove mmap
+	ocamlfind remove -destdir $(OCAMLDESTDIR) mmap
 
 include $(TOPLEVEL)/Makefile.rules
 
tools/ocaml/libs/uuid/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/uuid/Makefile
@@ -17,11 +17,13 @@ OCAML_NOC_LIBRARY = uuid
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) uuid
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove uuid
+	ocamlfind remove -destdir $(OCAMLDESTDIR) uuid
 
 include $(TOPLEVEL)/Makefile.rules
 
tools/ocaml/libs/xb/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/xb/Makefile
@@ -33,10 +33,12 @@ OCAML_LIBRARY = xb
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xb
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove xb
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xb
 
 include $(TOPLEVEL)/Makefile.rules
tools/ocaml/libs/xc/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/xc/Makefile
@@ -20,10 +20,12 @@ libs: $(LIBS)
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xc
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove xc
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xc
 
 include $(TOPLEVEL)/Makefile.rules
tools/ocaml/libs/xl/META.in new file +4 -0
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/xl/META.in
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Toolstack Library"
+archive(byte) = "xl.cma"
+archive(native) = "xl.cmxa"
tools/ocaml/libs/xl/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/xl/Makefile
@@ -17,10 +17,12 @@ libs: $(LIBS)
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xl META $(INTF) $(LIBS) *.a *.so *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xl
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xl META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove xl
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xl
 
 include $(TOPLEVEL)/Makefile.rules
tools/ocaml/libs/xs/Makefile +4 -2
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/libs/xs/Makefile
@@ -33,11 +33,13 @@ OCAML_NOC_LIBRARY = xs
 
 .PHONY: install
 install: $(LIBS) META
-	ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xs META $(INTF) xs.mli xst.mli xsraw.mli $(LIBS) *.a *.cmx
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xs
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xs META $(INTF) xs.mli xst.mli xsraw.mli $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove xs
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xs
 
 include $(TOPLEVEL)/Makefile.rules
 
tools/ocaml/xenstored/Makefile +4 -0
diff -r 3de336d9c113 -r 11cc3e6d5739 tools/ocaml/xenstored/Makefile
@@ -52,4 +52,8 @@ all: $(INTF) $(PROGRAMS)
 
 bins: $(PROGRAMS)
 
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
+	$(INSTALL_PROG) oxenstored $(DESTDIR)$(SBINDIR)
+
 include $(OCAML_TOPLEVEL)/Makefile.rules
#46 lore raw

PATCH 1/1 ocaml: add dependency to module metadata

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290077186 18000
# Node ID ac5b6ac9ec0d6fafed037d89a9802c542a77b5ce # Parent 05cf9251ac48e7abeabdcf3c5a164b276bf393e9
ocaml: add dependency to module metadata.

tools/ocaml/libs/eventchn/META.in +1 -0
diff -r 05cf9251ac48 -r ac5b6ac9ec0d tools/ocaml/libs/eventchn/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Eventchn interface extension"
+requires = "unix"
 archive(byte) = "eventchn.cma"
 archive(native) = "eventchn.cmxa"
tools/ocaml/libs/log/META.in +1 -0
diff -r 05cf9251ac48 -r ac5b6ac9ec0d tools/ocaml/libs/log/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Log - logging library"
+requires = "unix"
 archive(byte) = "log.cma"
 archive(native) = "log.cmxa"
tools/ocaml/libs/xb/META.in +1 -0
diff -r 05cf9251ac48 -r ac5b6ac9ec0d tools/ocaml/libs/xb/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "XenBus Interface"
+requires = "unix,mmap"
 archive(byte) = "xb.cma"
 archive(native) = "xb.cmxa"
tools/ocaml/libs/xc/META.in +1 -0
diff -r 05cf9251ac48 -r ac5b6ac9ec0d tools/ocaml/libs/xc/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Xen Control Interface"
+requires = "mmap,uuid"
 archive(byte) = "xc.cma"
 archive(native) = "xc.cmxa"
tools/ocaml/libs/xs/META.in +1 -0
diff -r 05cf9251ac48 -r ac5b6ac9ec0d tools/ocaml/libs/xs/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "XenStore Interface"
+requires = "unix,xb"
 archive(byte) = "xs.cma"
 archive(native) = "xs.cmxa"
#47 lore raw
In reply to a message not in the archive

A second version of each of these patch queues will follow shortly.

The major change is to make use of the proposed hooks in upstream libxenctrl to reenable the XIU functionality. This allows xenstored and xapi to run in an SDK VM. This depends on my "libxc: dom0 OS integration cleanup+abstraction." series against xen-unstable.hg sent to xen-devel last week.

I've not had any feedback on the module namespace issue so I haven't done anything about that.

Ian.

Quoted 54 lines · Ian Campbell

The following series against xen-api-libs.hg, xen-api.hg and xen-unstable.hg (to be posted as replies to this mail shortly) lays some groundwork to allow XCP to be used against xen-unstable (and therefore eventually the 4.1 release).

I have very much glossed over (i.e. hacked up the bare minimum of) the actual toolstack port to xen-unstable, since my primary aim was simply to do the groundwork to allow the use of the in-tree bindings in order to ensure that Xen 4.1.0 is released with something with a baseline level of usefulness to XCP. However I did do enough to allow installation and starting of a PV guest and a successful "quicktest -all" run (100% pass, FWIW).

I have arranged that the xen-api-libs.hg and xen-api.hg patches which can be applied now without compromising the existing Xen 3.4 based XCP platform are at the head of the relevant series and that the stuff which depends on the transition to Xen 4.1 comes afterwards and have the REBASE-4.1 prefix (followed by my hacks and other bits and pieces, marked with HACK, they are just for reference and should be applied to /dev/null only). The intention is that the xen-unstable bits can be applied before Xen 4.1 in order that the infrastructure is in place when XCP comes to rebase.

For my testing I have been using the build-xapi-toolstack.sh script from
http://xenbits.xen.org/xapi/install.html so in actual fact some of the patches right at the start of the xen-api-libs.hg and xen-api.hg series as well as the entire xen-dist-ocaml.hg series are actually fixes for issues I encountered when using that script and doing RPM builds outside /usr/src hopefully it is obvious what is what.

While doing this work I started to wonder if using the xb, xs, xc, xl etc names at the toplevel of the ocaml module namespace was wise/polite? I'm not sure what support ocaml has for module namepacing but perhaps we should move the in-tree bindings to e.g. xen.lowlevel.{xb,xs,xc,xl} (to arbitrarily pick up the convention used in the python bindings)?

I also wonder about maintaining non-Xen specific support libraries (such as uuid, log and mmap) in the xen source tree. Perhaps these could be pushed further down into the ocaml ecosystem and become prerequisites of Xen? (assuming there is nothing similar already in the wider ocaml world). Some of the modules have grown slightly different interfaces in xen-api-libs.hg vs xen-unstable.hg, in some cases (e.g. uuid module) resynchronising is simple, in others (e.g. log module) it is not so trivial. This would be partially solved by namespacing the two sets of modules I guess but that seems non-optimal in terms of number of module to maintain.

Ian.

_______________________________________________
Xen-devel mailing list [email protected]
http://lists.xensource.com/xen-devel

A message that is not in the archive (sent off-list or not yet received): 1291732233.13966.3198.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#49 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-dist-ocaml.hg

The following short series of patches makes xen-dist-ocaml.hg easier to use from build-xapi-toolstack.sh.

A message that is not in the archive (sent off-list or not yet received): patchbomb.1291732364-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#51 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004675 18000
# Node ID 01cface0904c7c5d18703ad3f11909ab2f50471c # Parent c8f620542215cbb770e5f56e62eb43559e4a52d8 Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir	/data/rpmbuild
%_tmppath	/data/tmp
Makefile +4 -4
diff -r c8f620542215 -r 01cface0904c Makefile
@@ -8,10 +8,10 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_RPMSDIR?=/usr/src/redhat/RPMS
-RPM_SOURCESDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_RPMSDIR?=$(shell rpm --eval='%_rpmdir')
+RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
 RPMBUILD?=rpmbuild
 
 DIST?=/data
#52 lore raw

PATCH 1/1 Install additional packages

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290004675 18000
# Node ID 56f040418b89013cc5773c8a4da3644a59e91a6a # Parent cf457090b419139cf5a67382e4ce8a44f03c4539 Install additional packages

These were built but not installed but were used by something down the build chain.

Makefile +4 -0
diff -r cf457090b419 -r 56f040418b89 Makefile
@@ -46,6 +46,10 @@ build: srpm $(MY_SOURCES)/MANIFEST
 	$(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb $(RPM_SPECSDIR)/omake.spec
 	$(RPM) -ihv $(RPM_BINDIR)/omake* || echo omake is already installed
 	$(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb $(RPM_SPECSDIR)/xmlm.spec $(RPM_SPECSDIR)/getopt.spec $(RPM_SPECSDIR)/type-conv.spec
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-xmlm*.rpm || echo ocaml-xmlm is already installed
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-getopt*.rpm || echo ocaml-getopt is already installed
+	$(RPM) -ivh $(RPM_BINDIR)/ocaml-type-conv*.rpm || echo ocaml-type-conv is already installed
+
 
 .PHONY: srpm
 srpm:
#53 lore raw

PATCH 1/1 Define $(RPM) for use in Makefile

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290004675 18000
# Node ID cf457090b419139cf5a67382e4ce8a44f03c4539 # Parent 01cface0904c7c5d18703ad3f11909ab2f50471c Define $(RPM) for use in Makefile

Makefile +1 -0
diff -r 01cface0904c -r cf457090b419 Makefile
@@ -8,6 +8,7 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
+RPM?=rpm
 RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
 RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
 RPM_RPMSDIR?=$(shell rpm --eval='%_rpmdir')
#54 lore raw

RE: [Xen-API] [PATCH 0 of 3] XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-dist-ocaml.hg

In reply to Ian Campbell
Quoted 3 lines

The following short series of patches makes xen-dist-ocaml.hg easier to use
from build-xapi-toolstack.sh.

Thanks for these. I'll push them upstream once we've completed our hg to git conversion (hopefully imminent)...

Cheers,
Dave

#55 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-api-libs.hg

In reply to a message not in the archive

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1.

This is the xen-api-libs.hg portion.

Only the first three patches are for immediate consideration, the others all depend on actually moving to Xen 4.1.

#56 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User [email protected]
# Date 1291731529 18000
# Node ID b4ef59ed08a9a4c1387fd00cd79aec3398bca3f5 # Parent 3be1829b46b70a8ae4b2013fc20b71a76f3b55ee Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir        /data/rpmbuild
%_tmppath       /data/tmp
Makefile.in +2 -2
diff -r 3be1829b46b7 -r b4ef59ed08a9 Makefile.in
@@ -211,8 +211,8 @@ cleanxen:
 	$(MAKE) -C xsrpc clean
 	$(MAKE) -C eventchn clean
 
-RPM_SPECSDIR=/usr/src/redhat/SPECS
-RPM_SOURCEDIR=/usr/src/redhat/SOURCES
+RPM_SPECSDIR=$(shell rpm --eval='%_specdir')
+RPM_SOURCEDIR=$(shell rpm --eval='%_sourcedir')
 XEN_RELEASE=xcp0.2
 
 $(RPM_SPECSDIR)/xapi-libs.spec: xapi.spec.in
Makefile.xcp +3 -3
diff -r 3be1829b46b7 -r b4ef59ed08a9 Makefile.xcp
@@ -6,9 +6,9 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_SOURCEDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_SOURCEDIR?=$(shell rpm --eval='%_sourcedir')
 XEN_RELEASE?=unknown
 endif

A message that is not in the archive (sent off-list or not yet received): patchbomb.1291732379-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#58 lore raw

PATCH 1/1 xc: split xc non-upstream bindings into xcext module

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291731529 18000
# Node ID cc5f6f7e18cf39cf8ed9112c52aebb9c1317f8f9 # Parent b4ef59ed08a9a4c1387fd00cd79aec3398bca3f5
xc: split xc non-upstream bindings into xcext module.

move anything which is not provided by upstream libxc and the associated ocaml bindings in a separate xcext library to ease replacement of xc library by upstream version.

Some of this functionality could potentially be upstreamed straight away but other bits rely on stuff from the XCP hypervisor patch queue.

One change of not is that Xcext.hvm_check_pvdriver expects that domid is always an HVM domain. This matches the existing callsites (and the name) and reduces cross talk between xc and xcext.

Makefile.in +5 -0
diff -r b4ef59ed08a9 -r cc5f6f7e18cf Makefile.in
@@ -41,6 +41,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xc
 	$(MAKE) -C xb
 	$(MAKE) -C xs
+	$(MAKE) -C xcext
 	$(MAKE) -C xsrpc
 	$(MAKE) -C eventchn
 	$(MAKE) -C cpuid
@@ -81,6 +82,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xc install
 	$(MAKE) -C xb install
 	$(MAKE) -C xs install
+	$(MAKE) -C xcext install
 	$(MAKE) -C xsrpc install
 	$(MAKE) -C eventchn install
 	$(MAKE) -C cpuid install
@@ -122,6 +124,7 @@ ifeq ($(HAVE_XEN),1)
 	$(MAKE) -C xs uninstall
 	$(MAKE) -C xb uninstall
 	$(MAKE) -C xc uninstall
+	$(MAKE) -C xcext uninstall
 	$(MAKE) -C mmap uninstall
 	$(MAKE) -C cpuid uninstall
 	$(MAKE) -C vhd uninstall
@@ -160,6 +163,7 @@ doc:
 	$(MAKE) -C xb doc
 	$(MAKE) -C xc doc
 	$(MAKE) -C xs doc
+	$(MAKE) -C xcext doc
 	$(MAKE) -C xml-light2 doc
 	$(MAKE) -C rpc-light doc
 	$(MAKE) -C http-svr doc
@@ -208,6 +212,7 @@ cleanxen:
 	$(MAKE) -C xc clean
 	$(MAKE) -C xb clean
 	$(MAKE) -C xs clean
+	$(MAKE) -C xcext clean
 	$(MAKE) -C xsrpc clean
 	$(MAKE) -C eventchn clean
 
cpuid/META.in +1 -1
diff -r b4ef59ed08a9 -r cc5f6f7e18cf cpuid/META.in
@@ -1,5 +1,5 @@
 version = "@VERSION@"
 description = "Cpuid extension"
-requires = "stdext xc xen-utils"
+requires = "stdext xc xcext xen-utils"
 archive(byte) = "cpuid.cma"
 archive(native) = "cpuid.cmxa"
cpuid/Makefile +2 -2
diff -r b4ef59ed08a9 -r cc5f6f7e18cf cpuid/Makefile
@@ -2,7 +2,7 @@ CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
 OCAMLOPT = ocamlopt
-INCLUDES = -I ../stdext -I ../xc -I ../xen-utils
+INCLUDES = -I ../stdext -I ../xc -I ../xcext -I ../xen-utils
 
 LDFLAGS = -cclib -L./
 
@@ -65,7 +65,7 @@ uninstall:
 
 .PHONY: doc
 doc: $(INTF)
-	python ../doc/doc.py $(DOCDIR) "cpuid" "package" "$(OBJS)" "." "stdext xc xen-utils" ""
+	python ../doc/doc.py $(DOCDIR) "cpuid" "package" "$(OBJS)" "." "stdext xc xcext xen-utils" ""
 	
 clean:
 	rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) *~ *.rej
cpuid/cpuid.ml +1 -1
diff -r b4ef59ed08a9 -r cc5f6f7e18cf cpuid/cpuid.ml
@@ -138,7 +138,7 @@ let is_maskable manufacturer family mode
 
 let get_features_from_xen () =
 	let features = 
-	  try Xc.with_intf (fun xc -> Xc.get_boot_cpufeatures xc) 
+	  try Xc.with_intf (fun xc -> Xcext.get_boot_cpufeatures xc) 
 	  with _ -> 0l, 0l, 0l, 0l, 0l, 0l, 0l, 0l 
 	in
 	match features with
xapi-libs.spec +8 -0
diff -r b4ef59ed08a9 -r cc5f6f7e18cf xapi-libs.spec
@@ -341,6 +341,14 @@ rm -rf $RPM_BUILD_ROOT
    /usr/lib/ocaml/xc/xc.cmi
    /usr/lib/ocaml/xc/xc.cmx
    /usr/lib/ocaml/xc/xc.cmxa
+   /usr/lib/ocaml/xcext/META
+   /usr/lib/ocaml/xcext/dllxcext_stubs.so
+   /usr/lib/ocaml/xcext/libxcext_stubs.a
+   /usr/lib/ocaml/xcext/xcext.a
+   /usr/lib/ocaml/xcext/xcext.cma
+   /usr/lib/ocaml/xcext/xcext.cmi
+   /usr/lib/ocaml/xcext/xcext.cmx
+   /usr/lib/ocaml/xcext/xcext.cmxa
    /usr/lib/ocaml/xs/META
    /usr/lib/ocaml/xs/queueop.cmx
    /usr/lib/ocaml/xs/xs.a
xc/xc.h +0 -27
diff -r b4ef59ed08a9 -r cc5f6f7e18cf xc/xc.h
@@ -31,20 +31,9 @@
 #include <xen/hvm/params.h>
 #include "xc_e820.h"
 
-#ifndef XEN_DOMCTL_get_runstate_info
-#warning "runstate info is missing"
-typedef struct {
-	int32_t state;
-	uint32_t missed_changes;
-	uint64_t state_entry_time;
-	uint64_t time[6];
-} xen_domctl_runstate_info_t;
-#endif
-
 typedef xen_domctl_getdomaininfo_t xc_domaininfo_t;
 typedef xen_domctl_getvcpuinfo_t xc_vcpuinfo_t;
 typedef xen_sysctl_physinfo_t xc_physinfo_t;
-typedef xen_domctl_runstate_info_t xc_runstate_info_t;
 
 struct xc_core_header {
 	unsigned int xch_magic;
@@ -111,14 +100,11 @@ int xc_domain_memory_populate_physmap(in
                                       unsigned int extent_order,
                                       unsigned int address_bits,
                                       xen_pfn_t *extent_start);
-int xc_domain_setvmxassist(int handle, unsigned int domid, int use_vmxassist);
 int xc_domain_max_vcpus(int handle, unsigned int domid, unsigned int max);
 int xc_domain_sethandle(int handle, unsigned int domid,
                         xen_domain_handle_t dhandle);
 int xc_vcpu_getinfo(int handle, unsigned int domid, unsigned int vcpu,
                     xc_vcpuinfo_t *info);
-int xc_get_runstate_info(int handle, unsigned int domid,
-			 xc_runstate_info_t *info);
 int xc_domain_ioport_permission(int handle, unsigned int domid,
                                 unsigned int first_port, unsigned int nr_ports,
                                 unsigned int allow_access);
@@ -158,7 +144,6 @@ int xc_shadow_allocation_set(int handle,
 			     uint32_t mb);
 int xc_domain_get_pfn_list(int handle, unsigned int domid,
                            xen_pfn_t *pfn_array, unsigned long max_pfns);
-int xc_hvm_check_pvdriver(int handle, unsigned int domid);
 
 int xc_domain_assign_device(int handle, unsigned int domid,
                             int domain, int bus, int slot, int func);
@@ -177,18 +162,6 @@ int xc_domain_cpuid_set(int xc, unsigned
 int xc_domain_cpuid_apply(int xc, unsigned int domid, int hvm);
 int xc_cpuid_check(uint32_t input, uint32_t optsubinput,
                    char *config[4], char *config_out[4]);
-int xc_domain_suppress_spurious_page_faults(int xc, uint32_t domid);
-
-int xc_domain_send_s3resume(int handle, unsigned int domid);
-int xc_domain_set_vpt_align(int handle, unsigned int domid, int vpt_align);
-int xc_domain_set_hpet(int handle, unsigned int domid, int hpet);
-int xc_domain_set_timer_mode(int handle, unsigned int domid, int mode);
-int xc_domain_get_acpi_s_state(int handle, unsigned int domid);
-int xc_domain_trigger_power(int handle, unsigned int domid);
-int xc_domain_trigger_sleep(int handle, unsigned int domid);
-
-int xc_get_boot_cpufeatures(int handle, uint32_t *, uint32_t *, uint32_t *,
-	uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 #if XEN_SYSCTL_INTERFACE_VERSION >= 6
 #define SAFEDIV(a, b)					(((b) >= 0) ? (a) / (b) : (a))
xc/xc.ml +0 -37
diff -r b4ef59ed08a9 -r cc5f6f7e18cf xc/xc.ml
@@ -26,18 +26,6 @@ type vcpuinfo =
 	cpumap: int32;
 }
 
-type runstateinfo = {
-  state : int32;
-  missed_changes: int32;
-  state_entry_time : int64;
-  time0 : int64;
-  time1 : int64;
-  time2 : int64;
-  time3 : int64;
-  time4 : int64;
-  time5 : int64;
-}
-
 type domaininfo =
 {
 	domid             : domid;
@@ -138,9 +126,6 @@ external _domain_sethandle: handle -> do
 let domain_sethandle handle n uuid =
 	_domain_sethandle handle n (Uuid.int_array_of_uuid uuid)
 
-external domain_setvmxassist: handle -> domid -> bool -> unit
-       = "stub_xc_domain_setvmxassist"
-
 external domain_max_vcpus: handle -> domid -> int -> unit
        = "stub_xc_domain_max_vcpus"
 
@@ -168,8 +153,6 @@ external domain_getinfo: handle -> domid
 
 external domain_get_vcpuinfo: handle -> int -> int -> vcpuinfo
        = "stub_xc_vcpu_getinfo"
-external domain_get_runstate_info : handle -> int -> runstateinfo
-  = "stub_xc_get_runstate_info"
 
 external domain_ioport_permission: handle -> domid -> int -> int -> bool -> unit
        = "stub_xc_domain_ioport_permission"
@@ -243,23 +226,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_suppress_spurious_page_faults: handle -> domid -> unit
-       = "stub_xc_domain_suppress_spurious_page_faults"
-
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external domain_trigger_power: handle -> domid -> unit = "stub_xc_domain_trigger_power"
-external domain_trigger_sleep: handle -> domid -> unit = "stub_xc_domain_trigger_sleep"
-
-(** check if some hvm domain got pv driver or not *)
-external hvm_check_pvdriver: handle -> domid -> bool
-       = "stub_xc_hvm_check_pvdriver"
-
 external version: handle -> version = "stub_xc_version_version"
 external version_compile_info: handle -> compile_info
        = "stub_xc_version_compile_info"
@@ -270,9 +236,6 @@ external version_capabilities: handle ->
 external watchdog : handle -> int -> int32 -> int
   = "stub_xc_watchdog"
 
-external get_boot_cpufeatures: handle ->
-	(int32 * int32 * int32 * int32 * int32 * int32 * int32 * int32) = "stub_xc_get_boot_cpufeatures"
-
 (* core dump structure *)
 type core_magic = Magic_hvm | Magic_pv
 
xc/xc.mli +0 -37
diff -r b4ef59ed08a9 -r cc5f6f7e18cf xc/xc.mli
@@ -19,17 +19,6 @@ type vcpuinfo = {
   cputime : int64;
   cpumap : int32;
 }
-type runstateinfo = {
-  state : int32;
-  missed_changes: int32;
-  state_entry_time : int64;
-  time0 : int64;
-  time1 : int64;
-  time2 : int64;
-  time3 : int64;
-  time4 : int64;
-  time5 : int64;
-}
 type domaininfo = {
   domid : domid;
   dying : bool;
@@ -89,8 +78,6 @@ val domain_create : handle -> int32 -> d
 external _domain_sethandle : handle -> domid -> int array -> unit
   = "stub_xc_domain_sethandle"
 val domain_sethandle : handle -> domid -> 'a Uuid.t -> unit
-external domain_setvmxassist: handle -> domid -> bool -> unit
-  = "stub_xc_domain_setvmxassist"
 external domain_max_vcpus : handle -> domid -> int -> unit
   = "stub_xc_domain_max_vcpus"
 external domain_pause : handle -> domid -> unit = "stub_xc_domain_pause"
@@ -107,8 +94,6 @@ external domain_getinfo : handle -> domi
   = "stub_xc_domain_getinfo"
 external domain_get_vcpuinfo : handle -> int -> int -> vcpuinfo
   = "stub_xc_vcpu_getinfo"
-external domain_get_runstate_info : handle -> int -> runstateinfo
-  = "stub_xc_get_runstate_info"
 external domain_ioport_permission: handle -> domid -> int -> int -> bool -> unit
        = "stub_xc_domain_ioport_permission"
 external domain_iomem_permission: handle -> domid -> nativeint -> nativeint -> bool -> unit
@@ -158,21 +143,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit
-  = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external domain_trigger_power: handle -> domid -> unit
-  = "stub_xc_domain_trigger_power"
-external domain_trigger_sleep: handle -> domid -> unit
-  = "stub_xc_domain_trigger_sleep"
-
-external hvm_check_pvdriver : handle -> domid -> bool
-  = "stub_xc_hvm_check_pvdriver"
 external version : handle -> version = "stub_xc_version_version"
 external version_compile_info : handle -> compile_info
   = "stub_xc_version_compile_info"
@@ -201,9 +171,6 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_suppress_spurious_page_faults: handle -> domid -> unit
-       = "stub_xc_domain_suppress_spurious_page_faults"
-
 external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
@@ -212,7 +179,3 @@ external domain_cpuid_apply: handle -> d
        = "stub_xc_domain_cpuid_apply"
 external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
-
-external get_boot_cpufeatures: handle ->
-	(int32 * int32 * int32 * int32 * int32 * int32 * int32 * int32) = "stub_xc_get_boot_cpufeatures"
-
xc/xc_lib.c +0 -190

220 lines not on this page · raw message

xc/xc_stubs.c +0 -164

194 lines not on this page · raw message

xcext/META.in new file +5 -0
diff -r b4ef59ed08a9 -r cc5f6f7e18cf xcext/META.in
@@ -0,0 +1,5 @@
+version = "@VERSION@"
+description = "Xen Control Interface (extensions)"
+requires = "mmap,uuid,xc"
+archive(byte) = "xcext.cma"
+archive(native) = "xcext.cmxa"
xcext/Makefile new file +71 -0

71 lines not on this page · raw message

xcext/xcext.h new file +70 -0

70 lines not on this page · raw message

xcext/xcext.ml new file +52 -0

52 lines not on this page · raw message

xcext/xcext.mli new file +55 -0

55 lines not on this page · raw message

xcext/xcext_lib.c new file +372 -0

372 lines not on this page · raw message

xcext/xcext_stubs.c new file +210 -0

210 lines not on this page · raw message

#59 lore raw

PATCH 1/1 add configure-time option to use system installed Xen library bindings

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291731529 18000
# Node ID 4ddc7e5613c08fc203c13c55bbb84d2935f57c9b
# Parent cc5f6f7e18cf39cf8ed9112c52aebb9c1317f8f9
add configure-time option to use system installed Xen library bindings.

Could be made to auto detect the Xen version but for now requires the user to explicitly opt in.

Makefile.in +42 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 Makefile.in
@@ -5,9 +5,13 @@ HAVE_LINUX_CDROM = @LINUX_CDROM@
 HAVE_XMLM = @OCAML_PKG_xmlm@
 HAVE_TYPECONV = @OCAML_PKG_type_conv@
 
+include config.mk
+
 .PHONY: all
 all:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid
+endif
 ifeq ($(HAVE_TYPECONV),type-conv)
 	$(MAKE) -C rpc-light
 endif
@@ -36,21 +40,29 @@ endif
 .PHONY: allxen
 allxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap
+endif
 	$(MAKE) -C netdev
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc
 	$(MAKE) -C xb
 	$(MAKE) -C xs
+endif
 	$(MAKE) -C xcext
 	$(MAKE) -C xsrpc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn
+endif
 	$(MAKE) -C cpuid
 	$(MAKE) -C vhd
 	$(MAKE) -C tapctl
 endif
 
 install:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid install
+endif
 	$(MAKE) -C stdext install
 	$(MAKE) -C log install
 	$(MAKE) -C stunnel install
@@ -77,21 +89,29 @@ endif
 
 installxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap install
+endif
 	$(MAKE) -C netdev install
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc install
 	$(MAKE) -C xb install
 	$(MAKE) -C xs install
+endif
 	$(MAKE) -C xcext install
 	$(MAKE) -C xsrpc install
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn install
+endif
 	$(MAKE) -C cpuid install
 	$(MAKE) -C vhd install
 	$(MAKE) -C tapctl install
 endif
 
 uninstall:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid uninstall
+endif
 	$(MAKE) -C stdext uninstall
 	$(MAKE) -C log uninstall
 	$(MAKE) -C stunnel uninstall
@@ -118,14 +138,20 @@ endif
 
 uninstallxen:
 ifeq ($(HAVE_XEN),1)
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn uninstall
+endif
 	$(MAKE) -C xsrpc uninstall
 	$(MAKE) -C netdev uninstall
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xs uninstall
 	$(MAKE) -C xb uninstall
 	$(MAKE) -C xc uninstall
+endif
 	$(MAKE) -C xcext uninstall
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap uninstall
+endif
 	$(MAKE) -C cpuid uninstall
 	$(MAKE) -C vhd uninstall
 	$(MAKE) -C tapctl uninstall
@@ -156,25 +182,33 @@ binuninstall:
 
 .PHONY: doc
 doc:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid doc
+endif
 	$(MAKE) -C stdext doc
 	$(MAKE) -C sexpr doc
 	$(MAKE) -C log doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xb doc
 	$(MAKE) -C xc doc
 	$(MAKE) -C xs doc
+endif
 	$(MAKE) -C xcext doc
 	$(MAKE) -C xml-light2 doc
 	$(MAKE) -C rpc-light doc
 	$(MAKE) -C http-svr doc
 	$(MAKE) -C camldm doc
 	$(MAKE) -C cdrom doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn doc
+endif
 	$(MAKE) -C pciutil doc
 	$(MAKE) -C rss doc
 	$(MAKE) -C stunnel doc
 	$(MAKE) -C xsrpc doc
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap doc
+endif
 	$(MAKE) -C netdev doc
 	$(MAKE) -C forking_executioner doc
 	$(MAKE) -C mlvm doc
@@ -185,7 +219,9 @@ doc:
 
 .PHONY: clean
 clean:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C uuid clean
+endif
 	$(MAKE) -C camldm clean
 	$(MAKE) -C stdext clean
 	$(MAKE) -C log clean
@@ -207,14 +243,20 @@ clean:
 	$(MAKE) -C xen-utils clean
 
 cleanxen:
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap clean
+endif
 	$(MAKE) -C netdev clean
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C xc clean
 	$(MAKE) -C xb clean
 	$(MAKE) -C xs clean
+endif
 	$(MAKE) -C xcext clean
 	$(MAKE) -C xsrpc clean
+ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C eventchn clean
+endif
 
 RPM_SPECSDIR=$(shell rpm --eval='%_specdir')
 RPM_SOURCEDIR=$(shell rpm --eval='%_sourcedir')
camldm/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 camldm/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
cdrom/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 cdrom/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
close-and-exec/Makefile +3 -1
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 close-and-exec/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -29,7 +31,7 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 closeandexec: closeandexec.cmxa closeandexec_main.cmx all
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -I ../stdext -I ../uuid uuid.cmxa unix.cmxa threads.cmxa stdext.cmxa closeandexec.cmxa closeandexec_main.cmx -o $@ 
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -I ../stdext $(OCAML_UUID_INC) uuid.cmxa unix.cmxa threads.cmxa stdext.cmxa closeandexec.cmxa closeandexec_main.cmx -o $@ 
 
 closeandexec.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)
configure.ac +7 -1
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 configure.ac
@@ -30,6 +30,11 @@ AC_CHECK_HEADERS([xen/xen.h],[XEN=1],[XE
 AC_CHECK_HEADERS([libdevmapper.h], [DEVICE_MAPPER=1], [DEVICE_MAPPER=0])
 AC_CHECK_HEADERS([linux/cdrom.h], [LINUX_CDROM=1], [LINUX_CDROM=0])
 
+HAVE_XEN_SYSTEM_BINDINGS=0 # could do more intelligent detection here... 
+AC_ARG_WITH(xen-system-bindings, AS_HELP_STRING([--without-xen-system-bindings],[do not use the system installed xen bindings]),
+	[if test "x$withval" = "xno"; then WITH_XEN_SYSTEM_BINDINGS=0; else WITH_XEN_SYSTEM_BINDINGS=1; fi],
+	[WITH_XEN_SYSTEM_BINDINGS=$HAVE_XEN_SYSTEM_BINDINGS])
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_DECLS([XS_RESTRICT],[],[],[
 [
@@ -54,8 +59,9 @@ fi
 AC_CHECK_OCAML_PKG([xmlm])
 AC_CHECK_OCAML_PKG([type-conv])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile config.mk])
 AC_SUBST([XEN])
+AC_SUBST([WITH_XEN_SYSTEM_BINDINGS])
 AC_SUBST([DEVICE_MAPPER])
 AC_SUBST([LINUX_CDROM])
 AC_SUBST([OCAML_PKG_xmlm])
cpuid/Makefile +3 -1
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 cpuid/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
 OCAMLOPT = ocamlopt
-INCLUDES = -I ../stdext -I ../xc -I ../xcext -I ../xen-utils
+INCLUDES = -I ../stdext $(OCAML_XC_INC) -I ../xcext -I ../xen-utils
 
 LDFLAGS = -cclib -L./
 
doc/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 doc/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 .PHONY: clean
 clean:
 	rm -rf components.js content
eventchn/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 eventchn/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
forking_executioner/Makefile +7 -5
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 forking_executioner/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -31,19 +33,19 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 test_forker: test_forker.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../uuid -I ../stdext uuid.cmxa rpc.cmx jsonrpc.cmx -I ../log unix.cmxa stdext.cmxa  test_forker.cmx -o $@
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light $(OCAML_UUID_INC) -I ../stdext uuid.cmxa rpc.cmx jsonrpc.cmx -I ../log unix.cmxa stdext.cmxa  test_forker.cmx -o $@
 
 fe: fe_debug.cmx child.cmx fe_main.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../stdext -I ../uuid -I ../log log.cmxa uuid.cmxa unix.cmxa rpc.cmx jsonrpc.cmx stdext.cmxa fe_debug.cmx child.cmx fe_main.cmx -o $@ 
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../rpc-light -I ../stdext $(OCAML_UUID_INC) -I ../log log.cmxa uuid.cmxa unix.cmxa rpc.cmx jsonrpc.cmx stdext.cmxa fe_debug.cmx child.cmx fe_main.cmx -o $@ 
 
 %.cmo: %.ml
-	$(OCAMLC) -c -I ../log -I ../uuid -I ../stdext -thread -o $@  $<
+	$(OCAMLC) -c -I ../log $(OCAML_UUID_INC) -I ../stdext -thread -o $@  $<
 
 %.cmi: %.mli
-	$(OCAMLC) -c -I ../log -I ../uuid -I ../stdext -o $@  $<
+	$(OCAMLC) -c -I ../log $(OCAML_UUID_INC) -I ../stdext -o $@  $<
 
 %.cmx: %.ml
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../log -I ../uuid -c -I ../stdext -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../log $(OCAML_UUID_INC) -c -I ../stdext -o $@ $<
 
 META: META.in
 	sed 's/@VERSION@/$(VERSION)/g' < $< > $@
http-svr/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 http-svr/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
log/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 log/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 OCAMLLOC := $(shell ocamlc -where)
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml -I$(OCAMLLOC)
mk/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 mk/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 ifdef B_BASE
 include $(B_BASE)/common.mk
 include $(B_BASE)/rpmbuild.mk
mlvm/Makefile +3 -2
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 mlvm/Makefile
@@ -1,3 +1,4 @@
+include ../config.mk
 
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -18,7 +19,7 @@ INTF = $(foreach obj, $(LIBOBJS),$(obj).
 CMDOBJS = messages.cmx mlvm.cmx
 OCAMLC = ocamlfind ocamlc -g
 OCAMLOPT = ocamlfind ocamlopt 
-COMPFLAG = -dtypes -g -I ../stdext -I ../camldm -I ../uuid -for-pack Lvm -pp '${PP}' -I ../rpc-light
+COMPFLAG = -dtypes -g -I ../stdext -I ../camldm $(OCAML_UUID_INC) -for-pack Lvm -pp '${PP}' -I ../rpc-light
 
 LIBS = lvm.cma lvm.cmxa
 
@@ -27,7 +28,7 @@ DOCDIR = /myrepos/xen-api-libs.hg/doc
 default : $(LIBS)
 
 test_allocator: default
-	$(OCAMLOPT) -package kaputt -linkpkg -dtypes -g  -I ../stdext -I ../camldm -I ../uuid -I +kaputt unix.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx ../camldm/camldm.cmxa ../uuid/uuid.cmxa ../stdext/stdext.cmxa ./lvm.cmxa test_allocator.ml -o $@
+	$(OCAMLOPT) -package kaputt -linkpkg -dtypes -g  -I ../stdext -I ../camldm $(OCAML_UUID_INC) -I +kaputt unix.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx ../camldm/camldm.cmxa $(OCAML_UUID_DIR)/uuid.cmxa ../stdext/stdext.cmxa ./lvm.cmxa test_allocator.ml -o $@
 
 lvm.cmx: $(foreach obj,$(LIBOBJS),$(obj).cmx)
 	$(OCAMLOPT) -pack -g -o $@ $(foreach obj,$(LIBOBJS),$(obj).cmx)
mmap/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 mmap/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
netdev/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 netdev/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
pciutil/Makefile +3 -1
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 pciutil/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
@@ -29,7 +31,7 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 pciutil: pciutil_main.cmx
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ./ -I ../stdext -I ../uuid unix.cmxa uuid.cmxa stdext.cmxa pciutil.cmx -o $@ $^
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ./ -I ../stdext $(OCAML_UUID_INC) unix.cmxa uuid.cmxa stdext.cmxa pciutil.cmx -o $@ $^
 
 pciutil.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)
rpc-light/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 rpc-light/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 OCAMLC = ocamlfind ocamlc
 OCAMLOPT = ocamlfind ocamlopt
 OCAMLFLAGS = -annot -g
rss/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 rss/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
sexpr/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 sexpr/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
stdext/Makefile +13 -8
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 stdext/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 CC = gcc
 OCAMLLOC := $(shell ocamlc -where)
@@ -17,6 +19,9 @@ OCAMLDESTDIR ?= $(OCAMLLIBDIR)
 
 FEPP = camlp4o -I ../rpc-light -I $(shell ocamlfind query type-conv) pa_type_conv.cmo pa_rpc.cma
 
+OCAML_UUID_INC = -I $(OCAML_UUID_DIR)
+OCAML_UUID_LIB = $(OCAML_UUID_DIR)/uuid.cmxa
+
 OCAML_TEST_INC = -I $(shell ocamlfind query oUnit)
 OCAML_TEST_LIB = $(shell ocamlfind query oUnit)/oUnit.cmxa
 
@@ -75,10 +80,10 @@ base64pp: base64_main.ml all libstdext_s
 	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
 
 fe_cli: fe_cli.ml all libstdext_stubs.a
-	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
+	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa $(OCAML_UUID_LIB) ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
 
 fe_test: fe_test.ml all libstdext_stubs.a
-	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -I ../uuid -o $@ $< -ccopt -L.
+	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa $(OCAML_UUID_LIB) ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg $(OCAML_UUID_INC) -o $@ $< -ccopt -L.
 
 extentlistset_test: extentlistset_test.ml all libstdext_stubs.a
 	ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa stdext.cmxa -linkpkg -o $@ $< -ccopt -L.
@@ -111,10 +116,10 @@ fe.cmo: fe.ml
 	$(OCAMLC) -pp '$(FEPP)' -I ../jsonrpc -I ../rpc-light -c -o $@ $<
 
 forkhelpers.cmo: forkhelpers.ml forkhelpers.cmi
-	$(OCAMLC) -thread -I ../uuid -c -o $@ $<
+	$(OCAMLC) -thread $(OCAML_UUID_INC) -c -o $@ $<
 
 filenameext.cmo: filenameext.ml filenameext.cmi
-	$(OCAMLC) -c -I ../uuid -o $@ $<
+	$(OCAMLC) -c $(OCAML_UUID_INC) -o $@ $<
 
 %.cmo: %.ml %.cmi
 	$(OCAMLC) -c -o $@ $<
@@ -126,7 +131,7 @@ forkhelpers.cmi: forkhelpers.mli
 	$(OCAMLC) -thread -c -o $@ $<
 
 filenameext.cmi: filenameext.mli
-	$(OCAMLC) -c -I ../uuid -o $@ $<
+	$(OCAMLC) -c $(OCAML_UUID_INC) -o $@ $<
 
 fe.cmi: fe.cmo
 	$(OCAMLC) -pp '$(FEPP)' -c -o $@ $<
@@ -144,13 +149,13 @@ fecomms.cmx : fecomms.ml
 	$(OCAMLOPT) -I ../rpc-light -c -o $@ $<
 
 forkhelpers.cmx: forkhelpers.ml forkhelpers.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -thread -c -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAML_UUID_INC) -thread -c -o $@ $<
 
 filenameext.cmx: filenameext.ml filenameext.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c -I ../uuid -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c $(OCAML_UUID_INC) -o $@ $<
 
 %.cmx: %.ml %.cmi
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -c -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAML_UUID_INC) -c -o $@ $<
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
stunnel/Makefile +5 -3
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 stunnel/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
@@ -31,13 +33,13 @@ stunnel.cma: $(foreach obj,$(OBJS),$(obj
 	$(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo)
 
 %.cmo: %.ml
-	$(OCAMLC) -c -I ../stdext -I ../uuid -I ../log -o $@ $<
+	$(OCAMLC) -c -I ../stdext $(OCAML_UUID_INC) -I ../log -o $@ $<
 
 %.cmi: %.mli
-	$(OCAMLC) -c -I ../stdext -I ../uuid -o $@ $<
+	$(OCAMLC) -c -I ../stdext $(OCAML_UUID_INC) -o $@ $<
 
 %.cmx: %.ml
-	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c -I ../stdext -I ../uuid -I ../log -o $@ $<
+	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c -I ../stdext $(OCAML_UUID_INC) -I ../log -o $@ $<
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
tapctl/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 tapctl/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
 OCAMLC = ocamlc -g
tests/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 tests/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 OCAMLC = ocamlfind ocamlc -g -package "unix,stdext,xc,xb,xs,mmap"
 OCAMLOPT = ocamlfind ocamlopt -package "unix,stdext,xc,xb,xs,mmap"
 
uuid/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 uuid/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
vhd/Makefile +1 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 vhd/Makefile
@@ -1,3 +1,4 @@
+include ../config.mk
 
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
xb/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xb/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap
 OCAMLC = ocamlc -g -I ../mmap
xc/Makefile +4 -2
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xc/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap -I./
-OCAMLC = ocamlc -g -I ../mmap -I ../uuid
+OCAMLC = ocamlc -g -I ../mmap $(OCAML_UUID_INC)
 OCAMLOPT = ocamlopt
-OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid
+OCAMLOPTFLAGS = -g -dtypes -I ../mmap $(OCAML_UUID_INC)
 
 LDFLAGS = -cclib -L./
 
xcext/Makefile +4 -2
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xcext/Makefile
@@ -1,8 +1,10 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml -I$(XEN_ROOT)/usr/include -I../mmap -I./
-OCAMLC = ocamlc -g -I ../mmap -I ../uuid -I ../xc
+OCAMLC = ocamlc -g -I ../mmap -I ../uuid $(OCAML_XC_INC)
 OCAMLOPT = ocamlopt
-OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid -I ../xc
+OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid $(OCAML_XC_INC)
 
 LDFLAGS = -cclib -L./
 
xen-utils/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xen-utils/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml -I$(XEN_ROOT)/usr/include
 OCAMLC = ocamlc -g
xml-light2/Makefile +2 -0
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xml-light2/Makefile
@@ -1,3 +1,5 @@
+include ../config.mk
+
 IPROG=install -m 755 -o root -g root
 OCAMLPACKS = xmlm
 
xs/Makefile +4 -2
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xs/Makefile
@@ -1,12 +1,14 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/usr/lib/ocaml
-OCAMLC = ocamlc -g -I ../xb/
+OCAMLC = ocamlc -g $(OCAML_XB_INC)
 OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
-OCAMLOPTFLAGS = -g -dtypes -I ../xb/
+OCAMLOPTFLAGS = -g -dtypes $(OCAML_XB_INC)
 
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
xsrpc/Makefile +4 -2
diff -r cc5f6f7e18cf -r 4ddc7e5613c0 xsrpc/Makefile
@@ -1,12 +1,14 @@
+include ../config.mk
+
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
-OCAMLC = ocamlc -g -I ../xb/ -I ../xs/
+OCAMLC = ocamlc -g $(OCAML_XB_INC) $(OCAML_XS_INC)
 OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
-OCAMLOPTFLAGS = -g -dtypes -I ../xb/ -I ../xs/
+OCAMLOPTFLAGS = -g -dtypes $(OCAML_XB_INC) $(OCAML_XS_INC)
 
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
#60 lore raw

PATCH 1/1 REBASE-4.1: xiu: add xenctrlosdep backend

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291731939 18000
# Node ID 6fbe1c0939894dd12e2df5e930fbe9f60d24b3d8 # Parent 791652226f0e89265bf5ba50d0fe17c69a98dee7 REBASE-4.1: xiu: add xenctrlosdep backend.

This interface was recently added to the upstream libxenctrl to allow interception of the calls to the hypervisor.

Convert eventchn/eventchn_injection.c and xc/xc_lib_injection.c into an XIU backend for this interface.

(depends on global rebase to Xen 4.1)

Makefile.in +5 -0
diff -r 791652226f0e -r 6fbe1c093989 Makefile.in
@@ -57,6 +57,7 @@ endif
 	$(MAKE) -C cpuid
 	$(MAKE) -C vhd
 	$(MAKE) -C tapctl
+	$(MAKE) -C fake
 endif
 
 install:
@@ -106,6 +107,7 @@ endif
 	$(MAKE) -C cpuid install
 	$(MAKE) -C vhd install
 	$(MAKE) -C tapctl install
+	$(MAKE) -C fake install
 endif
 
 uninstall:
@@ -155,6 +157,7 @@ endif
 	$(MAKE) -C cpuid uninstall
 	$(MAKE) -C vhd uninstall
 	$(MAKE) -C tapctl uninstall
+	$(MAKE) -C fake uninstall
 endif
 
 bins:
@@ -215,6 +218,7 @@ endif
 	$(MAKE) -C cpuid doc
 	$(MAKE) -C vhd doc
 	$(MAKE) -C tapctl doc
+	$(MAKE) -C fake doc
 	$(MAKE) -C xen-utils doc
 
 .PHONY: clean
@@ -243,6 +247,7 @@ endif
 	$(MAKE) -C xen-utils clean
 
 cleanxen:
+	$(MAKE) -C fake clean
 ifeq ($(WITH_XEN_SYSTEM_BINDINGS),0)
 	$(MAKE) -C mmap clean
 endif
fake/Makefile new file +27 -0
diff -r 791652226f0e -r 6fbe1c093989 fake/Makefile
@@ -0,0 +1,27 @@
+CC := gcc
+
+CFLAGS := -O1
+CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -std=gnu99
+CFLAGS += -mno-tls-direct-seg-refs
+CFLAGS += -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -Werror -Wmissing-prototypes
+CFLAGS += -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
+
+all: xenctrl_osdep_xiu.so
+	@:
+
+xeninterrcept_xiu.o: xenctrl_osdep_xiu.c
+	$(CC) $(CFLAGS) -c -o xenctrl_osdep_xiu.o xenctrl_osdep_xiu.c
+
+xenctrl_osdep_xiu.so: xenctrl_osdep_xiu.o
+	$(CC) $(CFLAGS) -shared -o xenctrl_osdep_xiu.so xenctrl_osdep_xiu.o -lxenctrl
+
+install: xenctrl_osdep_xiu.so
+	mkdir -p $$(DESTDIR)/opt/xensource/lib/xenctrl/
+	cp xenctrl_osdep_xiu.so $(DESTDIR)/opt/xensource/lib/xenctrl/osdep_xiu.so
+
+clean:
+	rm -f xeninterrcept_xiu.o
+	rm -f xenctrl_osdep_xiu.so
+
+uninstall:
+	rm -f $(DESTDIR)/opt/xensource/lib/xenctrl/osdep_xiu.so
fake/xenctrl_osdep_xiu.c new file +609 -0

609 lines not on this page · raw message

#61 lore raw

PATCH 1/1 REBASE-4.1: default to using system installed bindings if Xen is available

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1291731529 18000
# Node ID 791652226f0e89265bf5ba50d0fe17c69a98dee7
# Parent 4ddc7e5613c08fc203c13c55bbb84d2935f57c9b
REBASE-4.1: default to using system installed bindings if Xen is available

(depends on global rebase to Xen 4.1)

configure.ac +1 -1
diff -r 4ddc7e5613c0 -r 791652226f0e configure.ac
@@ -30,7 +30,7 @@ AC_CHECK_HEADERS([xen/xen.h],[XEN=1],[XE
 AC_CHECK_HEADERS([libdevmapper.h], [DEVICE_MAPPER=1], [DEVICE_MAPPER=0])
 AC_CHECK_HEADERS([linux/cdrom.h], [LINUX_CDROM=1], [LINUX_CDROM=0])
 
-HAVE_XEN_SYSTEM_BINDINGS=0 # could do more intelligent detection here... 
+HAVE_XEN_SYSTEM_BINDINGS=$XEN # could do more intelligent detection here... 
 AC_ARG_WITH(xen-system-bindings, AS_HELP_STRING([--without-xen-system-bindings],[do not use the system installed xen bindings]),
 	[if test "x$withval" = "xno"; then WITH_XEN_SYSTEM_BINDINGS=0; else WITH_XEN_SYSTEM_BINDINGS=1; fi],
 	[WITH_XEN_SYSTEM_BINDINGS=$HAVE_XEN_SYSTEM_BINDINGS])
#62 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-api.hg

In reply to a message not in the archive

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1

This is the xen-api.hg portion.

Only the first two patches are for immediate consideration, the others all depend on actually moving to Xen 4.1

A message that is not in the archive (sent off-list or not yet received): patchbomb.1291732388-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#64 lore raw

PATCH 1/1 Query rpm to find build directories

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290076616 18000
# Node ID 819ce8194667bb673138ad12e781432cebf2028a # Parent 7438d990fed8255bba2d592f767de133bd45863a Query rpm to find build directories.

Allows user with ~/.rpmmacros to build e.g.

$ cat ~/.rpmmacros
%_topdir        /data/rpmbuild
%_tmppath       /data/tmp
Makefile +3 -3
diff -r 7438d990fed8 -r 819ce8194667 Makefile
@@ -107,9 +107,9 @@ MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
 REPO ?= $(CURDIR)
 
-RPM_SPECSDIR?=/usr/src/redhat/SPECS
-RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_SOURCESDIR?=/usr/src/redhat/SOURCES
+RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
+RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
+RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
 RPMBUILD?=rpmbuild
 XEN_RELEASE?=unknown
 endif
#65 lore raw

PATCH 1/1 xc: use Xcext library rather than Xc where appropriate

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # 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..

ocaml/xapi/monitor.ml +8 -8
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xapi/monitor.ml
@@ -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
ocaml/xenops-ts/OMakefile +1 -1
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops-ts/OMakefile
@@ -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)
ocaml/xenops/OMakefile +1 -1
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops/OMakefile
@@ -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
ocaml/xenops/domain.ml +9 -9
diff -r 819ce8194667 -r 4b9c3e5d05b0 ocaml/xenops/domain.ml
@@ -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
#66 lore raw

PATCH 1/1 REBASE-4.1: xenops: update PV console path in xenstore

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1290076616 18000
# Node ID 2e6a1485047a2e91c2e90d8ffdbf6c9a9814588c # Parent 810786855fe641b7db0074cfcb2b2a3a4dfd34a0 REBASE-4.1: xenops: update PV console path in xenstore.

This was changed in more recent xenconsoled in order to better support multiple consoles.

ocaml/xenops/device.ml +3 -3
diff -r 810786855fe6 -r 2e6a1485047a ocaml/xenops/device.ml
@@ -845,11 +845,11 @@ module PV_Vnc = struct
 
 let vncterm_wrapper = "/opt/xensource/libexec/vncterm-wrapper"
 
-let vnc_port_path domid = sprintf "/local/domain/%d/serial/0/vnc-port" domid
+let vnc_port_path domid = sprintf "/local/domain/%d/console/vnc-port" domid
 
 let pid ~xs domid =
 	try
-		let pid = xs.Xs.read (sprintf "/local/domain/%d/serial/0/vncterm-pid" domid) in
+		let pid = xs.Xs.read (sprintf "/local/domain/%d/console/vncterm-pid" domid) in
 		Some (int_of_string pid)
 	with _ ->
 		None
@@ -896,7 +896,7 @@ let save ~xs domid =
 let start ?statefile ~xs domid =
 	let l = [ string_of_int domid; (* absorbed by vncterm-wrapper *)
 		  (* everything else goes straight through to vncterm-wrapper: *)
-		  "-x"; sprintf "/local/domain/%d/serial/0" domid;
+		  "-x"; sprintf "/local/domain/%d/console" domid;
 		] @ load_args statefile in
 	(* Now add the close fds wrapper *)
 	let pid = Forkhelpers.safe_close_and_exec None None None [] vncterm_wrapper l in
scripts/vncterm-wrapper +2 -2
diff -r 810786855fe6 -r 2e6a1485047a scripts/vncterm-wrapper
@@ -39,9 +39,9 @@ else
 fi
 
 echo vncterm-wrapper:
-xenstore-write -s /local/domain/$DOMID/serial/0/vncterm-pid $$
+xenstore-write -s /local/domain/$DOMID/console/vncterm-pid $$
 if [ -z "${XIU}" ]; then
 	exec /usr/lib/xen/bin/vncterm $VNCTERM_LISTEN $VNCVIEWER $* > /dev/null 2>&1
 else
-	exec xenstore-write -s /local/domain/$DOMID/serial/0/vnc-port 0
+	exec xenstore-write -s /local/domain/$DOMID/console/vnc-port 0
 fi
#67 lore raw

PATCH 1/1 HACK: xenguest updates for Xen 4.0/4.1

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291305009 18000
# Node ID 45271ebfd9022c7b0a2f962360c4c7a663706865 # Parent 15700c869b5445ce6d239513c54d6f69f9d62808
HACK: xenguest updates for Xen 4.0/4.1

Totally incomplete but enough to start a PV guest.

ocaml/xenguest/save_helpers.c +5 -136
diff -r 15700c869b54 -r 45271ebfd902 ocaml/xenguest/save_helpers.c
@@ -22,150 +22,19 @@
  * Modifications (c) Citrix Systems Inc
  */
 
-#include <err.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <grp.h>
 
 #include <xs.h>
 #include <xenctrl.h>
 #include <xenguest.h>
 
-static char *qemu_active_path;
-static char *qemu_next_active_path;
-static int qemu_shmid = -1;
-static struct xs_handle *xs;
-
-
-/* Mark the shared-memory segment for destruction */
-static void qemu_destroy_buffer(void)
-{
-    if (qemu_shmid != -1)
-        shmctl(qemu_shmid, IPC_RMID, NULL);
-    qemu_shmid = -1;
+int switch_qemu_logdirty(int domid, unsigned enable, void *data)
+{	
+	return 1; /* XXX actually do something! */
 }
 
-/* Get qemu to change buffers. */
-void qemu_flip_buffer(int domid, int next_active)
+int do_domain_suspend(void* data)
 {
-    char digit = '0' + next_active;
-    unsigned int len;
-    char *active_str, **watch;
-    struct timeval tv;
-    fd_set fdset;
-    int rc;
-
-    /* Tell qemu that we want it to start writing log-dirty bits to the
-     * other buffer */
-    if (!xs_write(xs, XBT_NULL, qemu_next_active_path, &digit, 1)) {
-        errx(1, "can't write next-active to store path (%s)\n",
-              qemu_next_active_path);
-        exit(1);
-    }
-
-    /* Wait a while for qemu to signal that it has switched to the new
-     * active buffer */
- read_again:
-    tv.tv_sec = 60;
-    tv.tv_usec = 0;
-    FD_ZERO(&fdset);
-    FD_SET(xs_fileno(xs), &fdset);
-    rc = select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv);
-    if (rc == 0)
-        errx(1, "timed out waiting for qemu to switch buffers\n");
-    else if (rc < 0) {
-        if (errno == EINTR) 
-            goto read_again;
-        err(1, "error waiting for qemu to switch buffers");
-    }
-    watch = xs_read_watch(xs, &len);
-    free(watch);
-
-    active_str = xs_read(xs, XBT_NULL, qemu_active_path, &len);
-    if (active_str == NULL || active_str[0] - '0' != next_active)
-        /* Watch fired but value is not yet right */
-        goto read_again;
+	return 1; /* XXX actually do something! */
 }
 
-void * init_qemu_maps(int domid, unsigned int bitmap_size)
-{
-    key_t key;
-    char key_ascii[17] = {0,};
-    void *seg;
-    char *path, *p;
-    struct shmid_ds ds_buf;
-    struct group *gr;
-
-    /* Make a shared-memory segment */
-    do {
-        key = rand(); /* No security, just a sequence of numbers */
-        qemu_shmid = shmget(key, 2 * bitmap_size, 
-                       IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
-        if (qemu_shmid == -1 && errno != EEXIST)
-            errx(1, "can't get shmem to talk to qemu-dm");
-    } while (qemu_shmid == -1);
-
-    /* Remember to tidy up after ourselves */
-    atexit(qemu_destroy_buffer);
-
-    /* Change owner so that qemu can map it. */
-    gr = getgrnam("qemu_base");
-    if (!gr)
-        err(1, "can't get qemu gid");
-    if (shmctl(qemu_shmid, IPC_STAT, &ds_buf) < 0)
-        err(1, "can't get status of shm area");
-    ds_buf.shm_perm.gid = gr->gr_gid + (unsigned short)domid;
-    if (shmctl(qemu_shmid, IPC_SET, &ds_buf) < 0)
-        err(1, "can't change gid of shm area");
-
-    /* Map it into our address space */
-    seg = shmat(qemu_shmid, NULL, 0);
-    if (seg == (void *) -1)
-        errx(1, "can't map shmem to talk to qemu-dm");
-    memset(seg, 0, 2 * bitmap_size);
-
-    /* Write the size of it into the first 32 bits */
-    *(uint32_t *)seg = bitmap_size;
-
-    /* Tell qemu about it */
-    if ((xs = xs_daemon_open()) == NULL)
-        errx(1, "Couldn't contact xenstore");
-    if (!(path = xs_get_domain_path(xs, domid)))
-        errx(1, "can't get domain path in store");
-    if (!(path = realloc(path, strlen(path)
-                         + strlen("/logdirty/next-active") + 1)))
-        errx(1, "no memory for constructing xenstore path");
-    strcat(path, "/logdirty/");
-    p = path + strlen(path);
-
-    strcpy(p, "key");
-    snprintf(key_ascii, 17, "%16.16llx", (unsigned long long) key);
-    if (!xs_write(xs, XBT_NULL, path, key_ascii, 16))
-        errx(1, "can't write key (%s) to store path (%s)\n", key_ascii, path);
-
-    /* Watch for qemu's indication of the active buffer, and request it
-     * to start writing to buffer 0 */
-    strcpy(p, "active");
-    if (!xs_watch(xs, path, "qemu-active-buffer"))
-        errx(1, "can't set watch in store (%s)\n", path);
-    if (!(qemu_active_path = strdup(path)))
-        errx(1, "no memory for copying xenstore path");
-
-    strcpy(p, "next-active");
-    if (!(qemu_next_active_path = strdup(path)))
-        errx(1, "no memory for copying xenstore path");
-
-    qemu_flip_buffer(domid, 0);
-
-    free(path);
-    return seg;
-}
-
-/***********************************************************************/
ocaml/xenguest/xenguest_stubs.c +69 -52

282 lines not on this page · raw message

ocaml/xenops/xenops.ml +2 -2
diff -r 15700c869b54 -r 45271ebfd902 ocaml/xenops/xenops.ml
@@ -29,8 +29,8 @@ let print_xen_physinfo ~xc =
 	printf "nr_cpus = %d\n" physinfo.Xc.nr_cpus;
 	printf "threads_per_core = %d\n" physinfo.Xc.threads_per_core;
 	printf "cores_per_socket = %d\n" physinfo.Xc.cores_per_socket;
-	printf "sockets_per_node = %d\n" physinfo.Xc.sockets_per_node;
-	printf "nr_nodes = %d\n" physinfo.Xc.nr_nodes;
+	(*printf "sockets_per_node = %d\n" physinfo.Xc.sockets_per_node;*)
+	(*printf "nr_nodes = %d\n" physinfo.Xc.nr_nodes;*)
 	printf "cpu_khz = %d\n" physinfo.Xc.cpu_khz;
 	printf "total_pages = %s (%Ld Mb)\n" (Nativeint.to_string physinfo.Xc.total_pages) totalmib;
 	printf "free_pages = %s (%Ld Mb)\n" (Nativeint.to_string physinfo.Xc.free_pages) freemib;
#68 lore raw

PATCH 1/1 REBASE-4.1: vmops: apply CPUID to all domains

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1290076616 18000
# Node ID 810786855fe641b7db0074cfcb2b2a3a4dfd34a0 # Parent 4b9c3e5d05b045b4b93afa12e78afbef41ca7aa1 REBASE-4.1: vmops: apply CPUID to all domains.

Not just when xenclient is enabled.

I think the indentation was confusing here and the PCI passthrough bit wasn't actually guarded by Xapi_globs.xenclient_enabled.

Required on newer hypervisor otherwise guest sees all cpuid leafs == 0.

ocaml/xapi/vmops.ml +3 -4
diff -r 4b9c3e5d05b0 -r 810786855fe6 ocaml/xapi/vmops.ml
@@ -1052,11 +1052,10 @@ let start_paused ?(progress_cb = fun _ -
 
 		      let hvm = Helpers.is_hvm snapshot in			
 
-		      if Xapi_globs.xenclient_enabled then 
-			Domain.cpuid_apply ~xc ~hvm domid;
+		      Domain.cpuid_apply ~xc ~hvm domid;
 
-			  (* XXX: PCI passthrough needs a lot of work *)
-			  let pcidevs = (match pcidevs with Some x -> x | None -> pcidevs_of_vm ~__context ~vm) in
+		      (* XXX: PCI passthrough needs a lot of work *)
+		      let pcidevs = (match pcidevs with Some x -> x | None -> pcidevs_of_vm ~__context ~vm) in
 
 		      (* Don't attempt to attach empty VBDs to PV guests: they can't handle them *)
 		      let vbds = 
#69 lore raw

PATCH 1/1 HACK/PoC: adjust for minor differences in upstream Xc bindings

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1291305003 18000
# Node ID 15700c869b5445ce6d239513c54d6f69f9d62808
# 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

ocaml/xenops/balloon.ml +1 -1
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/balloon.ml
@@ -26,7 +26,7 @@ let _low_mem_balloon = "Low-mem balloon"
 let _high_mem_balloon = "High-mem balloon"
 
 (** Indicates whether or not we're running with XIU (Xen-In Userspace) *)
-let on_xiu () = Xc.using_injection ()
+let on_xiu () = Xc.is_fake ()
 
 (** Reads /proc/xen/balloon into a string * int64 option association list *)
 let parse_proc_xen_balloon () =
ocaml/xenops/device.ml +2 -2
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/device.ml
@@ -749,8 +749,8 @@ let add ~xs ~devid ~netty ~mac ?mtu ?(ra
 	let extra_private_keys = extra_private_keys @
 	  (match mtu with | Some mtu when mtu > 0 -> [ "MTU", string_of_int mtu ] | _ -> []) @
 	  (match netty with
-	     | Netman.Bridge b -> [ "bridge", b; "bridge-MAC", if(Xc.using_injection ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff"; ]
-	     | Netman.Vswitch b -> [ "bridge", b; "bridge-MAC", if(Xc.using_injection ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff"; ]
+	     | Netman.Bridge b -> [ "bridge", b; "bridge-MAC", if(Xc.is_fake ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff"; ]
+	     | Netman.Vswitch b -> [ "bridge", b; "bridge-MAC", if(Xc.is_fake ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff"; ]
 	     | Netman.DriverDomain -> []
 	     | Netman.Nat -> []) @
 	  (match rate with | None -> [] | Some(rate, timeslice) -> [ "rate", Int64.to_string rate; "timeslice", Int64.to_string timeslice ]) in
ocaml/xenops/domain.ml +11 -7
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/domain.ml
@@ -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
ocaml/xenops/domain.mli +1 -1
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/domain.mli
@@ -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
ocaml/xenops/netman.ml +1 -1
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/netman.ml
@@ -27,7 +27,7 @@ let online vif netty =
 		Netdev.Link.arp dev false;
 		Netdev.Link.multicast dev false;
 		Netdev.Link.set_addr dev 
-		 (if(Xc.using_injection ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff");
+		 (if(Xc.is_fake ()) then "fe:fe:fe:fe:fe:fe" else "fe:ff:ff:ff:ff:ff");
 		Netdev.Addr.flush dev
 		in
 	match netty with
ocaml/xenops/xenguestHelper.ml +1 -1
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenops/xenguestHelper.ml
@@ -41,7 +41,7 @@ let connect (args: string list) (fds: (s
 	(* Need to send commands and receive responses from the
 	   slave process *)
 
-	let using_xiu = Xc.using_injection () in
+	let using_xiu = Xc.is_fake () in
 
 	let last_log_file = "/tmp/xenguest.log" in
 	(try Unix.unlink last_log_file with _ -> ());
ocaml/xenstored/event.ml +9 -8
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenstored/event.ml
@@ -13,14 +13,15 @@
  *)
 (**************** high level binding ****************)
 type t = {
-	fd: Unix.file_descr;
+	handle: Eventchn.handle;
 	mutable virq_port: int;
 }
 
-let init () = { fd = Eventchn.init (); virq_port = -1; }
-let bind_virq eventchn = eventchn.virq_port <- Eventchn.bind_virq eventchn.fd
-let bind_interdomain eventchn domid port = Eventchn.bind_interdomain eventchn.fd domid port
-let unbind eventchn port = Eventchn.unbind eventchn.fd port
-let notify eventchn port = Eventchn.notify eventchn.fd port
-let read_port eventchn = Eventchn.read_port eventchn.fd
-let write_port eventchn port = Eventchn.write_port eventchn.fd port
+let init () = { handle = Eventchn.init (); virq_port = -1; }
+let fd eventchn = Eventchn.fd eventchn.handle
+let bind_dom_exc_virq eventchn = eventchn.virq_port <- Eventchn.bind_dom_exc_virq eventchn.handle
+let bind_interdomain eventchn domid port = Eventchn.bind_interdomain eventchn.handle domid port
+let unbind eventchn port = Eventchn.unbind eventchn.handle port
+let notify eventchn port = Eventchn.notify eventchn.handle port
+let pending eventchn = Eventchn.pending eventchn.handle
+let unmask eventchn port = Eventchn.unmask eventchn.handle port
ocaml/xenstored/xenstored.ml +7 -7
diff -r 2e6a1485047a -r 15700c869b54 ocaml/xenstored/xenstored.ml
@@ -249,7 +249,7 @@ let _ =
 
 	if cf.restart then (
 		DB.from_file store domains cons "/var/run/xenstored/db";
-		Event.bind_virq eventchn
+		Event.bind_dom_exc_virq eventchn
 	) else (
 		if !Disk.enable then (
 			info "reading store from disk";
@@ -261,9 +261,9 @@ let _ =
 			Store.mkdir store (Perms.Connection.create 0) localpath;
 
 		if cf.domain_init then (
-			let usingxiu = Xc.using_injection () in
+			let usingxiu = Xc.is_fake () in
 			Connections.add_domain cons (Domains.create0 usingxiu domains);
-			Event.bind_virq eventchn
+			Event.bind_dom_exc_virq eventchn
 		);
 	);
 
@@ -275,7 +275,7 @@ let _ =
 	Logging.init cf.activate_access_log (fun () -> DB.to_file store cons "/var/run/xenstored/db");
 
 	let spec_fds = [ rw_sock; ro_sock ] @
-		       (if cf.domain_init then [ eventchn.Event.fd ] else []) in
+		       (if cf.domain_init then [ Event.fd eventchn ] else []) in
 
 	let xc = Xc.interface_open () in
 
@@ -285,7 +285,7 @@ let _ =
 			debug "new connection through socket";
 			Connections.add_anonymous cons cfd can_write
 		and handle_eventchn fd =
-			let port = Event.read_port eventchn in
+			let port = Event.pending eventchn in
 			finally (fun () ->
 				if port = eventchn.Event.virq_port then (
 					let (notify, deaddom) = Domains.cleanup xc domains in
@@ -293,14 +293,14 @@ let _ =
 					if deaddom <> [] || notify then
 						Connections.fire_spec_watches cons "@releaseDomain"
 				)
-			) (fun () -> Event.write_port eventchn port);
+			) (fun () -> Event.unmask eventchn port);
 		and do_if_set fd set fct =
 			if List.mem fd set then
 				fct fd in
 
 		do_if_set rw_sock rset (accept_connection true);
 		do_if_set ro_sock rset (accept_connection false);
-		do_if_set eventchn.Event.fd rset (handle_eventchn)
+		do_if_set (Event.fd eventchn) rset (handle_eventchn)
 		in
 
 	let last_stat_time = ref 0. in
scripts/init.d-squeezed +1 -0
diff -r 2e6a1485047a -r 15700c869b54 scripts/init.d-squeezed
@@ -25,6 +25,7 @@ SUBSYS_FILE="/var/lock/subsys/squeezed"
 . /etc/init.d/functions
 
 if [ -e /var/xapi/xiu-xc ]; then
+	export XENCTRL_OSDEP=/opt/xensource/lib/xenctrl/osdep_xiu.so
 	export XIU=/var/xapi/xiu
 fi
 
scripts/init.d-xapi +1 -0
diff -r 2e6a1485047a -r 15700c869b54 scripts/init.d-xapi
@@ -16,6 +16,7 @@ if [ -f /etc/sysconfig/xapi ]; then
 fi
 
 if [ -e /var/xapi/xiu-xc ]; then
+	export XENCTRL_OSDEP=/opt/xensource/lib/xenctrl/osdep_xiu.so
 	export XIU=/var/xapi/xiu
 fi
 
scripts/init.d-xenservices +1 -0
diff -r 2e6a1485047a -r 15700c869b54 scripts/init.d-xenservices
@@ -36,6 +36,7 @@ start() {
 	    failure $"xiu"
 	    exit 1
 	fi
+	export XENCTRL_OSDEP=/opt/xensource/lib/xenctrl/osdep_xiu.so
 	export XIU=/var/xapi/xiu
     fi
 	echo -n $"Starting xenstored: "	
#70 lore raw

PATCH 1/1 XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-unstable.hg

In reply to Ian Campbell

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1

This is the xen-unstable.hg portion.

All but the last patch are intended for immediate consideration.

A message that is not in the archive (sent off-list or not yet received): patchbomb.1291732371-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org

#72 lore raw

PATCH 1/1 ocaml: resynchronise uuid library with xen-api-libs.hg

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291307719 18000
# Node ID 21d9d889ec30f6ac55267c745a1cae56c768f63b # Parent 8ecbddf6cad3a2fbb63b273658b9f67429754d3d
ocaml: resynchronise uuid library with xen-api-libs.hg

tools/ocaml/libs/uuid/uuid.ml +43 -31
diff -r 8ecbddf6cad3 -r 21d9d889ec30 tools/ocaml/libs/uuid/uuid.ml
@@ -1,6 +1,5 @@
 (*
- * Copyright (C) 2006-2007 XenSource Ltd.
- * Copyright (C) 2008      Citrix Ltd.
+ * Copyright (C) 2006-2010 Citrix Systems Inc.
  * Author Vincent Hanquez <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -14,9 +13,7 @@
  * GNU Lesser General Public License for more details.
  *)
 
-(** Type-safe UUIDs. *)
-
-(** Internally, a UUID is simply a string. *)
+(* Internally, a UUID is simply a string. *)
 type 'a t = string
 
 type cookie = string
@@ -24,6 +21,8 @@ type cookie = string
 let of_string s = s
 let to_string s = s
 
+let null = ""
+
 (* deprecated: we don't need to duplicate the uuid prefix/suffix *)
 let uuid_of_string = of_string
 let string_of_uuid = to_string
@@ -32,12 +31,34 @@ let string_of_cookie s = s
 
 let cookie_of_string s = s
 
-(** FIXME: using /dev/random is too slow but using /dev/urandom is too
-    deterministic. *)
-let dev_random = "/dev/urandom"
+let dev_random = "/dev/random"
+let dev_urandom = "/dev/urandom"
 
-let read_random n = 
-  let ic = open_in_bin dev_random in
+let rnd_array n =
+	let fstbyte i = 0xff land i in
+	let sndbyte i = fstbyte (i lsr 8) in
+	let thdbyte i = sndbyte (i lsr 8) in
+	let rec rnd_list n acc = match n with
+		| 0 -> acc
+		| 1 ->
+			let b = fstbyte (Random.bits ()) in
+			b :: acc
+		| 2 ->
+			let r = Random.bits () in
+			let b1 = fstbyte r in
+			let b2 = sndbyte r in
+			b1 :: b2 :: acc
+		| n -> 
+			let r = Random.bits () in
+			let b1 = fstbyte r in
+			let b2 = sndbyte r in
+			let b3 = thdbyte r in
+			rnd_list (n - 3) (b1 :: b2 :: b3 :: acc)
+	in
+	Array.of_list (rnd_list n [])
+
+let read_array dev n = 
+  let ic = open_in_bin dev in
   try
     let result = Array.init n (fun _ -> input_byte ic) in
     close_in ic;
@@ -52,30 +73,14 @@ let uuid_of_int_array uuid =
     uuid.(6) uuid.(7) uuid.(8) uuid.(9) uuid.(10) uuid.(11)
     uuid.(12) uuid.(13) uuid.(14) uuid.(15)
 
-(** Return a new random UUID *)
-let make_uuid() = uuid_of_int_array (read_random 16)
+let make_uuid_prng () = uuid_of_int_array (rnd_array 16)
+let make_uuid_urnd () = uuid_of_int_array (read_array dev_urandom 16)
+let make_uuid_rnd () = uuid_of_int_array (read_array dev_random 16)
+let make_uuid = make_uuid_urnd
 
-(** Return a new random, big UUID (hopefully big and random enough to be
-    unguessable) *)
 let make_cookie() =
-  let bytes = Array.to_list (read_random 64) in
+  let bytes = Array.to_list (read_array dev_urandom 64) in
   String.concat "" (List.map (Printf.sprintf "%1x") bytes)
-(*
-  let hexencode x = 
-    let nibble x =
-      char_of_int (if x < 10 
-		   then int_of_char '0' + x
-		   else int_of_char 'a' + (x - 10)) in
-    let result = String.make (String.length x * 2) ' ' in
-    for i = 0 to String.length x - 1 do
-      let byte = int_of_char x.[i] in
-      result.[i * 2 + 0] <- nibble((byte lsr 4) land 15);
-      result.[i * 2 + 1] <- nibble((byte lsr 0) land 15);
-    done;
-    result in
-  let n = 64 in
-  hexencode (String.concat "" (List.map (fun x -> String.make 1 (char_of_int x)) (Array.to_list (read_n_random_bytes n))))
-*)
 
 let int_array_of_uuid s =
   try
@@ -86,3 +91,10 @@ let int_array_of_uuid s =
              a10; a11; a12; a13; a14; a15; ]);
     Array.of_list !l
   with _ -> invalid_arg "Uuid.int_array_of_uuid"
+
+let is_uuid str =
+	try
+		Scanf.sscanf str
+			"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
+			(fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> true)
+	with _ -> false
tools/ocaml/libs/uuid/uuid.mli +39 -25

86 lines not on this page · raw message

#73 lore raw

PATCH 1/1 ocaml: add dependency to module metadata

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291307719 18000
# Node ID e147f32b385cdebc568992fae9ceb71d958bb169 # Parent 21d9d889ec30f6ac55267c745a1cae56c768f63b
ocaml: add dependency to module metadata.

tools/ocaml/libs/eventchn/META.in +1 -0
diff -r 21d9d889ec30 -r e147f32b385c tools/ocaml/libs/eventchn/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Eventchn interface extension"
+requires = "unix"
 archive(byte) = "eventchn.cma"
 archive(native) = "eventchn.cmxa"
tools/ocaml/libs/log/META.in +1 -0
diff -r 21d9d889ec30 -r e147f32b385c tools/ocaml/libs/log/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Log - logging library"
+requires = "unix"
 archive(byte) = "log.cma"
 archive(native) = "log.cmxa"
tools/ocaml/libs/xb/META.in +1 -0
diff -r 21d9d889ec30 -r e147f32b385c tools/ocaml/libs/xb/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "XenBus Interface"
+requires = "unix,mmap"
 archive(byte) = "xb.cma"
 archive(native) = "xb.cmxa"
tools/ocaml/libs/xc/META.in +1 -0
diff -r 21d9d889ec30 -r e147f32b385c tools/ocaml/libs/xc/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "Xen Control Interface"
+requires = "mmap,uuid"
 archive(byte) = "xc.cma"
 archive(native) = "xc.cmxa"
tools/ocaml/libs/xs/META.in +1 -0
diff -r 21d9d889ec30 -r e147f32b385c tools/ocaml/libs/xs/META.in
@@ -1,4 +1,5 @@
 version = "@VERSION@"
 description = "XenStore Interface"
+requires = "unix,xb"
 archive(byte) = "xs.cma"
 archive(native) = "xs.cmxa"
#74 lore raw

PATCH 1/1 ocaml: evtchn+xc bindings: use libxenctrl and libxenguest

In reply to a message not in the archive

# HG changeset patch
# User root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] # Date 1291307719 18000
# Node ID 5aca7dd0284714d086b62b3504a39b67e23b65e2 # Parent 9ca2fdb9072dceac4f37c9e14d41fdcdcc9be7a9
ocaml: evtchn+xc bindings: use libxenctrl and libxenguest

Now that tools/libxc is licensed under LGPL I don't think there is any need for an LGPL reimplementation under tools/ocaml.

For the most part the conversion to the up-to-date libxc API (xc_lib.c essentially implemented the same interface as an older libxc) was pretty automatic. There are some functions which appear to no longer exist in libxc which I therefore simply removed the bindings for and a small number of interfaces which had changed.

Many of the functions bound by the stubs have no in-tree users (which I think is fine for a language binding) so I have no way to confirm correctness other than by eye. I was however able to confirm that oxenstored still worked and to build a XCP toolstack which could successfully start a PV guest.

Uses the new XC_OPENFLAG_NON_REENTRANT option to avoid potential conflicts between pthreads and the ocaml runtime.

Cc Vincent Hanquez <[email protected]>
tools/ocaml/Makefile.rules +3 -3
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/Makefile.rules
@@ -54,18 +54,18 @@ mk-caml-lib-bytecode = $(call quiet-comm
 
 mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1)
 mk-caml-lib-stubs = \
-	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
+	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $3 $2,MKLIB,$1)
 
 # define a library target <name>.cmxa and <name>.cma
 define OCAML_LIBRARY_template
  $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
-	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs, $(foreach obj,$($(1)_OBJS),$(obj).cmx))
+	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
  $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo)
 	$(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+)
  $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
 	$(call mk-caml-stubs,$$@, $$+)
  lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
-	$(call mk-caml-lib-stubs,$$@, $$+)
+	$(call mk-caml-lib-stubs,$$@, $$+, $(LIBS_$(1)))
 endef
 
 define OCAML_NOC_LIBRARY_template
tools/ocaml/libs/eventchn/eventchn.ml +10 -7
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/eventchn/eventchn.ml
@@ -16,12 +16,15 @@
 
 exception Error of string
 
-external init: unit -> Unix.file_descr = "stub_eventchn_init"
-external notify: Unix.file_descr -> int -> unit = "stub_eventchn_notify"
-external bind_interdomain: Unix.file_descr -> int -> int -> int = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq: Unix.file_descr -> int = "stub_eventchn_bind_dom_exc_virq"
-external unbind: Unix.file_descr -> int -> unit = "stub_eventchn_unbind"
-external read_port: Unix.file_descr -> int = "stub_eventchn_read_port"
-external write_port: Unix.file_descr -> int -> unit = "stub_eventchn_write_port"
+type handle
+
+external init: unit -> handle = "stub_eventchn_init"
+external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+external notify: handle -> int -> unit = "stub_eventchn_notify"
+external bind_interdomain: handle -> int -> int -> int = "stub_eventchn_bind_interdomain"
+external bind_dom_exc_virq: handle -> int = "stub_eventchn_bind_dom_exc_virq"
+external unbind: handle -> int -> unit = "stub_eventchn_unbind"
+external pending: handle -> int = "stub_eventchn_pending"
+external unmask: handle -> int -> unit = "stub_eventchn_unmask"
 
 let _ = Callback.register_exception "eventchn.error" (Error "register_callback")
tools/ocaml/libs/eventchn/eventchn.mli +13 -8
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/eventchn/eventchn.mli
@@ -15,12 +15,17 @@
  *)
 
 exception Error of string
-external init : unit -> Unix.file_descr = "stub_eventchn_init"
-external notify : Unix.file_descr -> int -> unit = "stub_eventchn_notify"
-external bind_interdomain : Unix.file_descr -> int -> int -> int
+
+type handle
+
+external init : unit -> handle = "stub_eventchn_init"
+external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+
+external notify : handle -> int -> unit = "stub_eventchn_notify"
+external bind_interdomain : handle -> int -> int -> int
   = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq : Unix.file_descr -> int = "stub_eventchn_bind_dom_exc_virq"
-external unbind : Unix.file_descr -> int -> unit = "stub_eventchn_unbind"
-external read_port : Unix.file_descr -> int = "stub_eventchn_read_port"
-external write_port : Unix.file_descr -> int -> unit
-  = "stub_eventchn_write_port"
+external bind_dom_exc_virq : handle -> int = "stub_eventchn_bind_dom_exc_virq"
+external unbind : handle -> int -> unit = "stub_eventchn_unbind"
+external pending : handle -> int = "stub_eventchn_pending"
+external unmask : handle -> int -> unit
+  = "stub_eventchn_unmask"
tools/ocaml/libs/eventchn/eventchn_stubs.c +51 -60

170 lines not on this page · raw message

tools/ocaml/libs/xc/Makefile +5 -3
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/xc/Makefile
@@ -2,15 +2,17 @@ TOPLEVEL=../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
-CFLAGS += -I../mmap -I./
-OCAMLINCLUDE += -I ../mmap -I ../uuid
+CFLAGS += -I../mmap -I./ -I$(XEN_ROOT)/tools/libxc
+OCAMLINCLUDE += -I ../mmap -I ../uuid -I $(XEN_ROOT)/tools/libxc
 
 OBJS = xc
 INTF = xc.cmi
 LIBS = xc.cma xc.cmxa
 
+LIBS_xc = -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
+
 xc_OBJS = $(OBJS)
-xc_C_OBJS = xc_lib xc_stubs
+xc_C_OBJS = xc_stubs
 
 OCAML_LIBRARY = xc
 
tools/ocaml/libs/xc/xc.h deleted +0 -186

186 lines not on this page · raw message

tools/ocaml/libs/xc/xc.ml +7 -21
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/xc/xc.ml
@@ -107,7 +107,7 @@ external sizeof_xen_pfn: unit -> int = "
 external interface_open: unit -> handle = "stub_xc_interface_open"
 external interface_close: handle -> unit = "stub_xc_interface_close"
 
-external using_injection: unit -> bool = "stub_xc_using_injection"
+external is_fake: unit -> bool = "stub_xc_interface_is_fake"
 
 let with_intf f =
 	let xc = interface_open () in
@@ -127,9 +127,6 @@ external _domain_sethandle: handle -> do
 let domain_sethandle handle n uuid =
 	_domain_sethandle handle n (Uuid.int_array_of_uuid uuid)
 
-external domain_setvmxassist: handle -> domid -> bool -> unit
-       = "stub_xc_domain_setvmxassist"
-
 external domain_max_vcpus: handle -> domid -> int -> unit
        = "stub_xc_domain_max_vcpus"
 
@@ -165,9 +162,9 @@ external domain_iomem_permission: handle
 external domain_irq_permission: handle -> domid -> int -> bool -> unit
        = "stub_xc_domain_irq_permission"
 
-external vcpu_affinity_set: handle -> domid -> int -> int64 -> unit
+external vcpu_affinity_set: handle -> domid -> int -> bool array -> unit
        = "stub_xc_vcpu_setaffinity"
-external vcpu_affinity_get: handle -> domid -> int -> int64
+external vcpu_affinity_get: handle -> domid -> int -> bool array
        = "stub_xc_vcpu_getaffinity"
 
 external vcpu_context_get: handle -> domid -> int -> string
@@ -207,13 +204,13 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
+external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
        = "stub_xc_domain_cpuid_set"
-external domain_cpuid_apply: handle -> domid -> bool -> unit
-       = "stub_xc_domain_cpuid_apply"
-external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
+external domain_cpuid_apply_policy: handle -> domid -> unit
+       = "stub_xc_domain_cpuid_apply_policy"
+external cpuid_check: handle -> (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
 
 external map_foreign_range: handle -> domid -> int
@@ -230,17 +227,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-(** check if some hvm domain got pv driver or not *)
-external hvm_check_pvdriver: handle -> domid -> bool
-       = "stub_xc_hvm_check_pvdriver"
-
 external version: handle -> version = "stub_xc_version_version"
 external version_compile_info: handle -> compile_info
        = "stub_xc_version_compile_info"
tools/ocaml/libs/xc/xc.mli +7 -19
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/xc/xc.mli
@@ -71,7 +71,7 @@ external sizeof_vcpu_guest_context : uni
   = "stub_sizeof_vcpu_guest_context"
 external sizeof_xen_pfn : unit -> int = "stub_sizeof_xen_pfn"
 external interface_open : unit -> handle = "stub_xc_interface_open"
-external using_injection : unit -> bool = "stub_xc_using_injection"
+external is_fake : unit -> bool = "stub_xc_interface_is_fake"
 external interface_close : handle -> unit = "stub_xc_interface_close"
 val with_intf : (handle -> 'a) -> 'a
 external _domain_create : handle -> int32 -> domain_create_flag list -> int array -> domid
@@ -80,8 +80,6 @@ val domain_create : handle -> int32 -> d
 external _domain_sethandle : handle -> domid -> int array -> unit
   = "stub_xc_domain_sethandle"
 val domain_sethandle : handle -> domid -> 'a Uuid.t -> unit
-external domain_setvmxassist: handle -> domid -> bool -> unit
-  = "stub_xc_domain_setvmxassist"
 external domain_max_vcpus : handle -> domid -> int -> unit
   = "stub_xc_domain_max_vcpus"
 external domain_pause : handle -> domid -> unit = "stub_xc_domain_pause"
@@ -104,9 +102,9 @@ external domain_iomem_permission: handle
        = "stub_xc_domain_iomem_permission"
 external domain_irq_permission: handle -> domid -> int -> bool -> unit
        = "stub_xc_domain_irq_permission"
-external vcpu_affinity_set : handle -> domid -> int -> int64 -> unit
+external vcpu_affinity_set : handle -> domid -> int -> bool array -> unit
   = "stub_xc_vcpu_setaffinity"
-external vcpu_affinity_get : handle -> domid -> int -> int64
+external vcpu_affinity_get : handle -> domid -> int -> bool array
   = "stub_xc_vcpu_getaffinity"
 external vcpu_context_get : handle -> domid -> int -> string
   = "stub_xc_vcpu_context_get"
@@ -147,16 +145,6 @@ external domain_deassign_device: handle 
 external domain_test_assign_device: handle -> domid -> (int * int * int * int) -> bool
        = "stub_xc_domain_test_assign_device"
 
-external domain_set_timer_mode: handle -> domid -> int -> unit = "stub_xc_domain_set_timer_mode"
-external domain_set_hpet: handle -> domid -> int -> unit = "stub_xc_domain_set_hpet"
-external domain_set_vpt_align: handle -> domid -> int -> unit = "stub_xc_domain_set_vpt_align"
-
-external domain_send_s3resume: handle -> domid -> unit
-  = "stub_xc_domain_send_s3resume"
-external domain_get_acpi_s_state: handle -> domid -> int = "stub_xc_domain_get_acpi_s_state"
-
-external hvm_check_pvdriver : handle -> domid -> bool
-  = "stub_xc_hvm_check_pvdriver"
 external version : handle -> version = "stub_xc_version_version"
 external version_compile_info : handle -> compile_info
   = "stub_xc_version_compile_info"
@@ -185,12 +173,12 @@ external domain_set_machine_address_size
 external domain_get_machine_address_size: handle -> domid -> int
        = "stub_xc_domain_get_machine_address_size"
 
-external domain_cpuid_set: handle -> domid -> bool -> (int64 * (int64 option))
+external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
                         -> string option array
                         -> string option array
        = "stub_xc_domain_cpuid_set"
-external domain_cpuid_apply: handle -> domid -> bool -> unit
-       = "stub_xc_domain_cpuid_apply"
-external cpuid_check: (int64 * (int64 option)) -> string option array -> (bool * string option array)
+external domain_cpuid_apply_policy: handle -> domid -> unit
+       = "stub_xc_domain_cpuid_apply_policy"
+external cpuid_check: handle -> (int64 * (int64 option)) -> string option array -> (bool * string option array)
        = "stub_xc_cpuid_check"
 
tools/ocaml/libs/xc/xc_cpufeature.h deleted +0 -116

116 lines not on this page · raw message

tools/ocaml/libs/xc/xc_cpuid.h deleted +0 -285

285 lines not on this page · raw message

tools/ocaml/libs/xc/xc_e820.h deleted +0 -20
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/libs/xc/xc_e820.h
@@ -1,20 +0,0 @@
-#ifndef __XC_E820_H__
-#define __XC_E820_H__
-
-#include <xen/hvm/e820.h>
-
-/*
- * PC BIOS standard E820 types and structure.
- */
-#define E820_RAM          1
-#define E820_RESERVED     2
-#define E820_ACPI         3
-#define E820_NVS          4
-
-struct e820entry {
-    uint64_t addr;
-    uint64_t size;
-    uint32_t type;
-} __attribute__((packed));
-
-#endif /* __XC_E820_H__ */
tools/ocaml/libs/xc/xc_lib.c deleted +0 -1537

1,537 lines not on this page · raw message

tools/ocaml/libs/xc/xc_stubs.c +303 -317

477 lines not on this page · raw message

tools/ocaml/xenstored/Makefile +2 -1
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/xenstored/Makefile

Lines of this file are not shown. View the raw message.

tools/ocaml/xenstored/event.ml +9 -8
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/xenstored/event.ml

Lines of this file are not shown. View the raw message.

tools/ocaml/xenstored/xenstored.ml +5 -5
diff -r 9ca2fdb9072d -r 5aca7dd02847 tools/ocaml/xenstored/xenstored.ml

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#75 lore raw

PATCH 1/1 ocaml: rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virq

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1291307719 18000
# Node ID 9ca2fdb9072dceac4f37c9e14d41fdcdcc9be7a9 # Parent e147f32b385cdebc568992fae9ceb71d958bb169
ocaml: rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virq to reflect it actual behaviour.

tools/ocaml/libs/eventchn/eventchn.ml +1 -1
diff -r e147f32b385c -r 9ca2fdb9072d tools/ocaml/libs/eventchn/eventchn.ml
@@ -19,7 +19,7 @@ exception Error of string
 external init: unit -> Unix.file_descr = "stub_eventchn_init"
 external notify: Unix.file_descr -> int -> unit = "stub_eventchn_notify"
 external bind_interdomain: Unix.file_descr -> int -> int -> int = "stub_eventchn_bind_interdomain"
-external bind_virq: Unix.file_descr -> int = "stub_eventchn_bind_virq"
+external bind_dom_exc_virq: Unix.file_descr -> int = "stub_eventchn_bind_dom_exc_virq"
 external unbind: Unix.file_descr -> int -> unit = "stub_eventchn_unbind"
 external read_port: Unix.file_descr -> int = "stub_eventchn_read_port"
 external write_port: Unix.file_descr -> int -> unit = "stub_eventchn_write_port"
tools/ocaml/libs/eventchn/eventchn.mli +1 -1
diff -r e147f32b385c -r 9ca2fdb9072d tools/ocaml/libs/eventchn/eventchn.mli
@@ -19,7 +19,7 @@ external init : unit -> Unix.file_descr 
 external notify : Unix.file_descr -> int -> unit = "stub_eventchn_notify"
 external bind_interdomain : Unix.file_descr -> int -> int -> int
   = "stub_eventchn_bind_interdomain"
-external bind_virq : Unix.file_descr -> int = "stub_eventchn_bind_virq"
+external bind_dom_exc_virq : Unix.file_descr -> int = "stub_eventchn_bind_dom_exc_virq"
 external unbind : Unix.file_descr -> int -> unit = "stub_eventchn_unbind"
 external read_port : Unix.file_descr -> int = "stub_eventchn_read_port"
 external write_port : Unix.file_descr -> int -> unit
tools/ocaml/libs/eventchn/eventchn_stubs.c +1 -1
diff -r e147f32b385c -r 9ca2fdb9072d tools/ocaml/libs/eventchn/eventchn_stubs.c
@@ -97,7 +97,7 @@ CAMLprim value stub_eventchn_bind_interd
 	CAMLreturn(port);
 }
 
-CAMLprim value stub_eventchn_bind_virq(value fd)
+CAMLprim value stub_eventchn_bind_dom_exc_virq(value fd)
 {
 	CAMLparam1(fd);
 	CAMLlocal1(port);
tools/ocaml/xenstored/event.ml +1 -1
diff -r e147f32b385c -r 9ca2fdb9072d tools/ocaml/xenstored/event.ml
@@ -21,7 +21,7 @@ type t = {
 }
 
 let init () = { fd = Eventchn.init (); virq_port = -1; }
-let bind_virq eventchn = eventchn.virq_port <- Eventchn.bind_virq eventchn.fd
+let bind_dom_exc_virq eventchn = eventchn.virq_port <- Eventchn.bind_dom_exc_virq eventchn.fd
 let bind_interdomain eventchn domid port = Eventchn.bind_interdomain eventchn.fd domid port
 let unbind eventchn port = Eventchn.unbind eventchn.fd port
 let notify eventchn port = Eventchn.notify eventchn.fd port
tools/ocaml/xenstored/xenstored.ml +2 -2
diff -r e147f32b385c -r 9ca2fdb9072d tools/ocaml/xenstored/xenstored.ml
@@ -270,7 +270,7 @@ let _ =
 
 	if cf.restart then (
 		DB.from_file store domains cons "/var/run/xenstored/db";
-		Event.bind_virq eventchn
+		Event.bind_dom_exc_virq eventchn
 	) else (
 		if !Disk.enable then (
 			info "reading store from disk";
@@ -284,7 +284,7 @@ let _ =
 		if cf.domain_init then (
 			let usingxiu = Xc.using_injection () in
 			Connections.add_domain cons (Domains.create0 usingxiu domains);
-			Event.bind_virq eventchn
+			Event.bind_dom_exc_virq eventchn
 		);
 	);
#76 lore raw

PATCH 1/1 HACK: Do not install some stuff which conflicts with out-off-tree XCP versions of the same

In reply to Ian Campbell

# HG changeset patch
# User [email protected]
# Date 1291307719 18000
# Node ID 4030d0d9eb3cdf1f75965190805cf97e1a477602
# Parent 5aca7dd0284714d086b62b3504a39b67e23b65e2
HACK: Do not install some stuff which conflicts with out-off-tree XCP versions of the same.

blktap issue is resolved by proper XCP packaging of the hypervisor tools rather than my rather ad-hoc approach.

ocaml namespacing issues need some more thought, as mentioned in the overall introductory email.

tools/Makefile +3 -3
diff -r 5aca7dd02847 -r 4030d0d9eb3c tools/Makefile
@@ -21,8 +21,8 @@ SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += libaio
 SUBDIRS-$(CONFIG_Linux) += memshr 
-SUBDIRS-$(CONFIG_Linux) += blktap
-SUBDIRS-$(CONFIG_Linux) += blktap2
+#SUBDIRS-$(CONFIG_Linux) += blktap
+#SUBDIRS-$(CONFIG_Linux) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += libaio
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += xenbackendd
@@ -46,7 +46,7 @@ SUBDIRS-$(CONFIG_X86) += debugger/kdd
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 SUBDIRS-$(PYTHON_TOOLS) += python
-SUBDIRS-$(PYTHON_TOOLS) += pygrub
+#SUBDIRS-$(PYTHON_TOOLS) += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 endif
 
tools/blktap2/vhd/lib/Makefile +3 -3
diff -r 5aca7dd02847 -r 4030d0d9eb3c tools/blktap2/vhd/lib/Makefile
@@ -63,9 +63,9 @@ libvhd.a: $(LIB-OBJS)
 
 install: all
 	$(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
-	$(INSTALL_DATA) $(LIBVHD) $(DESTDIR)$(INST-DIR)
-	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
-	ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
+	#$(INSTALL_DATA) $(LIBVHD) $(DESTDIR)$(INST-DIR)
+	#ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
+	#ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
 
 clean:
 	rm -rf *.a *.so* *.o *~ $(DEPS) $(LIBVHD)
tools/ocaml/libs/log/Makefile +4 -3
diff -r 5aca7dd02847 -r 4030d0d9eb3c tools/ocaml/libs/log/Makefile
@@ -32,9 +32,10 @@ syslog.mli : syslog.ml
 
 .PHONY: install
 install: $(LIBS) META
-	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) log
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
+### XXX need resyncing with xen-api-libs
+#	mkdir -p $(OCAMLDESTDIR)
+#	ocamlfind remove -destdir $(OCAMLDESTDIR) log
+#	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
#77 lore raw

Re: [PATCH 0 of 5] XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-unstable.hg

In reply to Ian Campbell
Quoted 8 lines · Ian Campbell

The following series of patches lays some ground work to enable XCP to move, at some point in the future, to the in-tree ocaml bindings which will come with Xen 4.1

This is the xen-unstable.hg portion.

All but the last patch are intended for immediate consideration.

Vincent, do you have any comments on these?

#78 lore raw

Re: [PATCH 0 of 5] XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-unstable.hg

Quoted 1 line · Stefano Stabellini

Vincent, do you have any comments on these?

Not much. Personally I think it would be better that xcext is folded in xc. It just make the moving to upstream module more transparent, and the convergence quicker.

It's also probably required that libxl knows to use stuff that have been left in xcext if XCP/XCI is ever going to use it.

Signature · 1 line
Vincent
#79 lore raw

Re: [PATCH 0 of 5] XCP: Allow XCP to use ocaml library bindings in Xen unstable (which will become Xen 4.1) -- xen-unstable.hg

Quoted 9 lines · Vincent Hanquez
Quoted 1 line · Stefano Stabellini

Vincent, do you have any comments on these?

Not much. Personally I think it would be better that xcext is folded in xc. It just make the moving to upstream module more transparent, and the convergence quicker.

It's also probably required that libxl knows to use stuff that have been left in xcext if XCP/XCI is ever going to use it.

The stuff in xcext depends on features/interfaces which are only in the XCP hypervisor patch queue and not upstream which is why I didn't add the support upstream libxc.

When those hypervisor patches get upstreamed then the bindings should be added to upstream libxc (or possibly libxl in some cases) at that time. Certainly the intention should be that xcext disappears with time.

In the meantime perhaps it would make sense to add patches to the XCP patch queue to add those features to libxc there instead of having xcext.

I think some of xcext might also be obsolete and doesn't do anything on modern hypervisors but I didn't check that closely.

Ian.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#81 lore raw

Re: [PATCH 1 of 5] ocaml: resynchronise uuid library with xen-api-libs.hg

Ian Campbell writes ("[Xen-devel] [PATCH 1 of 5] ocaml: resynchronise uuid library with xen-api-libs.hg"):

Quoted 1 line

ocaml: resynchronise uuid library with xen-api-libs.hg

After I applied 1-4 of this series, I got this compile error:

cc1: warnings being treated as errors
xc_stubs.c: In function 'stub_xc_interface_is_fake':
xc_stubs.c:128: error: implicit declaration of function 'xc_interface_is_fake' make[7]: *** [xc_stubs.o] Error 1
make[7]: Leaving directory `/u/iwj/work/xen-unstable-tools.hg/tools/ocaml/libs/xc' make[6]: *** [subdir-install-xc] Error 2
make[6]: Leaving directory `/u/iwj/work/xen-unstable-tools.hg/tools/ocaml/libs'

Perhaps this needs to come after your giant libxc evtchn series ?

Ian.

#82 lore raw

Re: [PATCH 1 of 5] ocaml: resynchronise uuid library with xen-api-libs.hg

In reply to a message not in the archive

Ian Campbell writes ("[Xen-devel] [PATCH 1 of 5] ocaml: resynchronise uuid library with xen-api-libs.hg"):

Quoted 1 line

ocaml: resynchronise uuid library with xen-api-libs.hg

Thanks, I have applied 1-4 from this series.

Ian.