Commit Graph

182 Commits

Author SHA1 Message Date
Richard W.M. Jones
0d18a8b407 Update copyright dates for 2013. 2013-02-02 13:56:19 +00:00
Matthew Booth
27b995c841 Make internal-only functions and structures private
Certain functions are intended to be internal only, but we currently
export them anyway. This change moves them into a separate section of
guestfs.h protected by a GUESTFS_PRIVATE variable. This change also
enables private structs, but doesn't implement any.

This change only affects the C api. Language bindings aren't affected,
but probably should be in the future.
2013-01-30 17:27:01 +00:00
Richard W.M. Jones
0d2d26d8e7 java: Implement the event API. 2013-01-15 18:40:17 +00:00
Richard W.M. Jones
05a67bcc25 java: Change synopsis in man page to show use of add_drive. 2013-01-15 18:40:16 +00:00
Richard W.M. Jones
7d89baa3e9 java: Tidy up javadoc. 2013-01-15 18:40:16 +00:00
Richard W.M. Jones
20e23ab2a3 Update copyright dates for 2013.
On generated files in git and README.
2013-01-15 18:40:16 +00:00
Richard W.M. Jones
62e775c350 Change the handling of private functions, safe_malloc etc.
Rename guestfs_safe_malloc et al to guestfs___safe_malloc etc.

To use the private functions, code now has to define
-DGUESTFS_PRIVATE_FUNCTIONS=1.  This will make it easier for us in
future to work out which programs are using these functions and to
minimize both the number of programs and the functions they are
calling.

Note that the Perl, Python, OCaml, Ruby and Java bindings use
guestfs_safe_* calls.  None of the other bindings do.  This is a bug
(in the bindings using those functions): these functions will call the
out of memory callback on failure.  This function defaults to abort(),
and since this happens from a language binding, there is no way to
change this default.
2012-12-15 19:41:29 +00:00
Richard W.M. Jones
ff8bfd3e92 Add Lua bindings.
These are relatively complete, although only lightly tested.  Missing:

 - events
 - last_errno
 - user_cancel
