Commit Graph

244 Commits

Author SHA1 Message Date
Richard W.M. Jones
c1ba2aee49 php: function_entry -> zend_function_entry.
function_entry was left over from PHP 3.

See: http://news.php.net/php.pecl.dev/7123
(cherry picked from commit 5cfd3e7b3e)
2012-01-23 18:16:16 +00:00
Matthew Booth
e80cb70b33 c: Fix prototype generator when last argument is a BufferIn
We were passing the name of the last argument directly to va_start. However, if
the last argument is a BufferIn it expands to 2 arguments, the latter of which
is <name>_size.
(cherry picked from commit 3d80161d9c)
2012-01-23 18:16:15 +00:00
Matthew Booth
111761d6c4 bindtests: Fix sscanf test in test0rhashtable
(cherry picked from commit a20b88be83)
2012-01-23 18:16:15 +00:00
Matthew Booth
b1bb9e93d3 bindtests: Add something non-zero to the RStructList test output
(cherry picked from commit 7412bb3421)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
efbae9ac49 ocaml: Don't include guestfs-internal.h directly.
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>.
(cherry picked from commit 607784df92)
2012-01-23 18:16:13 +00:00
Matthew Booth
54912716d0 c: Allow NULL optargs to be passed to _argv calls
Previously, passing NULL optargs to an _argv call resulted in a segfault. This
change causes NULL optargs to be interpreted as no optargs, and to be correctly
handled accordingly.
(cherry picked from commit fd1a6d8003)
2012-01-23 18:16:13 +00:00
Matthew Booth
7a8b0ead9a c: NFC Remove redundant parentheses
(cherry picked from commit c7119da130)
2012-01-23 18:16:13 +00:00
Matthew Booth
ae1e4758bd build: Remove .depend files from git
Remove generated .depend files from source control, and don't barf when they
don't exist while bootstrapping.
(cherry picked from commit f6db1ec410)
2012-01-23 18:16:08 +00:00
Matthew Booth
ae41a59717 generator: Create a separate type for optional arguments
Previously, optional arguments had the same type as regular arguments, but were
constrained by various runtime tests to be only Bool, Int, Int64 or String. This
change makes the type of optional arguments stronger by giving them their own
type.

A convenience function, optargs_to_args is defined to convert optargs in the few
places where they are genuinely treated identically to mandatory arguments.

It also allows for future changes to optional arguments which do not affect
mandatory arguments.

RWMJ:
 - removed redundant parens
 - readded the check for > 64 optargs, but changed it to > 63
 - changed the new function to args_of_optargs

