summaryrefslogtreecommitdiffstats
path: root/ocaml
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* ocaml: General improvements to generated code.Richard W.M. Jones2009-11-062-0/+13
|
* Tab to space fixes, now passes 'make syntax-check'Richard Jones2009-10-202-186/+186
|
* Add some missing EXTRA_DIST files.Richard Jones2009-10-141-1/+5
|
* inspector: Generate language bindings for OCaml.Richard Jones2009-10-134-14/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: fix compile errorJim Meyering2009-10-021-3/+6
| | | | | | | | Link demo scripts with just-build library, not the installed one. * ocaml/examples/Makefile.am (OCAMLFINDFLAGS): New variable. (lvs, viewer): Use it. This fix is based on a suggestion from Rich Jones. This addresses RHBZ#526917.
* OCaml viewer: Use ocamlduce to replace xpath code.Richard Jones2009-09-305-48/+36
|
* OCaml viewer: Handle exceptions properly.Richard Jones2009-09-291-1/+8
|
* OCaml example: graphical disk usage viewer.Richard Jones2009-09-296-3/+766
| | | | | | | | | This is an example of how to write an app which uses libguestfs and libvirt, and has a responsive user interface (using threads). It is a Gtk-based "graphical virt-df". Read the top of the 'viewer.ml' file first for instructions on how to compile. This program is not compiled by default.
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-214-4/+0
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* 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.
* ocaml/guestfs_c.c: avoid warning about missing prototypesJim Meyering2009-08-271-0/+4
| | | | * ocaml/guestfs_c.c (ocaml_guestfs_create, ocaml_guestfs_close): Declare.
* ocaml/guestfs_c.c: avoid warning about initialization discarding "const"Jim Meyering2009-08-271-1/+1
| | | | * ocaml/guestfs_c.c (guestfs_custom_operations): Add a cast.
* ocaml/guestfs_c.c avoid signed/unsigned-comparison warningJim Meyering2009-08-271-1/+1
| | | | | * ocaml/guestfs_c.c (ocaml_guestfs_strings_val): Declare index as unsigned int.
* build: remove trailing blank lines; enable the syntax-check ruleJim Meyering2009-08-041-1/+0
| | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Remove sc_prohibit_trailing_blank_lines. * appliance/Makefile.am: Remove trailing blank line(s). * appliance/debian/modules/y0_install-guestfsd: Likewise. * appliance/make.sh.in: Likewise. * appliance/packagelist.in: Likewise. * appliance/update.sh.in: Likewise. * haskell/run-bindtests: Likewise. * ocaml/run-bindtests: Likewise. * python/run-python-tests: Likewise. * recipes/squashfs.example: Likewise. * ruby/run-ruby-tests: Likewise.
* build: don't emit trailing blanks, remove generated fileJim Meyering2009-08-042-7/+8
| | | | | | * ocaml/Makefile.am (.depend): Don't redirect directly to $@. Filter out trailing blanks. * ocaml/.depend: Regenerate.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-4/+4
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* always include <config.h>Jim Meyering2009-08-031-0/+1
| | | | | | * ocaml/guestfs_c.c: Include <config.h>. * examples/to-xml.c: Likewise. * examples/hello.c: Likewise.
* 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
|
* Version 1.0.56.1.0.56Richard W.M. Jones2009-07-071-0/+1
|
* Update ocaml/.depend.Richard Jones2009-07-071-1/+0
|
* Whitespace change in ocaml/.depend file.Richard Jones2009-07-061-5/+5
|
* 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.
* remove trailing blanksJim Meyering2009-07-031-5/+5
|
* Remove generated code from git.Richard W.M. Jones2009-07-024-6023/+0
| | | | | | | | Git users now require the OCaml compiler in order to regenerate the generated code after a checkout. Generated code will remain in the tarball, so users of the source tarball will not need the OCaml compiler.
* Add 'readdir' call.Richard W.M. Jones2009-07-025-2/+136
| | | | | | | | | | | | 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.
* Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.Richard W.M. Jones2009-06-303-0/+145
|
* Generated code for 'set_memsize'/'get_memsize' calls.Richard W.M. Jones2009-06-303-0/+53
|
* Generated code for the 'mkswap*' commands.Richard W.M. Jones2009-06-293-0/+83
|
* Generated code for mount-loop command.Richard W.M. Jones2009-06-293-0/+28
|
* Generated code for 'initrd-list'.Richard W.M. Jones2009-06-293-0/+30
|
* Generated code for 'du' command.Richard W.M. Jones2009-06-293-0/+27
|
* Generated code for df / df-h.Richard W.M. Jones2009-06-293-0/+54
|
* Generated code for head/tail commands.Richard W.M. Jones2009-06-293-4/+126
|
* Generated code for 'wc_*' commands.Richard W.M. Jones2009-06-293-0/+81
|
* Generated code for 'mkdtemp' command.Richard W.M. Jones2009-06-243-0/+28
|
* Generated code for 'scrub-*' commands.Richard W.M. Jones2009-06-233-0/+81
|
* Generated code for 'glob-expand'.Richard Jones2009-06-223-0/+30
|
* Generated code for 'sh' and 'sh-lines' commands.Richard Jones2009-06-223-0/+58
|
* Generated code for ntfs_3g_probe command.Richard Jones2009-06-083-0/+28
|
* Generated code for the 'sleep' command.Richard Jones2009-06-043-0/+27
|
* No parallel make in ocaml/ directory (RHBZ#502309).Richard Jones2009-06-021-0/+4
|
* Generated code for 'add_drive_ro' call.Richard Jones2009-06-023-0/+27
|