summaryrefslogtreecommitdiffstats
path: root/ocaml
Commit message (Collapse)AuthorAgeFilesLines
* build: don't use automake-internal variableJim Meyering2012-01-231-2/+2
| | | | | | | | | | | | | | | | | Hi Rich, I realized a day or two late that my suggestion was not quite right. Here's the fix: >From 5294c21cf07c4ec2f094182ba9f32696f3de2751 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 23 Jan 2012 10:01:40 +0100 Subject: [PATCH libguestfs] build: don't use automake-internal variable * ocaml/Makefile.am (mlguestfs.cma): Use the documented variable form, $(libguestfsocaml_a_OBJECTS), not the $(am_libguestfsocaml_a_OBJECTS) that I suggested for commit 1.15.16-17-g8b9eaec. (cherry picked from commit 70070cf24420bee01770da2897d2ca32e3183181)
* Fixed out-of-tree compilation of OCaml code after .depend files removalHilko Bengen2012-01-231-4/+5
| | | | (cherry picked from commit 251c6e994de97d9e87a0ace01144c12366e12c2b)
* ocaml: Use automake to build the C part of the bindings.Richard W.M. Jones2012-01-231-18/+21
| | | | | | By arranging the C part of the bindings into a library, we can get automake to build it instead of using $(CC) directly. (cherry picked from commit 8b9eaec993e3199ff4ef1056abe2f18cbed1289b)
* ocaml: Don't include guestfs-internal.h directly.Richard W.M. Jones2012-01-231-2/+0
| | | | | | | However since the OCaml bindings use guestfs_safe_strdup and guestfs_safe_memdup we need to export those two (in the private functions section) from <guestfs.h>. (cherry picked from commit 607784df926aeb9293dbeb346f45d93907c7ffa2)
* build: Remove .depend files from gitMatthew Booth2012-01-232-6/+1
| | | | | | Remove generated .depend files from source control, and don't barf when they don't exist while bootstrapping. (cherry picked from commit f6db1ec41050e70580674ebbeb8fac5335df3284)
* ocaml: Fix OCaml dependencies.Richard W.M. Jones2011-12-021-2/+2
| | | | (cherry picked from commit ce331df0f1857bccebaaddfac79677bc9f527197)
* ocaml: Load test should call Gc.compact to flag memory errors.Richard W.M. Jones2011-12-021-0/+2
| | | | (cherry picked from commit 082a55f76cd61f3590976f6b095552ea65259ced)
* ocaml: Memory leak: Free roots array along handle close path.Richard W.M. Jones2011-12-021-0/+1
| | | | (cherry picked from commit c5dbb1e63a8e0c45c7088dd2e58f5abbcfc30620)
* ocaml: Compile OCaml bindings and tests with -warn-error.Richard W.M. Jones2011-11-091-12/+15
| | | | (cherry picked from commit 145ed04e41a3fcd3be87c11cae0085f4551f1da8)
* ocaml: Catch EVENT_ENTER case in test.Richard W.M. Jones2011-11-091-1/+2
| | | | | | | | For some reason we are not compiling the tests with -warn-error so this problem was not noticed before. This fixes commit 9420eaf44ec4067c3740b91b0be0fede08a0c515. (cherry picked from commit 22c72b911e65b93cfd049f42e6bd1b9ad7d55299)
* Update FSF address.Matthew Booth2011-11-099-9/+9
| | | | (cherry picked from commit 04ea1375c55aa67df4e7fc61dbb534111767f3b6)
* out-of-tree build: fixed bindtests and inspectorHilko Bengen2011-10-211-1/+1
|
* Add Erlang bindings.Richard W.M. Jones2011-09-211-0/+1
|
* Stable OCaml dependencies.Richard Jones2011-09-121-1/+4
|
* out-of-tree build: fix make and make installHilko Bengen2011-08-171-2/+2
| | | | | $(srcdir) is not needed for guestfs_c.c. *.mli only exists in $(srcdir) and isn't found on "make install" otherwise
* out-of-tree build: Fix up OCaml bindings and generatorHilko Bengen2011-08-151-11/+11
|
* out-of-tree build: fix documentation generationHilko Bengen2011-08-151-3/+3
|
* build: Set TMPDIR for local testing.Richard W.M. Jones2011-08-081-0/+1
| | | | | | This avoids conflicts with the globally installed libguestfs appliance, or lets us build in multiple local directories at the same time without conflicts.
* ocaml: Fix locking in event callbacks.Richard W.M. Jones2011-07-261-9/+27
| | | | | | | | We weren't acquiring the GC lock around some allocations, resulting in segfaults when an event callback ran at the same time as a main thread allocation or garbage collection. In particular this fixes a noticable crash in guestfs-browser.
* java: Add guestfs-java(3) man page.Richard W.M. Jones2011-07-191-0/+1
|
* ocaml: Generate ocamldoc.Richard W.M. Jones2011-07-172-1/+14
| | | | Also includes improvements to the OCaml documentation.
* ocaml: Bind guestfs_last_errno.Richard W.M. Jones2011-07-161-0/+19
|
* ocaml: Add binding for guestfs_user_cancel.Richard W.M. Jones2011-07-151-0/+11
|
* Add new guestfs-rescue(1) man page with recipes.Richard W.M. Jones2011-05-181-0/+1
|
* New event API - OCaml bindings (RHBZ#664558).Richard W.M. Jones2011-03-155-43/+241
| | | | | | The functions set_progress_callback and clear_progress_callback have been removed, and replaced with a complete mechanism for setting and deleting general-purpose events.
* perl: Translate C examples into Perl and include a manual page.Richard W.M. Jones2011-01-301-0/+1
|
* fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).Richard W.M. Jones2011-01-111-1/+5
| | | | | | | | | | | | | | | | | Fix guestfish (and other C tools) so that they ignore errors when /etc/fstab contains bogus entries. Update the documentation for inspect-get-mountpoints to emphasize that callers must be aware of this when mounting the returned values. Add a regression test. Update the example code ("inspect_vm") to reflect the way this API ought to be called. For more detail see: https://bugzilla.redhat.com/show_bug.cgi?id=668574
* ocaml: Combine tests together to reduce number of launches.Richard W.M. Jones2010-11-304-98/+31
| | | | | | Combine launch, lvcreate and readdir tests together into a single 'basic' test, so that we don't launch the appliance so often when testing in this subdirectory.
* ruby: Translate C examples into Ruby and include documentation.Richard W.M. Jones2010-11-241-0/+1
|
* python: Translate C examples into Python and include documentation.Richard W.M. Jones2010-11-241-0/+1
|
* ocaml: Translate C examples into OCaml and include documentation.Richard W.M. Jones2010-11-247-48/+286
|
* ocaml: Fix some unused parameter warnings in OCaml bindings.Richard W.M. Jones2010-11-232-1/+11
|
* build: xml-light is no longer required (thanks Maxim Koltsov).Richard W.M. Jones2010-11-112-15/+13
| | | | | | 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.
* Revert "Remove ocaml/.depend from git."Richard Jones2010-11-081-0/+5
| | | | | | | | | This reverts commit 064569bcbf854a9cf588ce31851d987d5f114ec8. This commit does the wrong thing: creating an empty ocaml/.depend file is wrong because building the OCaml bindings will fail. Not having this file will prevent automake from running. Therefore this file has to exist with the correct content in git.
* ocaml: Remove the old OCaml viewer program.Richard W.M. Jones2010-11-087-752/+1
| | | | | | This program is obsolete and the code has been reused for guestfs-browser here: http://people.redhat.com/~rjones/guestfs-browser/
* Remove ocaml/.depend from git.Matthew Booth2010-10-281-5/+0
| | | | ocaml/.depend is automatically generated. This patch removes it from git.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-223-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Create the handle when the object is instantiated.Richard W.M. Jones2010-10-041-1/+1
| | | | | Previously we had only one handle shared between all objects .. oops. This fixes commit 67636f721056d2f2250b0ff8acd981a0294536a9.
* ocaml: Add alternate object-oriented programming style.Richard W.M. Jones2010-10-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | In original style: let () = let filename = Sys.argv.(1) in let g = Guestfs.create () in Guestfs.add_drive_ro g filename; Guestfs.launch g; let roots = Guestfs.inspect_os g in print_endline (Guestfs.inspect_get_product_name g roots.(0)) The same code in the new OO style: let () = let filename = Sys.argv.(1) in let g = new Guestfs.guestfs in g#add_drive_ro filename; g#launch (); let roots = g#inspect_os () in print_endline (g#inspect_get_product_name roots.(0))
* Update OCaml dependencies.Richard Jones2010-09-101-3/+0
|
* ocaml: Add test for progress notification callbacks.Richard Jones2010-09-012-2/+49
|
* ocaml: bindings to progress callback.Richard Jones2010-09-011-2/+91
|
* Remove old ocaml-inspector code.Richard Jones2010-08-172-52/+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-164-11/+89
| | | | | | | | | | | | | | | | | | | | | | 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.
* ocaml examples: Fix linking line so it uses local library.Richard Jones2010-03-221-1/+1
|
* 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.
* Generic partition creation interface.Richard Jones2009-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a generic partition creation interface which should be future-proof and extensible, and partially replaces the old sfdisk-based interface. The implementation is based on parted but is hopefully not too dependent on the particulars of parted. The following new calls are introduced: guestfs_part_init: Initialize a disk with a partition table. Unlike the sfdisk- based interface, we also support GPT and other partition types, which is essential to scale to devices larger than 2TB. guestfs_part_add: Add a partition to an existing disk. guestfs_part_disk: Convenience function which combines part_init & part_add, creating a single partition that covers the whole disk. guestfs_part_set_bootable: guestfs_part_set_name: Set various aspects of existing partitions. guestfs_part_list: List partitions on a device. This returns a programming-friendly list of partition structs (in contrast to sfdisk-l which cannot be parsed). guestfs_part_get_parttype: Return the partition table type, eg. "msdos" or "gpt". The following calls are planned, but not added currently: guestfs_part_get_bootable guestfs_part_get_name guestfs_part_set_type guestfs_part_get_type
* ocaml: Update dependencies file.Richard Jones2009-11-091-4/+4
|
* ocaml: Sort the dependencies so they are stable between machines.Richard W.M. Jones2009-11-062-4/+4
|