79 Commits

Author SHA1 Message Date
Richard W.M. Jones
aba7cad7df java: Combine tests to reduce number of launches. 2010-11-30 14:06:27 +00:00
Richard W.M. Jones
163be3d72a New API: inspect-list-applications.
This converts the current Perl code in virt-inspector for
listing applications, into C, making it a part of the core API.

This is also capable of fetching the list of Windows applications
from the registry.
2010-11-15 22:25:16 +00:00
Richard Jones
04d8209077 Split generator into separate source files.
'src/generator.ml' is no more.  Instead the generator is logically
split up over many different source files.

Read generator/README for help and tips.

We compile the generator down to bytecode, not native code.  This
means it will run more slowly, but is done for maximum portability.
2010-09-11 12:04:44 +01:00
Richard Jones
d3c615c2d6 Update copyright years. 2010-01-02 19:47:37 +00:00
Richard Jones
2e2eb15df0 Remove separate inspector_generator.ml, combine this with generator.ml.
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.
2009-12-31 11:20:56 +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
b1e1ca2f74 Generic partition creation interface.
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
2009-11-10 16:32:20 +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
Richard Jones
c8419d45c8 Tidy up generation of java/Makefile.inc.
(Just whitespace and comment changes, and small restructuring
of the code).
2009-08-07 17:38:44 +01:00
Jim Meyering
2f1a50d816 Convert all TABs-as-indentation to spaces.
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 : $_'
2009-08-03 17:17:57 +02:00
Richard W.M. Jones
4610db9f1b Add interface to Linux 'inotify' API. 2009-07-31 23:30:42 +01:00
Richard Jones
fd6fecea05 Miscellaneous fixes for non-srcdir builds. 2009-07-16 17:15:40 +01:00
Richard W.M. Jones
f67babb756 java/Makefile.inc: Include this generated file.
We have to include this generated file because it is part of
the build system, thus required to exist before the generator
runs.
2009-07-14 16:20:03 +01:00
Matthew Booth
96fdcf7f2e Automatically generate list of built java sources 2009-07-13 13:53:31 +01:00
Richard W.M. Jones
fa36a09e7a Don't list Java files explicitly, since these files are auto-generated. 2009-07-10 23:14:16 +01:00
Richard Jones
11400fde90 RHEL 5: $(builddir) did not exist with this old autoconf/automake, so workaround. 2009-07-07 17:33:09 +01:00
Richard Jones
d5532e9ad2 Generate structs and struct lists generically.
This modifies the way that struct and struct lists are generated
(for return values) so that there is no need to add an explicit
new type when adding a new structure.

All tests pass, and the C API should be compatible.

I have also inspected the changes that are made to the generated
code by hand.
2009-07-07 13:42:34 +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
896079e29b Generated code for the virtio_blk change. 2009-07-01 15:40:13 +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
da947eadcf Clarify documentation for mkdtemp. 2009-06-24 19:57:24 +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
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
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
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
1b2c0e34b1 Improve javadoc (RHBZ#501883). 2009-05-27 12:46:04 +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
5d628a4a9c Don't stash strings in the handle.
- makes it impossible to write bindings for set_{path,qemu,append}
   functions
2009-05-13 18:03:41 +01:00
Richard W.M. Jones
e8ecc08f66 Add 'append', LIBGUESTFS_APPEND to set additional kernel options. 2009-05-13 17:51:14 +01:00