(cherry picked from commit 0a7b734d2f)
2012-01-10 15:41:15 +00:00
Matthew Booth
afc9f27773 generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
(cherry picked from commit e24af214fe)
2012-01-10 15:40:00 +00:00
Richard W.M. Jones
87e972e694 daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).
This also adds comprehensive tests for utimens on regular files,
directories (RHBZ#761451), named pipes (RHBZ#761460), symbolic links,
block and char devices.

Note that there is a small change in the (previously undefined)
semantics of this call: It now sets the time on a symbolic link
itself, not on what the symbolic link points to.
(cherry picked from commit 19e2f5aa4f)
2011-12-09 15:35:40 +00:00
Richard W.M. Jones
2e60cb0cff ruby: Use RSTRING_PTR, RSTRING_LEN for compat with Ruby 1.9 (RHBZ#760000).
(cherry picked from commit 2972987d02)
2011-12-06 14:59:35 +00:00
Richard W.M. Jones
8b886497a1 perl: Memory leak: Free roots array along handle close path.
(cherry picked from commit 00c9755ee3)
2011-12-02 08:37:00 +00:00
Richard W.M. Jones
6042ec5141 ruby: Memory leak: Free roots array along handle close path.
(cherry picked from commit eb7ec6170e)
2011-12-02 08:36:56 +00:00
Richard W.M. Jones
f1ea1ec101 ocaml: Fix memory leak in bindings for functions that return buffers.
RBufferOut binding didn't free the buffer after copying it onto
the OCaml heap.

Found by valgrind.
(cherry picked from commit 6bd0eec12f)
2011-12-02 08:34:00 +00:00
Richard W.M. Jones
af77e1d8e1 Don't rely on implicit promotion of float to double in printf args.
(cherry picked from commit 9b102aae65)
2011-11-24 21:05:53 +00:00
Richard W.M. Jones
9e14ca6911 fish: In generated code, put function names on a new line.
eg:

static void
run_foo ()
{
}
(cherry picked from commit 99ec97dcdf)
2011-11-24 21:05:44 +00:00
Richard W.M. Jones
20359767c6 generator: Support testing the output of RHashtable functions.
You can use TestOutputHashtable to test the output of RHashtable
functions.
(cherry picked from commit 5f0b75f040)
2011-11-22 14:44:48 +00:00
Richard W.M. Jones
615f504a5f ocaml: Fix bindings when a function takes more than 10 parameters.
If any function had more than 10 required + optional parameters, OCaml
bindings could not be generated.  Currently there are no such
functions.
(cherry picked from commit 29172e7c48)
2011-11-09 22:08:49 +00:00
Richard W.M. Jones
3398888ba9 tests: Fix bitmask parameter when testing optional arguments.
The bitmask was being constructed backwards(!)

As a result, any test which tested optional arguments didn't work.
There are very few such tests and they happened not to be affected by
this.
(cherry picked from commit af2b0378bb)
2011-11-09 22:08:40 +00:00
Richard W.M. Jones
6ffc7e4b82 fish: More informative documentation of optargs.
(cherry picked from commit 271f8e4b70)
2011-11-09 22:08:34 +00:00
Matthew Booth
3bde9fdffd Update FSF address.
(cherry picked from commit 04ea1375c5)
2011-11-09 22:08:13 +00:00
Richard W.M. Jones
a31bebe46f python: Fixes for Python 3 (RHBZ#750889).
These fixes allow libguestfs bindings to work with Python 3 (tested
with Python 3.2)

You can select which Python you compile against by doing:

  PYTHON=python ./configure && make && make check

or:

  PYTHON=python3 ./configure && make && make check
(cherry picked from commit 2116f79cbc)
2011-11-09 22:05:51 +00:00
Richard W.M. Jones
f3dfc7a0de python: Include <config.h>.
Ooops ...
(cherry picked from commit 25454b8308)
2011-11-09 22:05:25 +00:00
Richard W.M. Jones
e8ab4fef30 perl: Add %guestfs_introspection hash with introspection information.
Because this is a useful introspection API, it is a candidate for
being backported into older stable branches.
(cherry picked from commit 365885dab2)
2011-10-31 08:42:00 +00:00
Richard W.M. Jones
6edd6cdeba generator: Remove DangerWillRobinson.
This warning was applied unevenly.  Potentially any command can be
dangerous or safe, so it was a needless warning.
2011-10-27 13:45:22 +01:00
Richard W.M. Jones
b893294dcc add-domain: Add readonlydisk optional argument (RHBZ#747290).
This optional argument controls how <readonly/> disks in
the libvirt XML are handled.  It can be set to one of:

  "write" (default) - add them R/W
  "read" - add them R/O
  "error" - throw an error if asked to add them R/W
  "ignore" - ignore these disks

I have added limited regression tests for this feature.  However
libvirt's test:/// XML does not allow you to specify that a domain
starts off shut down, so we cannot fully test this.  Instead I tested
it by hand.
2011-10-26 19:29:57 +01:00
Richard W.M. Jones
163f7df845 libvirt: Detect if a disk has the <readonly/> flag.
This changes the private function guestfs___for_each_disk so that the
<readonly/> flag on libvirt disks is detected and passed through to
the callback function.
2011-10-26 17:47:34 +01:00
Richard W.M. Jones
f223dfa29a New APIs: copy-{file,device}-to-{file,device}.
The four new APIs:
guestfs_copy_device_to_device,
guestfs_copy_device_to_file,
guestfs_copy_file_to_device, and
guestfs_copy_file_to_file
let you copy from a source to a destination, between files and
devices, optionally allowing source and destination offsets and size
to be specified.
2011-10-26 10:07:21 +01:00
Richard W.M. Jones
47412f137f New API: part-to-partnum
This converts a partition device name (eg. /dev/sda1) to a partition
number (eg. 1).  This is useful in conjunction with the parted APIs
that mostly take a disk device + partnum.
2011-10-25 12:46:05 +01:00
Hilko Bengen
aa67ea2b9b out-of-tree build: fix HAVE_OCAML=false case 2011-10-21 16:41:22 +01:00
Matthew Booth
a1df33eac2 inspect: Add drive naming hints
We currently use a heuristic to guess how drive names we find
referenced in the guest map to drive names in the appliance. If this
heuristic fails it can cause inspection to fail.

This change adds a new 'name' option to add_drive_opts, which allows
the user to explicitly pass the name of a drive to libguestfs if it is
known. This change also updates the fstab-parsing inspection code to
use this information if it is available.
2011-10-19 16:27:38 +01:00
Matthew Booth
f1041e912b launch: Store drive information in guestfs_h
This is a NFC on its own, but provides a place-holder for drive metadata which
can be used after launch.

Fixes by RWMJ:

 - Fix the tests: this requires a new internal function 'debug-drives'
   that dumps out the g->drives information so it can be checked in
   two of the tests.  Previously these tests used 'debug-cmdline'.

 - Test file existence / use_cache_off in the add_drive_opts function,
   not when launching qemu in the child process.

 - Call free along error paths.

 - Add comments.
2011-10-19 16:26:42 +01:00
Michael Scherer
f25d2300ce Add basic support for netbsd detection. 2011-10-14 10:35:17 +01:00
Michael Scherer
8f6eed00da Add support for pkgsrc, default NetBSD package manager.
For now, only detect the tool, but support from reading
installed package could be added later ( may require either
a package of pkgsrc, or a smaller tool to read the db ).
2011-10-14 10:27:48 +01:00
Michael Scherer
5332515db3 Add Opensuse and zypper detection support
This would also erronously detect SLES as Opensuse.
2011-10-14 10:01:44 +01:00
Michael Scherer
7d4a99db87 Detect Mageia distribution 2011-10-14 10:01:40 +01:00
Richard W.M. Jones
b1f7b5f911 mount: Not deprecated any more.
This updates commit 5c2f1a2d94.
2011-10-01 10:42:05 +01:00
Richard W.M. Jones
5c2f1a2d94 mount: No longer implicitly add -o sync,noatime options. 2011-10-01 08:20:50 +01:00
Richard W.M. Jones
04fbcc63eb New API: set-smp, get-smp
These calls allow you to change the number of virtual CPUs assigned to
the appliance.

This also adds a --smp option to virt-rescue.
2011-09-28 14:52:56 +01:00
Richard W.M. Jones
8403f5a9d8 New APIs: compress-out, compress-device-out.
These APIs let you copy compressed files or devices out from the disk
image.

Compression is useful for large images which are mostly zeroes.  We
cannot currently do sparseness detection, and compression gives us a
form of zero detection for free.

Example usage:

$ guestfish --ro -a /dev/vg_pin/F16x64 -i \
    compress-out gzip /etc/passwd /tmp/passwd.gz
$ file -z /tmp/passwd.gz
/tmp/passwd.gz: ASCII text (gzip compressed data, was "passwd", from
Unix, last modified: Sun Aug 28 14:40:46 2011)
2011-09-28 14:52:56 +01:00
Richard W.M. Jones
84763d7fca Add Erlang bindings. 2011-09-21 15:21:58 +01:00
Richard W.M. Jones
b648b1813f inspection: Add support for ttylinux (a minimal Linux). 2011-09-16 15:21:26 +01:00
Richard W.M. Jones
99624d2922 Add an optional group ("grub") for the guestfs_grub_install API.
This also improves the documentation for this call, pointing out
several pitfalls in using it.

This unfortunately breaks existing callers that might use
guestfs_grub_install without checking for this new group.
2011-09-15 22:02:43 +01:00
Richard W.M. Jones
9420eaf44e Add GUESTFS_EVENT_ENTER event.
This event is generated whenever a libguestfs function is called.
2011-08-26 21:55:03 +01:00
Richard W.M. Jones
1a4f1df77e ruby: Check Ruby callback exists before we call it (RHBZ#733297). 2011-08-26 10:56:48 +01:00
Richard W.M. Jones
675f336319 ruby: Use a regular C array to pass the arguments through rb_rescue. 2011-08-25 13:25:07 +01:00
Richard W.M. Jones
0cd5b9ac15 ruby: Append newline character after printing exception in callback. 2011-08-25 13:11:28 +01:00
Richard W.M. Jones
b2edcbe1b9 Coverity: in daemon, free struct in RStruct, RStructList functions. 2011-08-23 19:19:13 +01:00
Richard W.M. Jones
631faad971 pclose: Fix other places where we only tested pclose == -1.
pclose can return > 0 when the status of the command was non-zero.
2011-08-23 18:56:12 +01:00