Commit Graph
238 Commits
Author SHA1 Message Date
Wei Gang 3b45ec8c70 tools/ocaml: fix a typo in xc_lib.c:xc_domain_set_vpt_align
Fix a typo in xc_lib.c.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:16:07 +00:00
Ian Campbell dd13d5775a 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 variabe 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.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-23 19:28:03 +00:00
Gianni Tedesco 9de2eedc20 ocaml: Makefile: delete dependency files during make clean
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-28 11:46:20 +01:00
Gianni Tedesco 6d01f35315 xl: Fix build in python binding since API change in 22229:1385b15e168f
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-10-08 11:41:57 +01:00
Gianni Tedesco 7c12b60534 libxl: change IDL to export a saner interface for upcoming language bindings
Firstly remove an anonymous union in libxl_device_pci structure which
was making auto-generating language bindings more complicated than
necessary and exporting random bits of low level ABI that libxl that
would rather hide anyway. There is a corresponding (untested) change to
the ocaml binding which maintains previous ml API.

Secondly make the libxl_file_reference type a Builtin. This is a
'semantic
correctness' issue in that libxl ABI/API won't change. But it makes it
so that when the IDL is used to generate language bindings that a
file_reference type is not exported.

Also implement a Numeric type which all integers are derived from. Make
sure a boolean signed/unsigned attribute is set accordingly. This is
required to allow language bindings to correctly handle the sign bit in
environments with arbitrarily long integers.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-16 17:12:21 +01:00
Vincent Hanquez c528148dd3 oxenstored: when reading / read automatically the root node.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-09-10 19:01:31 +01:00
Gianni Tedesco 785684b4fd xl: randomly generate UUIDs
This patch converts xl to randomly generate UUID's rather than using a
dodgy time-seeded PRNG. I have ignored various suggestions so far on
auto-generation of MAC addresses and left it as a topic for a future
patch to solve. In other words the behaviour stays the same it's just
using a true random source. This patch also implements the "uuid" config
file parameter in xl.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-02 18:12:14 +01:00
Stefano Stabellini ce8ffdb551 tools: xenconsole[d] and libxl: multiple console support
This patch implements the new protocol for handling pv consoles and
emulated serials as described in the document docs/misc/console.txt.

The changes are:

- xenconsoled: do not write the pty under serial in xenstore if
xenconsoled is handling a consolepath;

- xenconsole: implement support for an explicit console type parameter;
the parameter can be "pv", to specify that the user wants to
connect to a pv console, or "serial", to specify that the user wants to
connect to an emulated serial. If the type parameter hasn't been
specified be the user, xenconsole tries to guess which type of console
it has to connect to, defaulting to pv console for pv guests and
emulated serial for hvm guests.

- xenconsole: use the new xenstore paths;

- libxl: rename libxl_console_constype to libxl_console_consback:
constype is used to to specify whether qemu or xenconsoled provides the
backend, so I renamed it to libxl_console_consback to make it more
obvious that we are talking about backends;

- libxl: add a new libxl_console_constype to specify if the console is
an emulated serial or a pv console;

- libxl: support the new xenconsole "type" command line parameter;

- libxl: use the "output" node under console in xenstore to tell qemu
where do we want the output of this pv console to go;

- remove the legacy "serialpath" from xenconsoled altogether

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>


Also: update the QEMU_TAG to pull in the qemu part of these changes.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-16 13:32:04 +01:00
Stefano Stabellini 2386f0ac18 always drop the caml lock during any xl operations
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-08-10 15:32:12 +01:00
Stefano Stabellini 52be445541 use new gc functions to deep copy structure and only free once the gc
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-08-10 15:31:55 +01:00
Stefano Stabellini 4456c54026 use new functions to get elements out of ocaml values
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-08-10 15:31:37 +01:00
Stefano Stabellini 6a1a729da6 Wrap init context procedure into a macro. Introduce a gc structure.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-08-10 15:31:03 +01:00
Stefano Stabellini e59af47a01 Put a valid version number in the META files
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-08-10 15:30:36 +01:00
Ian Campbell 528ad3b6e2 libxl: consistently use typedef struct {} libxl_$type
typedef struct seems to be the dominant idiom in the mixture currently
in use.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-28 16:18:44 +01:00
Ian Jackson 108be15853 libxl: support mapping files rather than carrying paths around
This will allow us to map and then unlink the file and therefore
delete the process on process exit or explicit unmap.

