summaryrefslogtreecommitdiffstats
path: root/generator
Commit message (Collapse)AuthorAgeFilesLines
* New API: ntfsfix for fixing problems on NTFS.Richard W.M. Jones2012-02-271-0/+16
| | | | Note this is not a "chkdsk" equivalent tool.
* Add a flag to make some functions called only at CONFIG state (RHBZ#796520).Wanlong Gao2012-02-234-34/+43
| | | | | | | Add a flag "ConfigOnly" to make sure that some non-daemon functions should be called only at CONFIG state (RHBZ#796520). Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* daemon: Don't xdr_free uninitialized args struct on error paths.Richard W.M. Jones2012-02-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For stubs of functions that had arguments, code did this: static void mount_stub (XDR *xdr_in) { int r; struct guestfs_mount_args args; if (optargs_bitmask != 0) { //... goto done; } // possibly other tests here memset (&args, 0, sizeof args); [...] done: xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args); return; } This caused xdr_free to be called on uninitialized 'args' struct, causing a segfault. The fix is to add another label, so the code looks like: static void mount_stub (XDR *xdr_in) { int r; struct guestfs_mount_args args; if (optargs_bitmask != 0) { //... goto done_no_free; } // possibly other tests here memset (&args, 0, sizeof args); [...] done: xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args); done_no_free: return; } This fixes commit 330fbea5b2d6bd7db84f7ea7afe87cf1bcd438e0 and commit 0344248af55802bbbd816b349ec1ba9305996f6e.
* wipefs: Fix documentation.Richard W.M. Jones2012-02-101-3/+1
| | | | This fixes commit a2b3e0900ee14e5a49d526c24e22edefc3030f99.
* NEW API: add a new api wipefsWanlong Gao2012-02-101-0/+16
| | | | | | | Add the new api wipefs to erase the filesystem signatures on a device but now erase any data. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: llz: This runs ls -laZ and is useful for showing SELinux contexts.Richard W.M. Jones2012-02-091-0/+9
|
* Clarify the error message when unavailable functions are called (RHBZ#679737).Richard W.M. Jones2012-02-011-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callers are supposed to use the availability API to check for functions that may not be available in particular builds of libguestfs. If they don't do this, currently they tend to get obscure error messages, eg: libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory This commit changes the error message to explain what callers ought to be doing instead: libguestfs: error: zerofree: feature 'zerofree' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. This patch makes the stubs check for availability. The stub code changes to: static void zerofree_stub (XDR *xdr_in) { [...] /* The caller should have checked before calling this. */ if (! optgroup_zerofree_available ()) { reply_with_error ("feature '%s' is not available in this\n" "build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\n" "how to check for the availability of features.", "zerofree"); goto done; } [...]
* ocaml: Fix bytecode bindings for functions with >= 6 args.Richard W.M. Jones2012-01-271-1/+1
|
* gobject: Add an explicit close callMatthew Booth2012-01-261-11/+45
| | | | | This change binds guestfs_close(). It consequently results in RConstOptString being able to throw an error.
* gobject: Allow RConstOptString to return an errorMatthew Booth2012-01-261-18/+11
| | | | | | | | | | | RConstOptString cannot return an error in the C api. This makes it a special case for the GObject api, as all other return types have a corresponding GError **err argument to return an error. This change removes this special case, and includes the possibility of an error return in the API. An error is indicated by setting *err to a non-NULL value. This change is in preparation for adding a close api. An attempt to call any api, even RConstOptString, on a closed handle must return an error.
* php: function_entry -> zend_function_entry.Richard W.M. Jones2012-01-221-1/+1
| | | | | | function_entry was left over from PHP 3. See: http://news.php.net/php.pecl.dev/7123
* bindtests: Test optargs in test0Matthew Booth2012-01-203-30/+180
| | | | | | | | Note that this change disables compiling and running the haskell bindtests. The haskell bindings do not implement optargs, and adding optargs to test0 causes that method not to be bound in the haskell bindings. This prevents the haskell bindtests from compiling. These should be re-enabled when optargs are implemented.
* gobject: Add basic bindtestsMatthew Booth2012-01-202-0/+35
|
* gobject: Add GObject bindingsMatthew Booth2012-01-203-0/+882
|
* generator: Add CamelName flagMatthew Booth2012-01-203-5/+15
| | | | | | | | | | We can make a good guess at camel case names for most APIs. For example, add_drive_opts can be automatically transformed to AddDriveOpts. However, other apis don't produce a satisfactory name when transformed automatically. For example, we would want md_create to produce MDCreate rather than MdCreate. This change adds a CamelName flag which allows a camel case name to be specified explicitly when the automatic transformation isn't satisfactory.
* c: Fix prototype generator when last argument is a BufferInMatthew Booth2012-01-201-1/+7
| | | | | | 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.
* bindtests: Add a test for RBufferOutMatthew Booth2012-01-202-0/+2
| | | | Fixup the existing test, and add an entry in actions so it's actually generated.
* bindtests: Fix sscanf test in test0rhashtableMatthew Booth2012-01-201-1/+1
|
* bindtests: Add something non-zero to the RStructList test outputMatthew Booth2012-01-201-0/+3
|
* Revert "generator: Add CamelName flag"Richard W.M. Jones2012-01-203-13/+5
| | | | This reverts commit 83c20f02dc0e97b098e9de837839a3f4a4416129.
* Tempus fugit.Richard W.M. Jones2012-01-1830-30/+30
| | | | Update all copyright dates to 2012.
* lib: Use -fvisibilty=hidden by default; only ABI symbols are now visible.Richard W.M. Jones2012-01-181-33/+37
| | | | http://gcc.gnu.org/wiki/Visibility
* ocaml: Don't include guestfs-internal.h directly.Richard W.M. Jones2012-01-181-0/+2
| | | | | | 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>.
* c: Allow NULL optargs to be passed to _argv callsMatthew Booth2012-01-171-0/+15
| | | | | | 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.
* c: NFC Remove redundant parenthesesMatthew Booth2012-01-171-1/+1
|
* generator: Add an explicit Cancellable flagMatthew Booth2012-01-173-19/+43
| | | | | | | | | Currently any api which takes a FileIn or FileOut parameter is implicitly cancellable. This change make cancellable an explicit flag in anticipation of it being added to other apis. Note that a Cancellable function must be able to return an error, which means it can't return RConstOptString.
* generator: Add CamelName flagMatthew Booth2012-01-173-5/+13
| | | | | | | | | | We can make a good guess at camel case names for most APIs. For example, add_drive_opts can be automatically transformed to AddDriveOpts. However, other apis don't produce a satisfactory name when transformed automatically. For example, we would want md_create to produce MDCreate rather than MdCreate. This change adds a CamelName flag which allows a camel case name to be specified explicitly when the automatic transformation isn't satisfactory.
* e2fsck: Tidy up the documentation for this API.Richard W.M. Jones2012-01-161-4/+8
|
* NEW API: add a new api e2fsckWanlong Gao2012-01-131-0/+24
| | | | | | | | | | | | | | m: Wanlong Gao <gaowanlong@cn.fujitsu.com> Add a new api e2fsck with two options: correct: same as '-p' option of e2fsck forceall: same as '-y' option of e2fsck Thanks for Rich's idea. v1->v2: use optargs_bitmask v2->v3: change the optargs_bitmask check Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* build: Remove .depend files from gitMatthew Booth2012-01-112-159/+1
| | | | | Remove generated .depend files from source control, and don't barf when they don't exist while bootstrapping.
* generator: Create a separate type for optional argumentsMatthew Booth2012-01-0917-199/+179
| | | | | | | | | | | | | | | | | | 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
* generator: Rename java_structs to camel_structs to better reflect their purposeMatthew Booth2012-01-095-19/+17
| | | | | 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.
* tests: Split images -> tests/data + tests/guestsRichard W.M. Jones2011-12-222-7/+7
|
* tests: Rename capitests -> tests/c-api.Richard W.M. Jones2011-12-225-21/+21
|
* fish: Allow events to be processed in guestfish.Richard W.M. Jones2011-12-164-4/+146
| | | | | | | | Add 'event', 'list-events' and 'delete-event' commands so that event handlers can be registered, listed and deleted in guestfish. The event handler is a shell script snippet or host command. Cc: Pádraig Brady <P@draigBrady.com>
* daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).Richard W.M. Jones2011-12-081-3/+24
| | | | | | | | | | 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.
* ruby: Use RSTRING_PTR, RSTRING_LEN for compat with Ruby 1.9 (RHBZ#760000).Richard W.M. Jones2011-12-051-2/+11
|
* NEW API: add blkid command to print the attributes of the deviceWanlong Gao2011-12-031-0/+38
| | | | | | | | | | | | A NEW API blkid. It can print the device attributes. Use it after list-devices, we can list ower devices and the attributes of each device. Use it like: blkid <device> It's should be a usefull function. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* perl: Memory leak: Free roots array along handle close path.Richard W.M. Jones2011-11-291-0/+1
|
* ruby: Memory leak: Free roots array along handle close path.Richard W.M. Jones2011-11-291-0/+1
|
* ocaml: Fix memory leak in bindings for functions that return buffers.Richard W.M. Jones2011-11-291-0/+1
| | | | | | | RBufferOut binding didn't free the buffer after copying it onto the OCaml heap. Found by valgrind.
* inspection: Add outline support for GNU/Hurd.Richard W.M. Jones2011-11-281-0/+4
|
* docs: Tidy up documentation for md-stop.Richard W.M. Jones2011-11-251-11/+1
| | | | This cleans up commit cbd1c45d95c530c8d94103dcc2c521bf5501ef59.
* New API: md-stop for stopping MD devicesWanlong Gao2011-11-241-0/+17
| | | | | | | | This API is used to stop a md device. When we want to move a device to another md array, we should stop the md device which contained this device first. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Rename mdadm_ apis to md_Matthew Booth2011-11-241-2/+2
| | | | | | | | | This change renames the following 2 apis: * mdadm_create -> md_create * mdadm_detail -> md_detail This is more consistent with list_md_devices, and removes a reference to an implementation detail from the api.
* Don't rely on implicit promotion of float to double in printf args.Richard W.M. Jones2011-11-221-3/+5
|
* fish: In generated code, put function names on a new line.Richard W.M. Jones2011-11-221-5/+10
| | | | | | | | | eg: static void run_foo () { }
* New API: mdadm-detail.Matthew Booth2011-11-171-0/+31
|
* New API: list-md-devices.Matthew Booth2011-11-111-0/+6
| | | | | | | Return a list of Linux MD devices detected in the guest. This API complements list_devices, list_partitions, list_lvs and list_dm_devices.
* New API: mdadm-create for creating MD devices.Richard W.M. Jones2011-11-111-0/+58
|