summaryrefslogtreecommitdiffstats
path: root/generator
Commit message (Collapse)AuthorAgeFilesLines
...
* New APIs: rsync, rsync-in, rsync-outRichard W.M. Jones2012-08-111-0/+83
| | | | Implement rsync.
* generator: 'delete' is a reserved word (in C++).Richard W.M. Jones2012-08-111-4/+4
|
* ruby: Mark all VALUEs as volatile.Richard W.M. Jones2012-08-031-15/+26
|
* grep: Add optargs to grep API and deprecate fgrep etc.Richard W.M. Jones2012-08-021-6/+76
| | | | | | | | This commit makes grep into an optargs API, with flags for extended, fixed, [case-]insensitive and compressed. At the same time it deprecates: egrep, fgrep, grepi, egrepi, fgrepi, zgrep, zegrep, zfgrep, zgrepi, zegrepi and zfgrepi.
* xfs: add new api xfs-growfsWanlong Gao2012-08-021-0/+27
| | | | | | New api xfs_growfs for expanding a XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: utsnameRichard W.M. Jones2012-07-302-0/+23
| | | | | | | | | | 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
* ruby: Allow optional arguments hash to be really optional.Richard W.M. Jones2012-07-261-38/+59
| | | | | | | | | | | | | Allow optargs functions to be called as either: g.mkfs_opts(fs, device) or: g.mkfs_opts(fs, device, { optargs hash }) This also preserves backwards compatibility with once_has_no_optargs functions such as mkfs.
* ruby: In event wrapper, ignore callback functions which have type T_ZOMBIE.Richard W.M. Jones2012-07-261-2/+7
| | | | Note that in old versions of Ruby, T_ZOMBIE was not defined.
* New APIs: pvchange-uuid, pvchange-uuid-all, vgchange-uuid, vgchange-uuid-all.Richard W.M. Jones2012-07-251-0/+62
| | | | | | | | These APIs will allow sysprep to change the UUIDs of all PVs and VGs in the system. LVs don't have UUIDs AFAICT, or at least there seems to be no way to change them if they do have them.
* Mac OS X: Use u_int64_t/uint64_t instead of unsigned hyper in .x fileMasami HIRATA2012-07-241-8/+23
| | | | | | | Signed-off-by: Masami HIRATA <msmhrt@gmail.com> RWMJ: Fixed whitespace in generator_xdr.ml
* umount: use Dev_or_Path for the argument typeWanlong Gao2012-07-241-1/+1
| | | | | | | | | | | | | | Use Dev_or_Path instead of String. Remove the RESOLVE_DEVICE since Dev_or_Path will generate REQUIRE_ROOT_OR_RESOLVE_DEVICE instead. RWMJ: Note a change in semantics: this now requires root. However this is OK and still works with mkmountpoint and friends because 'is_root_mounted' works even if something is mounted below the root. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* xfs-info: Fix description to refer to 'pathordevice' param.Richard W.M. Jones2012-07-241-2/+2
|
* xfs_info: resolve device when doing xfs_info on a deviceWanlong Gao2012-07-241-1/+1
| | | | | | | Resolve device first, like do_umount. Use Dev_or_Path. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* umount: add force umount and lazy umountWanlong Gao2012-07-241-11/+12
| | | | | | Add the option force and lazy for force and lazy umount. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* python: Set file encoding to utf-8.Richard W.M. Jones2012-07-231-0/+5
|
* tests: Fix get-attach-method test.Richard W.M. Jones2012-07-231-2/+2
| | | | | | | | If ./configure --with-default-attach-method is set to something other than 'appliance', then this will legitimately return a different string. Simply test that it runs, rather than testing the output. This fixes commit 20a5b4de7ddc4221544784df65eb472481698dcb.
* tests: Remove get-pid test.Richard W.M. Jones2012-07-231-4/+1
| | | | | If the libvirt attach-method is used, then there is no known PID (libvirt hides it).
* launch: Allow default attach-method to be set in environment or configure.Richard W.M. Jones2012-07-231-3/+29
| | | | | | | | | | You can now choose the default attach method in two ways: (1) Set the LIBGUESTFS_ATTACH_METHOD environment variable. (2) ./configure --with-default-attach-method=appliance|libvirt|... Note that (1) overrides (2).
* Add attach-method "libvirt" or "libvirt:<URI>".Richard W.M. Jones2012-07-211-0/+7
| | | | | With this commit, you can set the attach method to libvirt, but calling launch will give an error.
* launch: Move guestfs_config API and build list of qemu parameters in handle.Richard W.M. Jones2012-07-201-2/+2
| | | | | | Move and rewrite guestfs_config so it accumulates a list of qemu parameters in the handle. These are added to the appliance at launch time (with attach method == unix:... you'll now get an error).
* add-cdrom: Rewrite description emphasising that this API should not be used.Richard W.M. Jones2012-07-201-20/+2
|
* Remove debug-cmdline API.Richard W.M. Jones2012-07-191-9/+0
| | | | | Note that debug* calls are not part of the stable API and can be removed or changed at any time.
* build: Rename most C files that contain underscore with dash.Richard W.M. Jones2012-07-193-6/+6
| | | | | | | This is just code motion. Some files cannot be renamed. Notably rpcgen input and output files must not contain dash characters, else rpcgen breaks.
* New API: add new api xfs_infoWanlong Gao2012-07-182-0/+53
| | | | | | | | | | | | 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.
* case_sensitive_path: Allow trailing path element to be missing (RHBZ#840115).Richard W.M. Jones2012-07-171-1/+4
| | | | | | | | | | | | case_sensitive_path is undefined when the final path element doesn't exist. Currently it returns an error, but this means that creating a new file doesn't work as expected: $ guestfish --rw -i -d windows touch 'win:c:\blah' libguestfs: error: case_sensitive_path: blah no file or directory found with this name We should allow this case (provided there is no trailing slash) so that new files or directories can be created.
* perl: In examples, call $g->shutdown, $g->close.Richard W.M. Jones2012-07-171-1/+2
|
* perl: Use $g instead of $h in documentation.Richard W.M. Jones2012-07-171-19/+19
| | | | $g is the "standard" name for libguestfs handles.
* generator: Rename 'ntfsresize_opts' API to 'ntfsresize'.Richard W.M. Jones2012-07-141-23/+4
| | | | | By using the once_had_no_optargs flag, this change is backwards compatible for callers.
* generator: Rename 'mkfs_opts' API to 'mkfs'.Richard W.M. Jones2012-07-143-38/+21
| | | | | By using the once_had_no_optargs flag, this change is backwards compatible for callers.
* generator: Rename 'add_drive_opts' API to 'add_drive'.Richard W.M. Jones2012-07-141-21/+5
| | | | | | 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).
* generator: In non-C bindings, generate '*_opts' alias.Richard W.M. Jones2012-07-1410-34/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | In C, a function called 'func' which has once_had_no_optargs=true will (because of the previous commit) generate 'func_opts' and a backwards-compatibility function called 'func'. This commit changes some of the non-C bindings so that they also generate 'func_opts' which is merely a wrapper that calls 'func'. This avoids incompatibility when we rename 'mkfs_opts' etc back to plain 'mkfs', and it also makes it easier to translate between other language bindings and C code. NB: Some bindings do not include aliases: PHP: There's no way to easily alias methods in PHP < 5.3, and we can't assume everyone has this minimum version. GObject: Very complex to add aliases, but we should probably do this at some point. Haskell: No support for optargs in these bindings. Unfortunately this means that we can no longer bind 'Guestfs.add_drive' (since it will be changed to add optional arguments) making the Haskell bindings even less useful than they were already.
* generator: Allow non-optargs functions to gain optargs.Richard W.M. Jones2012-07-145-112/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a flag (once_had_no_optargs) which can be used to add optargs to functions that currently don't have any. The idea is that if 'func' currently has no optargs, we can safely add optargs provided we are backwards compatible for existing callers. In C that means we leave 'guestfs_func' alone and provide an extra function 'guestfs_func_opts' that takes the optargs ('guestfs_func' becomes a wrapper that calls 'guestfs_func_opts'). In the C generator this means there are two names for each function (although the two names are normally identical). 'c_name' is the name that we export publicly (eg. [guestfs_] 'func_opts'). 'name' is the internal name of the function (eg. 'func') which is used for everything apart from the public interface, and also to generate the no-optargs compat function. In other languages that can add optional arguments safely, we simply add the arguments to the existing 'func', so for example in Perl: $g->func (required_args) $g->func (required_args, optional_args) can be used. Note that this commit does not cause any change to the output of the generator. I verified this by diffing the output before and after.
* generator: Rearrange some C generator code into sub-functions.Richard W.M. Jones2012-07-131-571/+585
| | | | | This is just code motion. I verified this by comparing the generator output before and after this commit.
* java: Generate overloaded non-optargs method for each optargs method.Richard W.M. Jones2012-07-131-0/+23
| | | | | | | | | | | | | | 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); }
* generator: Add c_optarg_prefix for each action.Richard W.M. Jones2012-07-1312-50/+49
| | | | This updates commit 9286f556c6a9e6967fcac8aacdae3660821c4c7a.
* generator: Add c_function (C function name) to each action struct.Richard W.M. Jones2012-07-1214-58/+68
| | | | | | | | | | | | | | | | | | | | | | | | | This field, which is generated internally by the generator, is the name of the C function corresponding to each action. For actions that have NO optional arguments, it's just "guestfs_<name>". For actions that have any optional arguments, it is "guestfs_<name>_argv" (since any binding has to construct the optional argument struct explicitly). In a future commit, this mapping may become more complex. This commit also "fixes" the C# bindings which didn't handle optional arguments properly at all. In fact, it doesn't fix this, it just changes it enough that it probably now compiles. We should either compile and test the bindings routinely with Mono, or drop them, since they are starting to bit-rot. In the GObject bindings, I have added a space between the C function name and the first paren. Apart from the C# and GObject changes, this is just code motion. It was verified by diffing the output of the generator before and after.
* generator: Change the way that camel-case names are generated.Richard W.M. Jones2012-07-124-53/+73
| | | | | | | | Store the camel-case name directly in the struct instead of generating it on the fly in only the GObject bindings. This is just code motion. Tested by verifying that the generator output is identical.
* tests: Rename test0* functions as internal_test*.Richard W.M. Jones2012-07-113-79/+94
| | | | | The internal_* prefix is reserved for internal functions such as these tests.
* generator: Use a struct instead of a tuple to describe each action.Richard W.M. Jones2012-07-1122-4104/+5738
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each action changes from a tuple like this: ("cat", (RString "content", [Pathname "path"], []), 4, [ProtocolLimitWarning], [InitISOFS, Always, TestOutput ( [["cat"; "/known-2"]], "abcdef\n")], "list the contents of a file", "[...]"); to a slightly longer but more readable struct: { defaults with name = "cat"; style = RString "content", [Pathname "path"], []; proc_nr = Some 4; protocol_limit_warning = true; tests = [ InitISOFS, Always, TestOutput ( [["cat"; "/known-2"]], "abcdef\n") ]; shortdesc = "list the contents of a file"; longdesc = "[...]" }; ["defaults" is a struct which contains the defaults for every field, allowing us to use the "{ defaults with ... }" syntax to just update the fields we want to be different from the defaults.] This is a mechanical change and there is no change to the output of the generator. I checked the output before and after with diff to verify this. There are no changes in the output apart from UUIDs which are expected to change with each run.
* generator: Add a note in generator/README about safely extending functions.Richard W.M. Jones2012-07-111-0/+9
|
* generator: Move note in comment to generator/README file.Richard W.M. Jones2012-07-112-8/+7
|
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-031-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* New API: guestfs_nr_devicesRichard W.M. Jones2012-06-291-0/+12
| | | | | | This returns the number of whole block devices added. It is usually simpler to call this than to list the devices and count them, which is what we do in some places in the current codebase.
* Ensure #include <config.h> occurs in every C file.Richard W.M. Jones2012-06-277-0/+14
|
* src/actions.c: Include <config.h> in this generated file.Richard W.M. Jones2012-06-271-0/+2
| | | | | | | On RHEL 5, because _GNU_SOURCE was not defined, open_memstream was not being declared, resulting in miscompilation and a segfault in the trace code whenever open_memstream returned a pointer >= 0x80000000 (which would be truncated to a 32 bit int and then sign-extended).
* launch: Treat /dev/null specially, for old KVM.Richard W.M. Jones2012-06-251-1/+5
| | | | | | | | | Old KVM can't add /dev/null readonly. Treat /dev/null as a special case. We also fix a few tests where /dev/null was being used with format=qcow2. This was always incorrect behaviour, but qemu appears to tolerate it.
* ruby: Add a replacement rb_hash_lookup function for Ruby 1.8.5.Richard W.M. Jones2012-06-221-0/+16
| | | | This function was first added to Ruby in 1.8.7.
* New API: device-index.Richard W.M. Jones2012-06-131-1/+14
| | | | | | This returns the index of the device, eg. /dev/sdb => 1. Or you can think of it as the order that the device was added, or the index of the device in guestfs_list_devices.
* New API: guestfs_canonical_device_name.Richard W.M. Jones2012-06-131-1/+29
| | | | This API makes device names canonical, eg. /dev/vda1 -> /dev/sda1.
* New API: guestfs_max_disks.Richard W.M. Jones2012-06-131-0/+13
| | | | Returns the maximum number of disks that may be added to a handle.