Using the mmaped versions of these files required rewriting build_pv
to use the xc_dom builder functionality directly rather than through
the xc_linux_build "compatibility layer". (The status of the
xc_linux_build interface as a compatibility layer seems a bit dubious
since all existing callers use it but if anything is going to replace
it then libxl seems like the likely candidate).

I'm not thrilled with the definition of the maps lifecycle. This could
be solved by adding a helper function to explicitly free the toplevel
structure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:43:49 +01:00
Ian Jackson c89747d2e9 tools/ocaml: add the missing license file that all OCaml libs refer to
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-14 16:32:47 +01:00
Ian Jackson d524f866ca tools/ocaml: Properly adjust fields in ocaml structure to match the C layer.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:28:13 +01:00
Ian Jackson e94b5fc097 tools/ocaml: add a simple logger to the ocaml bindings
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:27:50 +01:00
Ian Jackson e4f42ed7ec tools/ocaml: register the ocaml exception so it can be used at the C level.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:27:33 +01:00
Ian Jackson 62996c01c1 tools/ocaml: Fix up ocaml build for timer_mode, hpet and vpt_align
c/s da46b25cf17d broke the ocaml build.  This fixes it.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-06 17:31:04 +01:00
Ian Jackson 2157eba42a tools/xenstore: add XS_RESTRICT operation to C xenstore client libs.
The OCaml xenstored supports the XS_RESTRICT operation, which
deprivileges a dom0 xenstore connection so it can only affect one
domain's entries.   Add the relevant definitions to the C libraries
so that callers can use it.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-06 11:57:20 +01:00
Ian Jackson ce9f534104 tools/ocaml: libxl ocaml bindings
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-06-29 15:15:57 +01:00
Ian Jackson 7bbf69bc87 tools/ocaml: Add .NOTPARALLEL to Makefile
tools/ocaml was capable of descending into lib/* and xenstored/
simultaneously, obviously with poor results.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-28 17:35:10 +01:00
Ian Jackson d5da15306f ocaml: remove bogus /dev/xen/ev[en]tchn
Oxenstored should not try to create the evtchn device, as it:

    * creates the wrong name (/dev/xen/eventchn rather than evtchn)
    * uses a hard-coded minor number, even though this dynamically
      depends on what other misc devices are in the kernel

Remove all this code and just rely on the system to create the device.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-06-24 12:45:32 +01:00
Keir Fraser ceba28edd5 ocaml: fix ocaml xc compilation on 32 bit
cc1: warnings being treated as errors
  xc_lib.c: In function 'xc_domain_get_pfn_list':
  xc_lib.c:1217: error: assignment from incompatible pointer type

The XEN_DOMCTL_getmemlist interface has been 32/64 invariante since
13594:30af6cfdb05c and uint64_t is now the correct type for the PFN
list on all word sizes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-05-20 14:12:14 +01:00
Keir Fraser f061878fab ocaml: Disable parallel make
There seem to be multiple dependency issues when building oxenstored.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-17 10:54:46 +01:00
Keir Fraser eb8d759136 ocaml: NetBSD support and general CFLAGS cleanup
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-07 19:08:55 +01:00
Keir Fraser 80e279223b ocaml: Add -Werror to CFLAGS and fix resulting errors.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-07 09:13:59 +01:00
Keir Fraser 53f89553da ocam: add missing files that got lost in the v2 shuffle
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-07 08:46:51 +01:00
Keir Fraser abe6f86669 ocaml: Fix C include paths in Makefile
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-07 08:46:07 +01:00
Keir Fraser 12d39540c8 ocaml: Fix Makefile for parallel build.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-07 08:43:51 +01:00
Keir Fraser d236f2c244 ocaml: Add Makefile rules.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:05:22 +01:00
Keir Fraser f44af66041 ocaml: Add xenstored implementation.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:04:39 +01:00
Keir Fraser ea8ddf27e5 ocaml: add logging bindings.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:04:02 +01:00
Keir Fraser dc9a6e6274 ocaml: add uuid bindings.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:03:28 +01:00
Keir Fraser c3afd398ba ocaml: Add XS bindings.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:02:54 +01:00
Keir Fraser 8b7ce06a2d ocaml: Add XC bindings.
This include a small and simpler reimplementation of libxc.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:02:18 +01:00
Keir Fraser d3e649277a ocaml: add mmap bindings implementation.
This is quite similar to the mmap functionality available in bigarray
but it's less complicated.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-05-06 11:01:31 +01:00