summaryrefslogtreecommitdiffstats
path: root/ocaml
Commit message (Collapse)AuthorAgeFilesLines
* Add Lua bindings.Richard W.M. Jones2012-11-171-0/+1
| | | | | | | | These are relatively complete, although only lightly tested. Missing: - events - last_errno - user_cancel
* tests: Replace 'make extra-tests' with individual tests.Richard W.M. Jones2012-11-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 'make extra-tests' was a monolithic set of tests that did all sorts of things: valgrind, tests over local guests, tests with upstream qemu, tests with upstream libvirt, tests with the appliance attach method. This made it hard to perform individual tests, eg. just valgrind testing. It was also hard to maintain because the tests were not located in the same directories as the programs and sometimes duplicated tests that were run elsewhere. This commit splits up 'make extra-tests' into 5 separate targets: make check-valgrind # run a subset of tests under valgrind make check-valgrind-local-guests # test under valgrind with local guests make check-with-appliance # test with attach-method == appliance make check-with-upstream-qemu # test with an alternate/upstream qemu make check-with-upstream-libvirt # test with an alternate/upstream libvirt (You can also still run 'make extra-tests' which is now simply a rule that runs the above 5 targets in order). This replaces everything that was in the tests/extra directory, so that has now gone.
* ocaml: Get rid of CAMLprim.Richard W.M. Jones2012-10-151-8/+8
| | | | It's wrong to use it, and in any case it doesn't do anything on Linux.
* New APIs: guestfs_create_flags, guestfs_parse_environment,Richard W.M. Jones2012-10-151-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | guestfs_parse_environment_list. Add a new function for creating a handle: guestfs_h *guestfs_create_flags (unsigned flags [, ...]); This variant lets you supply flags and extra arguments, although extra arguments are not used at the moment. Of particular interest is the ability to separate the creation of the handle from the parsing of environment variables like LIBGUESTFS_DEBUG. guestfs_create does both together, which prevents us from propagating errors from parsing environment variables back to the caller (guestfs_create has always printed any errors on stderr and then just ignored them). If you are interested in these errors, you can now write: g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT); if (!g) exit (EXIT_FAILURE); r = guestfs_parse_environment (g); if (!r) exit (EXIT_FAILURE); Also you can *omit* the call to guestfs_parse_environment, which creates a handle unaffected by the environment (which was not possible before). This commit also includes new (backwards compatible) changes to the OCaml, Perl, Python, Ruby and Java constructors that let you use the flags.
* New APIs: Model libvirt authentication events through the API.Richard W.M. Jones2012-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | This commit models libvirt authentication events through the API, adding one new event (GUESTFS_EVENT_LIBVIRT_AUTH) and several new APIs: guestfs_set_libvirt_supported_credentials guestfs_get_libvirt_requested_credentials guestfs_get_libvirt_requested_credential_prompt guestfs_get_libvirt_requested_credential_challenge guestfs_get_libvirt_requested_credential_defresult guestfs_set_libvirt_requested_credential See the documentation and example which shows how to use the new API. This commit also changes existing calls to virConnectOpen* within the library so that the new API is used. Also included is an example (but not a test, because it's hard to see how to automatically test the libvirt API).
* podwrapper: Add --license parameter, which is required.Richard W.M. Jones2012-08-211-0/+1
| | | | | | | | | | This adds standard LICENSE and BUGS sections to all of the man pages that are processed by podwrapper. Modify all the calls to $(PODWRAPPER) to add the right --license parameter according to the content. Note that this relaxes the license on some code example pages, making them effectively BSD-style licensed.
* man pages: Ensure consistent copyright/author sections, remove licenseRichard W.M. Jones2012-08-211-18/+1
| | | | | | | | | | section. Ensure each man page contains consistent COPYRIGHT and AUTHOR sections. Remove the LICENSE section. We will add that back in podwrapper in a later commit.
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-183-3/+3
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* examples: Use add_drive_opts function in examples.Richard W.M. Jones2012-08-023-4/+4
| | | | | | | | | | | | In libguestfs 1.20, you will be able to use 'add_drive' instead of 'add_drive_opts' (except in the C bindings). However until libguestfs 1.20 is the minimum stable version people will still be using old versions where you have to use 'add_drive_opts'. This makes the examples confusing. Therefore continue to use 'add_drive_opts' in the examples for now.
* Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATHMasami HIRATA2012-07-241-8/+8
| | | | | | because Mac OS X doesn't support LD_LIBRARY_PATH Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
* ocaml: Skip mount-local test if /dev/fuse is not writable.Richard W.M. Jones2012-07-201-0/+8
|
* build: Rename most C files that contain underscore with dash.Richard W.M. Jones2012-07-193-4/+4
| | | | | | | This is just code motion. Some files cannot be renamed. Notably rpcgen input and output files must not contain dash characters, else rpcgen breaks.
* build: Return 77 from skipped tests.Richard W.M. Jones2012-07-191-1/+1
|
* ocaml: Test mount-local, without parallel test.Richard W.M. Jones2012-07-183-112/+20
| | | | | | | | | Unfortunately the parallel test keeps hitting this bug: https://bugzilla.redhat.com/show_bug.cgi?id=838081 which could be a bug in the OCaml runtime. Just test simple mount-local. We will write a parallel test in C to replace this.
* build: Change calls to podwrapper.sh to use $(PODWRAPPER).Richard W.M. Jones2012-07-161-1/+1
| | | | | This will allow us to easily change the location of this script in future.
* Revert "ocaml: Calling Gc.compact before g#mount_local works around ↵Richard W.M. Jones2012-07-161-1/+0
| | | | | | | | RHBZ#838081." This reverts commit ad7c4498f66f37c4219242c6df04d28e9ee7877f. Reverted because we still see core dumps.
* generator: Rename 'add_drive_opts' API to 'add_drive'.Richard W.M. Jones2012-07-145-10/+9
| | | | | | By using the once_had_no_optargs flag, this change is backwards compatible for callers (except Haskell, PHP and GObject as discussed in earlier commit).
* ocaml: Calling Gc.compact before g#mount_local works around RHBZ#838081.Richard W.M. Jones2012-07-061-0/+1
|
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-034-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The new API splits orderly close into a two-step process: if (guestfs_shutdown (g) == -1) { /* handle the error, eg. qemu error */ } guestfs_close (g); Note that the explicit shutdown step is only necessary in the case where you have made changes to the disk image and want to handle write errors. Read the documentation for further information. This change also: - deprecates guestfs_kill_subprocess - turns guestfs_kill_subprocess into the same as guestfs_shutdown - changes guestfish and other tools to call shutdown + close where necessary (not for read-only tools) - updates documentation - updates examples
* examples: In create_disk example, don't call set_autosync.Richard W.M. Jones2012-07-031-10/+1
| | | | | This is now set by default in all supported versions of libguestfs. It's just confusing if the examples refer to it.
* tests: Reformat TESTS_ENVIRONMENT so all use a standard format.Richard W.M. Jones2012-06-281-3/+1
| | | | No functional change.
* ocaml: Set CAML_LD_LIBRARY_PATH in run script.Richard W.M. Jones2012-06-281-1/+0
|
* tests: Add ./run --test option.Richard W.M. Jones2012-06-261-1/+1
| | | | | | | This option, when added via TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test allows us to run the tests and only print the full output (including debugging etc) when the test fails.
* ocaml: Allow parallel mount-local test to be skipped.Richard W.M. Jones2012-06-261-0/+13
| | | | FUSE is not very reliable on RHEL 5.
* build: Define builddir and abs_srcdir when they are missing.Richard W.M. Jones2012-06-181-0/+6
| | | | | | | | | | | | | | | | | | | | | RHEL 5-era autoconf did not define these, so define them manually when they are missing. Define builddir as '.' The scripts require this. It won't work in the srcdir != builddir case, but we don't care about that for RHEL 5. This commit also moves the builddir / abs_srcdir variable setting above the include of subdir-rules.mk, in case that include uses these variables. Useful script: for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do if ! grep -q '^abs_srcdir' $f; then echo missing in $f fi done
* ocaml: Fix parameters to ocaml_guestfs_create.Richard W.M. Jones2012-06-061-3/+3
| | | | The first parameter (not used) is a unit, so declare it properly.
* maint: fix doc typosJim Meyering2012-04-181-1/+1
| | | | | | | Fix typos spotted by http://github.com/lyda/misspell-check. * configure.ac: As above. * ocaml/examples/guestfs-ocaml.pod: Likewise. * fish/guestfish.pod: Likewise.
* extra-tests: ocaml: Use a short delay instead of Thread.yield.Richard W.M. Jones2012-04-121-1/+2
| | | | | | On the new faster computer, Thread.yield wasn't yielding, so the second thread would block the main test from proceeding (only when run under valgrind however).
* parallel mount-local test: Don't run more than 12 threads.Richard W.M. Jones2012-04-031-1/+5
| | | | | On the Koji builder that has lots of memory, this was trying to run something like 20 threads.
* Add test of parallel mount-local calls.Richard W.M. Jones2012-03-293-2/+264
|
* Replace 'int' with 'size_t' passim.Richard W.M. Jones2012-03-131-2/+2
| | | | | Analyze all uses of 'int' in the code, and replace with 'size_t' where appropriate.
* ocaml: Ensure bindings are recompiled whenever there is an API change.Richard W.M. Jones2012-02-101-7/+3
|
* ocaml: Various fixes for bytecode compilation.Richard W.M. Jones2012-01-281-8/+15
| | | | | | | | | | | | Set LD_LIBRARY_PATH so we link against the just-built library, not the installed library. Use OCAMLCFLAGS instead of OCAMLOPTFLAGS where appropriate. Remove unnecessary -cclib option for bytecode linking (gcc is not used in this case). This fixes commit eb68a314133c88260cdf4547d7d338446488e698.
* ocaml: Sort the tests.Richard W.M. Jones2012-01-281-2/+3
|
* ocaml: Test bytecode and native code bindings.Richard W.M. Jones2012-01-272-17/+54
| | | | | Compile each test twice, as bytecode and native code, and test both.
* ocaml: Don't install bindtests.*.Richard W.M. Jones2012-01-261-0/+1
|
* ocaml: Don't install libguestfsocaml.a.Richard W.M. Jones2012-01-261-0/+1
|
* maint: use $var notation rather than ${var} when possibleJim Meyering2012-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed some uses of ${srcdir} in shell scripts. That is almost always better written as $srcdir. The patch below converts most such variable references. Here are the few remaining candidates: $ git grep -i -E '\$\{[a-zA-Z_0-9]+\}'|grep -v Makefile.in.in configure.ac: JAR_INSTALL_DIR=\${prefix}/share/java configure.ac: JNI_INSTALL_DIR=\${libdir} debian/rules: for TEST in ${DEBIAN_SKIP_TEST}; do \ debian/rules:# mv $${mod} $$(dirname $${mod})/libguestfsmod.so; \ java/Makefile.am:libguestfs_jar_DATA = libguestfs-${VERSION}.jar java/Makefile.am:libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files) perl/lib/Sys/Guestfs/Lib.pm: "-f", '${Package} ${Version} ${Architecture} ${Status}\n', perl/typemap: croak (\"${Package}::$func_name(): called on a closed handle\"); perl/typemap: croak (\"${Package}::$func_name(): $var is not a blessed HV reference\"); tests/data/Makefile.am: echo "$${i}abcdefghijklmnopqrstuvwxyz"; \ We could change all of those, too, except the ones in configure.ac and Makefile.am, since they refer to Make variables. Even those should be changed, but to use the preferred Makefile notation: $(prefix), $(libdir), $(VERSION). >From a86770ecd45666232a94d76c8725c8f9b1c76e3a Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 23 Jan 2012 11:15:12 +0100 Subject: [PATCH libguestfs] maint: use $var notation rather than ${var} when possible The only case to avoid in a shell script is when the byte after the "}" is word-constituent, and concatenating it would thus change the name of the variable. These changes were induced by running this command: git grep -l -i -E '\$\{(srcdir|md)' \ |xargs perl -pi -e 's/\$\{(srcdir|md)\}($|\w)/\$$1$2/gi' The "g" was needed because there was one line with two instances. The "i" is to handle ${SRCDIR}. The ($|\w) ensures that concatenating whatever follows the "}" won't change semantics. * gobject/run-bindtests: Use "$srcdir", not "${srcdir}". * haskell/run-bindtests: Likewise. * java/run-bindtests: Likewise. * ocaml/run-bindtests: Likewise. * perl/run-bindtests: Likewise. * python/run-bindtests: Likewise. * ruby/run-bindtests: Likewise. * tests/guests/guest-aux/make-debian-img.sh: Likewise, but $SRCDIR. * tests/guests/guest-aux/make-ubuntu-img.sh: Likewise. * tests/guests/guest-aux/make-windows-img.sh: Likewise. * tests/md/test-mdadm.sh: Likewise, but $md.
* 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.
* Do not run appliance-related checks if not building applianceHilko Bengen2012-01-231-3/+7
|
* Replace setting of environment variables with usage of local run scriptHilko Bengen2012-01-231-3/+1
| | | | (Includes fix by RWMJ)
* Fixed out-of-tree compilation of OCaml code after .depend files removalHilko Bengen2012-01-201-4/+5
|
* Tempus fugit.Richard W.M. Jones2012-01-185-5/+5
| | | | Update all copyright dates to 2012.
* ocaml: Use automake to build the C part of the bindings.Richard W.M. Jones2012-01-181-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.
* ocaml: Don't include guestfs-internal.h directly.Richard W.M. Jones2012-01-181-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>.
* build: Remove .depend files from gitMatthew Booth2012-01-112-6/+1
| | | | | Remove generated .depend files from source control, and don't barf when they don't exist while bootstrapping.
* ocaml: Fix OCaml dependencies.Richard W.M. Jones2011-11-301-2/+2
|
* ocaml: Load test should call Gc.compact to flag memory errors.Richard W.M. Jones2011-11-291-0/+2
|
* ocaml: Memory leak: Free roots array along handle close path.Richard W.M. Jones2011-11-291-0/+1
|
* ocaml: Compile OCaml bindings and tests with -warn-error.Richard W.M. Jones2011-11-091-12/+15
|