summaryrefslogtreecommitdiffstats
path: root/ocaml/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* build: xml-light is no longer required (thanks Maxim Koltsov).Richard W.M. Jones2010-11-111-13/+11
| | | | | | At some point we removed the last thing that required xml-light, but were still testing for it at various places in the build. This removes all traces.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit changes the generator so that optional arguments can be supported for functions. The model for arguments (known as the "style") is changed from (ret, args) to (ret, args, optargs) where optargs is a more limited list of arguments. One function has been added which takes optional arguments, it is "add-drive-opts", modelled as: (RErr, [String "filename"], #required [Bool "readonly"; String "format"; String "iface"]) #optional Note that this function is processed in the library (does not go over the RPC protocol to the daemon). This has allowed us to simplify the current implementation by omitting changes related to RPC or the daemon, although we plan to add these at some point in the future. From C this function can be called in 3 different ways as in these examples: guestfs_add_drive_opts (g, filename, GUESTFS_ADD_DRIVE_OPTS_READONLY, 1, GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -1); (the argument(s) between 'filename' and '-1' are the optional ones). guestfs_add_drive_opts_va (g, filename, args); where 'args' is a va_list. This works like the first version. struct guestfs_add_drive_opts_argv optargs = { .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK, .readonly = 1, } guestfs_add_drive_opts_argv (g, filename, &optargs); This last form lets you construct lists of optional arguments, and is used by guestfish and the language bindings. In guestfish optional arguments are used like this: add-drive-opts filename readonly:true In OCaml these are mapped naturally to OCaml optional arguments, eg: g#add_drive_opts ~readonly:true filename; In Perl these are mapped to extra arguments, eg: $g->add_drive_opts ($filename, readonly => 1); In Python these are mapped to optional arguments, eg: g.add_drive_opts ("file", readonly = 1, format = "qcow2") In Ruby these are mapped to a final hash argument, eg: g.add_drive_opts("file", {}) g.add_drive_opts("file", :readonly => 1) g.add_drive_opts("file", :readonly => 1, :iface => "virtio") In PHP these are mapped to extra parameters. This is not quite accurate since you cannot omit arbitrary optional parameters, but there's not much than can be done within the limitations of PHP as a language. Unimplemented in: Haskell, C#, Java.
* ocaml: Add test for progress notification callbacks.Richard Jones2010-09-011-2/+8
|
* Remove old ocaml-inspector code.Richard Jones2010-08-171-10/+3
| | | | | Not used by anyone, didn't work well, and replaced now by the C inspection APIs.
* ocaml: Fix thread safety of strings in bindings (RHBZ#604691).Richard Jones2010-06-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | There's a thread safety issue with the current OCaml bindings which is well explained in the bug report: https://bugzilla.redhat.com/show_bug.cgi?id=604691 This commit fixes the safety issue by copying strings temporarily before releasing the thread lock. Updated code looks like this: char *filename = guestfs_safe_strdup (g, String_val (filenamev)); int r; caml_enter_blocking_section (); r = guestfs_add_drive_ro (g, filename); caml_leave_blocking_section (); free (filename); if (r == -1) ocaml_guestfs_raise_error (g, "add_drive_ro"); Also included is a regression test.
* Remove separate inspector_generator.ml, combine this with generator.ml.Richard Jones2009-12-311-0/+2
| | | | | | | | | | | This commit combines the previously separate "inspector_generator.ml" program which generated bindings for virt-inspector. Having two separate programs caused no end of troubles for developers, so we now combine them into a single program. NOTE: OCaml xml-light is now *required* in order to rebuild the generated code.
* build: Fix inter-directory dependenciesMatthew Booth2009-11-191-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an explicit dependency on generator.ml for every file it generates, except java files. Java is left for another time because it's considerably trickier. It also adds a build rule for src/libguestfs.la so it can be rebuilt as required from other directories. It does this by creating a top level make file, subdir-rules.mk, which can be included from sub-directories. sub-directories need to define 'generator_built' to include local files which are built by generator.ml, and they will be updated automatically. This fixes parallel make, and will automatically re-create generated files when make is run from any directory. It also fixes the problem which efad4f53 was targetting. Specifically, src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and therefore generator.ml, despite not being directly created by it. This caused them to be recreated every time generator.ml ran rather than only when src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore appliance update. This patch also changes the contents of the distribution tarball by including files created by rpcgen.
* ocaml: Sort the dependencies so they are stable between machines.Richard W.M. Jones2009-11-061-1/+1
|
* inspector: Generate language bindings for OCaml.Richard Jones2009-10-131-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a generic mechanism for deriving language bindings for virt-inspector, and implements one concrete binding, for OCaml. The bindings are generated from the RELAX NG schema (virt-inspector.rng) which is supposed to be a correct and always up to date description of the XML that the virt-inspector program can generate. From the RNG we generate a set of types to describe the output of virt-inspector for the language, plus an XML parser, plus some glue code to actually run an external instance of virt-inspector and parse the resulting XML. At runtime, an external 'virt-inspector --xml <name>' command runs and the XML is parsed into language-specific structures. This has been tested on the four example files (inspector/example?.xml) The only particular difficulty about the OCaml binding is the use of Obj.magic, which is naughty but works because of the isomorphism between the representation of tuples and records in OCaml. This seems to cause no problems in my test program. Apart from this, the OCaml binding is straightforward and could be adapted easily for any other languages that want type-safe virt-inspector bindings. It's important to keep virt-inspector.rng up to date with changes to virt-inspector's XML output format.
* build: avoid parallel ocaml/... build failureJim Meyering2009-10-051-2/+0
| | | | | | | | A parallel build could fail due to the use in ocaml/examples of ocaml/guestfs.cmi before it was built. * Makefile.am (SUBDIRS): Add both ocaml and ocaml/examples, to ensure they're built in this order, and not in parallel. * ocaml/Makefile.am (SUBDIRS): Don't define.
* build: enable gcc warnings in capitests/ and ocaml/Jim Meyering2009-08-271-1/+2
| | | | | * capitests/Makefile.am: Use $(WARN_CFLAGS) and $(WERROR_CFLAGS). * ocaml/Makefile.am:: Likewise.
* build: don't emit trailing blanks, remove generated fileJim Meyering2009-08-041-2/+3
| | | | | | * ocaml/Makefile.am (.depend): Don't redirect directly to $@. Filter out trailing blanks. * ocaml/.depend: Regenerate.
* build: add -I option to get config.h.Jim Meyering2009-08-031-2/+5
| | | | | * ocaml/Makefile.am (AM_CPPFLAGS): Define. (guestfs_c.o, guestfs_c_actions.o): Use it.
* ocaml: Rebuild the tests from source if the main library changes.Richard Jones2009-07-291-0/+5
|
* Fix non-srcdir builds: further fixes to OCaml build rules.Richard Jones2009-07-171-0/+1
|
* Fix non-srcdir builds: fix OCaml build rules.Richard Jones2009-07-161-5/+5
|
* Miscellaneous fixes for non-srcdir builds.Richard Jones2009-07-161-3/+3
|
* Make it possible to build in a separate directoryMatthew Booth2009-07-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
* Add 'readdir' call.Richard W.M. Jones2009-07-021-2/+7
| | | | | | | | | | | | This adds a readdir call (mostly intended for programs). The return value is a list of guestfs_dirent structures. This adds the new types 'struct guestfs_dirent' and 'struct guestfs_dirent_list', along with all the code to return these in the different language bindings. Also includes additional tests for OCaml and Perl bindings to test this.
* No parallel make in ocaml/ directory (RHBZ#502309).Richard Jones2009-06-021-0/+4
|
* Add tests for bindings parameters, fix several broken bindings.Richard W.M. Jones2009-05-281-2/+9
|
* Move the appliance and build scripts into new appliance/ subdirectory.Richard W.M. Jones2009-05-281-1/+1
|
* abs_top_builddir doesn't exist in old RHEL 5 automake, use top_builddir instead.Richard Jones2009-05-271-3/+3
|
* Add 'make valgrind' target to run tests under valgrind.Richard Jones2009-05-091-1/+2
|
* build: don't tell "make clean" to remove my '~' backup filesJim Meyering2009-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi Rich, automake's policy on what to remove via "make clean" is reasonable: if running build rules creates it, then "make clean" can and should remove it. However, even if build rules happen to create backup files, please remove only the specific ones they can create, not all of the ones in a directory. Just in case someone relies on those and expect them to hang around... >From 1e8be391ac17b4ddcf9671e8413d2660844e6993 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Thu, 30 Apr 2009 15:47:52 +0200 Subject: [PATCH] build: don't tell "make clean" to remove my '~' backup files * Makefile.am (CLEANFILES): Don't remove '~' backup files. * daemon/Makefile.am: Ditto. * examples/Makefile.am: Ditto. * fish/Makefile.am: Ditto. * images/Makefile.am: Ditto. * inspector/Makefile.am: Ditto. * java/Makefile.am: Ditto. * ocaml/Makefile.am: Ditto. * ocaml/examples/Makefile.am: Ditto. * perl/Makefile.am: Ditto. * python/Makefile.am: Ditto. * ruby/Makefile.am: Ditto. * src/Makefile.am: Ditto.
* Missing dependency.Richard Jones2009-04-131-3/+3
|
* Extra CLEANFILES.Richard Jones2009-04-131-1/+1
|
* Additional test programs for Perl, Python, OCaml bindings.Richard Jones2009-04-131-1/+21
|
* OCaml bindings build using the installed, not built, library.Richard Jones2009-04-131-3/+3
|
* Remove *~ files when doing 'make clean'.Richard Jones2009-04-091-0/+2
|
* Added OCaml examples.Richard Jones2009-04-081-0/+2
|
* OCaml bindings compile.Richard Jones2009-04-081-2/+2
|
* Version 0.5: Numerous small fixes to make rpmbuild work again.0.5Richard Jones2009-04-081-4/+7
|
* Need to distribute OCaml bits even if OCaml not found.Richard Jones2009-04-081-2/+2
|
* Outline OCaml bindings.Richard Jones2009-04-071-0/+46
|
* Added framework for the language bindings.Richard Jones2009-04-071-0/+16