Commit Graph

75 Commits

Author SHA1 Message Date
Richard W.M. Jones
e9f25e693e ruby: Add rdoc documentation (RHBZ#667610). 2011-03-15 14:53:08 +00:00
Richard W.M. Jones
6a64114929 New event API - Ruby bindings (RHBZ#664558). 2011-03-15 12:16:51 +00:00
Richard W.M. Jones
477eebc83d perl: Translate C examples into Perl and include a manual page. 2011-01-30 23:41:05 +00:00
Richard W.M. Jones
0c60e4d9dd fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).
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
2011-01-11 11:09:41 +00:00
Richard W.M. Jones
37e632b7b8 ruby: Translate C examples into Ruby and include documentation. 2010-11-24 20:13:13 +00:00
Richard W.M. Jones
aec3091fa9 ruby: Add 'make install' rule for ruby bindings (RHBZ#652796). 2010-11-12 22:09:49 +00:00
Richard Jones
a6454a437f ruby: Remove extra space before parenthesis. 2010-11-09 12:04:29 +00:00
Richard W.M. Jones
14490c3e1a generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).
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.
2010-10-22 17:45:00 +01:00
Richard W.M. Jones
8f30c3c3f8 ruby: Run tests one at a time, instead of in parallel. 2010-10-21 16:39:04 +01:00
Richard Jones
cef4ba0b8f Mac OS X: Fix configure-time tests for Ruby.
For ARCHFLAGS change, see:
http://www.ruby-forum.com/topic/129717#579065

We also add a test for the <guestfs.h> header and include
that header when testing the library.
2010-03-22 10:41:46 +00:00
Matthew Booth
c477e2fb78 build: Fix inter-directory dependencies
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.
2009-11-19 16:40:22 +00:00
Richard Jones
8869adf1e8 Remove guestfs_wait_ready (turn it into a no-op).
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.
2009-09-21 12:01:51 +01:00
Jim Meyering
0c463dd0aa build: remove trailing blank lines; enable the syntax-check rule
* 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.
2009-08-04 14:47:09 +02:00
Richard Jones
a865795a7e More misc fixes to non-srcdir builds. 2009-07-16 18:04:01 +01:00
Richard Jones
6c87a747ca Fix for 349814e9d9: Get correct path when building Ruby bindings. 2009-07-07 13:03:36 +01:00
Matthew Booth
349814e9d9 Make it possible to build in a separate directory
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.
2009-07-03 16:16:51 +01:00
Richard W.M. Jones
b3cb0b04eb Remove generated code from git.
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.
2009-07-02 11:51:16 +01:00
Richard W.M. Jones
5186251f8f Add 'readdir' call.
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.
2009-07-02 10:11:55 +01:00
Richard W.M. Jones
0884d8bbae Generated code for mknod, mkfifo, mknod_b, mknod_c, umask. 2009-06-30 13:10:45 +01:00
Richard W.M. Jones
f68b3ac861 Generated code for 'set_memsize'/'get_memsize' calls. 2009-06-30 13:10:44 +01:00
Richard W.M. Jones
da8ddb2745 Generated code for the 'mkswap*' commands. 2009-06-29 20:25:20 +01:00
Richard W.M. Jones
5d6b6a3fbb Generated code for mount-loop command. 2009-06-29 16:05:22 +01:00
Richard W.M. Jones
c6d6f5ae1b Generated code for 'initrd-list'. 2009-06-29 15:19:10 +01:00
Richard W.M. Jones
e492608f2f Generated code for 'du' command. 2009-06-29 12:47:20 +01:00
Richard W.M. Jones
b2ed0f4c55 Generated code for df / df-h. 2009-06-29 12:26:11 +01:00
Richard W.M. Jones
826020fe18 Generated code for head/tail commands. 2009-06-29 11:47:07 +01:00
Richard W.M. Jones
f450ce75b7 Generated code for 'wc_*' commands. 2009-06-29 10:09:13 +01:00
Richard W.M. Jones
0574eab8bc Generated code for 'mkdtemp' command. 2009-06-24 18:25:09 +01:00
Richard W.M. Jones
bcb3fc0c33 Generated code for 'scrub-*' commands. 2009-06-23 15:53:44 +01:00
Richard Jones
227b1eea90 Check parameter types in Ruby bindings (RHBZ#507346). 2009-06-22 15:07:42 +01:00
Richard Jones
ca4a0c7180 Missing \n character in Ruby bindings. 2009-06-22 14:14:45 +01:00
Richard Jones
ad8a256f54 Generated code for 'glob-expand'. 2009-06-22 08:20:42 +01:00
Richard Jones
4211c7a258 Generated code for 'sh' and 'sh-lines' commands. 2009-06-22 07:49:50 +01:00
Richard Jones
27161658c8 New website, change et.redhat.com references to libguestfs.org 2009-06-09 11:20:05 +01:00
Richard Jones
460d139e6a Generated code for ntfs_3g_probe command. 2009-06-08 17:44:18 +01:00
Richard Jones
b6adf09c4d Generated code for the 'sleep' command. 2009-06-04 15:06:27 +01:00
Richard Jones
d1a1ab972b Generated code for 'add_drive_ro' call. 2009-06-02 14:25:25 +01:00
Richard W.M. Jones
a3d4d655ff Distribute bindtests.rb in the tarball. 2009-05-28 20:41:12 +01:00
Richard W.M. Jones
babc0846cc Add tests for bindings parameters, fix several broken bindings. 2009-05-28 20:15:51 +01:00
Richard W.M. Jones
c41fe04a65 Add the test0* functions, used to test language bindings. 2009-05-28 16:23:04 +01:00
Richard W.M. Jones
a1e8cdf2a2 Move the appliance and build scripts into new appliance/ subdirectory. 2009-05-28 13:00:31 +01:00
Richard Jones
3e408f4934 Generated code for e2fsck-f command. 2009-05-21 16:18:16 +01:00
Richard Jones
1fc41b39da Generated code for 'find' command. 2009-05-19 12:05:43 +01:00
Richard Jones
ca49c50e06 Generated code for lvresize, resize2fs. 2009-05-18 20:22:53 +01:00
Richard Jones
85ed8cef99 Add vg-activate{,-all} commands, and resize recipe. 2009-05-18 17:16:24 +01:00
Richard W.M. Jones
5cd39c83e2 Add: pvresize, sfdisk-N, sfdisk-l, sfdisk-kernel-geomtry, sfdisk-disk-geometry commands. Pass --no-reread flag to sfdisk. 2009-05-15 14:52:34 +01:00
Richard W.M. Jones
d901cc9161 Add support for zerofree command. 2009-05-14 23:47:17 +01:00
Richard W.M. Jones
e8ecc08f66 Add 'append', LIBGUESTFS_APPEND to set additional kernel options. 2009-05-13 17:51:14 +01:00
Richard Jones
15e0fd573a Generated code to support last 3 commits. 2009-05-08 15:20:36 +01:00
Richard Jones
0faa5dde7b Generated code to support previous 2 commits. 2009-05-08 14:28:03 +01:00