summaryrefslogtreecommitdiffstats
path: root/generator
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* New API: fstrim - allow filesystem trim.Richard W.M. Jones2012-06-121-2/+25
|
* blockdev_getbsz: Remove test.Richard W.M. Jones2012-06-091-2/+1
| | | | | The output of this test depends on page size, so on ppc64 it returns 64K.
* New API: filesystem-available: tests for filesystem availability.Richard W.M. Jones2012-06-091-1/+20
| | | | | This also creates an internal filesystem_available function within the daemon.
* java: Remove unnecessary imports from the generated Java code.Richard W.M. Jones2012-05-221-8/+0
|
* NEW API: add new api btrfs-fsckWanlong Gao2012-05-151-0/+9
| | | | | | | | | Add the new API btrfs-fsck to check the btrfs filesystem. Btrfs is currently under heavy development, and not suitable for any uses other than benchmarking and review. But it'll be useful in the near future. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: add new api btrfs-set-seeding to enable or disable seeding.Wanlong Gao2012-05-141-0/+10
| | | | | | | Add the new API btrfs-set-seeding to support the seeding-device feature for btrfs. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* fish: glob command now expands /dev/ patterns (RHBZ#635971).Richard W.M. Jones2012-05-021-1/+5
| | | | | | | | | | | | | For example: ><fs> glob echo /dev/* /dev/vda /dev/vda1 /dev/vda2 /dev/vda3 ><fs> glob echo /dev/v*/* /dev/vg_f16x64/lv_root /dev/vg_f16x64/lv_swap
* Remove "convenience header" "gettext.h" and use <libintl.h> instead.Richard W.M. Jones2012-05-011-0/+4
| | | | | | | | | | | | gettextize provides a local file called "gettext.h". Remove this and use <libintl.h> from glibc headers instead. Most of this change is mechanical: #include <libintl.h> in every C file which uses any gettext function. But also we remove the gettext.h file, and adjust the "_" macros. Note that this effectively removes the ./configure --disable-nls option, although we don't know if that ever worked.
* lib: Remove the BUSY state.Richard W.M. Jones2012-04-262-24/+9
| | | | | | | | | | | | | | | Originally this state was intended so that in some way you could find out if the appliance was running a command. However there was never a thread-safe way to access the state of the handle, so in effect you could never do anything useful safely with this information. This commit completely removes the BUSY state. The only visible change is to the guestfs_is_busy API. Previously you could never call this safely from another thread. If you called it from the same thread it would always return false (since the current thread can't be running a libguestfs command at that point by definition). Now it always returns false.
* gobject: Use generator_built macro to ensure generated files are rebuilt ↵Richard W.M. Jones2012-04-261-2/+2
| | | | properly.
* gobject: Move headers into a subdirectoryMatthew Booth2012-04-262-10/+13
| | | | | | | | | The gobject bindings generate a large number of header files, which pollute /usr/include when installed. This patch moves them all into a guestfs-gobject/ subdirectory. guestfs-gobject.h remains in the same place. This change also moves generated source files into src/, because it makes the gobject directory a bit tidier.