summaryrefslogtreecommitdiffstats
path: root/generator
Commit message (Collapse)AuthorAgeFilesLines
...
* resize2fs: Run 'e2fsck -f' automatically if filesystem is not mounted.Richard W.M. Jones2012-03-091-11/+2
|
* Mark e2fsck-f as deprecated, replaced by e2fsck API.Richard W.M. Jones2012-03-091-1/+1
|
* fish: Document that guestfish sets pgroup to true (RHBZ#801273).Richard W.M. Jones2012-03-081-1/+3
|
* fish: Properly free up strings, lists along all error paths (found by Coverity).Richard W.M. Jones2012-03-081-84/+106
| | | | | | | | | | | | | | | | | | | | This also includes some tidying up of the generated code. Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13254: alloc_fn: Calling allocation function "parse_string_list". /builddir/build/BUILD/libguestfs-1.16.5/fish/fish.c:1386: alloc_fn: Storage is returned from allocation function "realloc". /builddir/build/BUILD/libguestfs-1.16.5/fish/fish.c:1386: var_assign: Assigning: "argv_new" = "realloc(argv, 8UL * argv_len)". /builddir/build/BUILD/libguestfs-1.16.5/fish/fish.c:1392: var_assign: Assigning: "argv" = "argv_new". /builddir/build/BUILD/libguestfs-1.16.5/fish/fish.c:1396: return_alloc: Returning allocated memory "argv". /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13254: var_assign: Assigning: "devices" = storage returned from "parse_string_list(argv[i++])". /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13271: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13288: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13293: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13311: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13316: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13334: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13349: leaked_storage: Variable "devices" going out of scope leaks the storage it points to. /builddir/build/BUILD/libguestfs-1.16.5/fish/cmds.c:13355: leaked_storage: Variable "devices" going out of scope leaks the storage it points to.
* Dead code: Remove comma-check in first if-clause (found by Coverity).Richard W.M. Jones2012-03-081-3/+4
| | | | | | | | Error: DEADCODE: /builddir/build/BUILD/libguestfs-1.16.5/fish/event-names.c:65: dead_error_condition: On this path, the condition "comma" cannot be true. /builddir/build/BUILD/libguestfs-1.16.5/fish/event-names.c:57: const: After this line, the value of "comma" is equal to 0. /builddir/build/BUILD/libguestfs-1.16.5/fish/event-names.c:57: assignment: Assigning: "comma" = "0". /builddir/build/BUILD/libguestfs-1.16.5/fish/event-names.c:65: dead_error_line: Execution cannot reach this statement "fputc(44, fp);".
* inspection: Add detection of FreeDOS (RHBZ#786215).Richard W.M. Jones2012-03-071-0/+8
| | | | | FreeDOS is returned as type="dos", distro="freedos". No version or application information is returned at present.
* Add support for Buildroot and Cirros distributions.Richard W.M. Jones2012-03-071-0/+8
|
* Remove ConfigOnly flag from set-autosync.Richard W.M. Jones2012-03-051-1/+1
| | | | | | guestfs_set_autosync sets a flag which affects guestfs_close, and so this call can be made at any time before the handle is closed, not just in the config state.
* Make "template" a reserved word.Marcin Gibula2012-03-042-4/+4
| | | | | | Function guestfs_mkdtemp uses c++ keyword "template" as a parameter name. In result, attempt to use guestfs.h header in c++ program results in compile error.
* New API: set-label, for setting a label on any filesystem.Richard W.M. Jones2012-02-271-2/+26
| | | | | | Currently only ext2/3/4 and (newly) NTFS are supported. This change also deprecates set-e2label.
* New APIs: ntfsclone-in, ntfsclone-out.Richard W.M. Jones2012-02-271-0/+27
|
* 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
|