2012-11-17 20:02:42 +00:00
John Eckersberg
bafd822914 lib: Add inspect_list_applications2 method (RHBZ#859949)
RWMJ:
- Fix memory leak in guestfs__inspect_list_applications wrapper.
- Don't document app2_spare* fields.
2012-11-01 18:22:01 +00:00
Richard W.M. Jones
a3d7f5bc17 generator: The default input files are 'generator/ *.ml' [sic].
Since generator source files were renamed, the comment at the
top of each generated file was wrong.

Unfortunately we cannot allow /* to appear within a comment,
so the space is necessary.
2012-09-24 09:34:33 +01:00
Richard W.M. Jones
8a723ca62e New APIs: hivex_*
Transscribe many hivex(3) APIs into the libguestfs API.

There is one hive handle per libguestfs handle, as with Augeas.

Note that hivex uses iconv_open for some APIs (eg. hivex_value_string).
But since we delete all the i18n files from the appliance, this
doesn't work -- iconv_open returns EINVAL.  Therefore hivex APIs which
require iconv cannot be bound in the daemon.
2012-08-29 17:08:01 +01:00
Richard W.M. Jones
684efb3706 java: Further java/java-home fixes.
In particular the JVM executable is now called $JAVA_EXE.

This fixes commit 40b9c14ca9.
2012-08-29 14:24:37 +01:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
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.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
f1d98bbc79 man pages: Ensure consistent copyright/author sections, remove license
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.
2012-08-21 20:16:29 +01:00
Richard W.M. Jones
d67e6ea75d Replace mount-options with mount where appropriate.
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.
2012-08-18 22:08:29 +01:00
Richard W.M. Jones
863168467f examples: Use add_drive_opts function in examples.
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.
2012-08-02 17:21:47 +01:00
Richard W.M. Jones
b075b4d1fe New API: utsname
Typical output:

><fs> utsname
uts_sysname: Linux
uts_release: 3.5.0-1.fc18.x86_64
uts_version: #1 SMP Mon Jul 23 17:43:39 UTC 2012
uts_machine: x86_64
2012-07-30 15:16:45 +01:00
Richard W.M. Jones
7a691e6665 java: Set '-encoding utf8' for javac and javadoc commands. 2012-07-23 15:24:07 +01:00
Richard W.M. Jones
7f519bdc06 java: JAVAC_FLAGS -> EXTRA_JAVAC_FLAGS.
This is just a rename.
2012-07-23 15:18:12 +01:00
Wanlong Gao
87206e4e9e New API: add new api xfs_info
Add xfs_info to show the geometry of the xfs filesystem.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

RWMJ:
 - Updated po/POTFILES.
 - Use xfs_ prefix for all struct fields.
 - Return uninitialized fields as -1 / empty string.
 - Copyedit the description.
2012-07-18 09:37:17 +01:00
Richard W.M. Jones
f2ea617e22 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.
2012-07-16 18:56:57 +01:00
Richard W.M. Jones
7486fc6f43 generator: Rename 'add_drive_opts' API to 'add_drive'.
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).
2012-07-14 12:42:24 +01:00
Richard W.M. Jones
0da2dbef26 java: Generate overloaded non-optargs method for each optargs method.
For example the existing method:

  public void mkfs_opts (String fstype, String device, Map<..> optargs);

is now accompanied by this overloaded method which is a simple wrapper:

  public void mkfs_opts (String fstype, String device)
    throws LibGuestFSException
  {
    mkfs_opts (fstype, device, null);
  }
2012-07-13 14:02:43 +01:00
Richard W.M. Jones
ffbf1475f7 New API: guestfs_shutdown: Cleanly shutdown the backend.
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
2012-07-03 21:27:29 +01:00
Richard W.M. Jones
917550a117 examples: In create_disk example, don't call set_autosync.
This is now set by default in all supported versions of libguestfs.
It's just confusing if the examples refer to it.
2012-07-03 14:45:42 +01:00
Richard W.M. Jones
8439e97f76 java: Use run --tests for tests.
Java-specific environment variables are set in the run script.
2012-06-28 13:40:33 +01:00
Richard W.M. Jones
50aa9533e4 build: Define builddir and abs_srcdir when they are missing.
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
2012-06-18 15:32:47 +01:00
Richard W.M. Jones
87ea7a0409 New btrfs APIs.
Bind the easy parts of the 'btrfs' program.

The new APIs are:

btrfs-device-add: add devices to a btrfs filesystem
btrfs-device-delete: remove devices from a btrfs filesystem
btrfs-filesystem-sync: sync a btrfs filesystem
btrfs-filesystem-balance: balance a btrfs filesystem
btrfs-subvolume-create: create a btrfs snapshot
btrfs-subvolume-delete: delete a btrfs snapshot
btrfs-subvolume-list: list btrfs snapshots and subvolumes
btrfs-subvolume-set-default: set default btrfs subvolume
btrfs-subvolume-snapshot: create a writable btrfs snapshot
2012-04-25 17:32:30 +01:00
Hilko Bengen
4db251048b Fix out-of-tree build for Java bindings 2012-03-28 22:11:00 +02:00
Richard Jones
4d0aa08b00 java: Delete target file before running javah.
javah from old GNU classpath won't overwrite the target *.h file,
instead leaving the old one which results in a predictable build
failure.  Delete the target so this won't happen.
2012-03-28 19:19:58 +01:00
Richard W.M. Jones
3f6cc550ff New API: md-stat.
This returns information about the underlying devices of an MD
(software RAID) device.
2012-03-20 18:50:24 +00:00
Richard W.M. Jones
65ebec4a7a generator: Generate a .gitignore file specifically for java structs. 2012-03-20 17:14:56 +00:00
Richard W.M. Jones
14938b46a7 generator: Sort camel-case structs. 2012-03-16 14:42:30 +00:00
Richard W.M. Jones
a43f35f5bb New APIs: isoinfo and isoinfo-device.
Get ISO primary volume descriptor information for either ISO devices
or ISO files.
2012-03-16 14:40:20 +00:00
Richard W.M. Jones
13e7a1b400 java: Make sure generator is rerun when necessary to rebuild generated files. 2012-03-14 19:29:52 +00:00
Hilko Bengen
016ae77e6c java: Make use of JAR_INSTALL_DIR, JNI_INSTALL_DIR 2012-02-08 22:47:22 +01:00
Jim Meyering
6edecdec59 maint: use $var notation rather than ${var} when possible
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.
2012-01-23 10:40:47 +00:00
Hilko Bengen
b6e0552ee5 Do not run appliance-related checks if not building appliance 2012-01-23 09:08:33 +00:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Matthew Booth
ebdda911b5 Tempora mutantur, nos et mutamur in illis. 2012-01-04 12:32:35 +00:00
Hilko Bengen
a0509ff071 java: out-of-tree build, don't build static library 2011-11-16 12:38:59 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Hilko Bengen
e7ea6d06ab out-of-tree build: fixed bindtests and inspector 2011-10-21 16:42:06 +01:00
Richard W.M. Jones
84763d7fca Add Erlang bindings. 2011-09-21 15:21:58 +01:00
Hilko Bengen
ff101adf7e out-of-tree build: fix documentation generation 2011-08-15 14:50:33 +01:00
Richard W.M. Jones
f7d18c84dd build: Set TMPDIR for local testing.
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.
2011-08-08 12:41:54 +01:00
Richard W.M. Jones
d025e91f67 java: Add guestfs-java(3) man page. 2011-07-19 17:54:35 +01:00
Richard W.M. Jones
d7da4807e8 java: Fix optional arguments in calls.
This also adds tests.
2011-07-19 15:18:36 +01:00
Richard W.M. Jones
c79ba93f7e java: Enable warnings when compiling C bindings code.
And fix the code so it doesn't generate warnings.
2011-07-19 14:32:45 +01:00
Richard W.M. Jones
21fef55ca4 java: Add a test of g.list_filesystems (a function that returns a Map). 2011-03-02 05:21:36 +00:00