summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* generator: Fix typo in error message for RConstOptString.Richard Jones2010-08-171-1/+1
| | | | (cherry picked from commit 29925244c1be2d1d5f71d46eba205278624a1366)
* Rename internal functions.Richard Jones2010-08-173-12/+12
| | | | | | | | This is an update to commit 41f25ab3df5f306ac717fa7a6efd58328d30c1ae. Internal functions should be named guestfs___* (3 underscores) to avoid clashing with the implementation of actions (2 underscores). (cherry picked from commit 737181bcd7b1de8c3a613d6282030c34efa78fb6)
* Rearrange library code into separate files.Richard Jones2010-08-175-2199/+2354
| | | | | | | | | | | | | | | We split the library code into these separate files: - guestfs.c: creating handles, closing handles, handle-related variables - actions.c: generated library-side stubs for each action - bindtests.c: generated code to test bindings - launch.c: launching the appliance - proto.c: the library side of the daemon communications protocol This is just code movement. Cherry picked from commit 41f25ab3df5f306ac717fa7a6efd58328d30c1ae and rebased for stable branch.
* Rename guestfs-{actions,bindtests}.c to {actions,bindtests}.cRichard Jones2010-08-173-7/+7
| | | | | | Rename these two generated files, in preparation for splitting up the main src/guestfs.c file. (cherry picked from commit a617f521a4f695a63ced1c734128dc6c05b7024f)
* Move variable initialization close to variable use.Richard Jones2010-08-171-3/+3
| | | | (cherry picked from commit 2fd8c259d3daa88b0cdf98090bb57f3dbd178432)
* Revert "add_drive_ro adds readonly=on option if available." (RHBZ#617200).Richard Jones2010-08-172-21/+5
| | | | | | | | | | | | | | | | | | | Adding the readonly=on option is not so clever. This causes qemu to present the disk as read-only to the guest. (The expected behaviour of snapshots=on,readonly=on was that it would open the disk O_RDONLY but present a writable disk to the guest). Since the guest sees a read-only disk, we are unable to do any recovery if a filesystem on the disk is inconsistent. This basically prevents most accesses to live disk images. What we really want is a qemu option which presents a writable disk to the guest, but only opens the disk on the host side with O_RDONLY, to alleviate the udev bug RHBZ#571714. This reverts commit 676462684e05dd8341dd695762dd99a87d8ec022. (cherry picked from commit 799d52be4f08f6c70c0e8ba1aa7367ba4cdd78c4)
* generator: Remove unnecessary parameter.Richard Jones2010-08-171-4/+4
| | | | | | The 'name' parameter is not used on the right hand side of the match, so it can be removed. (cherry picked from commit 2e7da2a2f3bbc6d6db148d7dc2ce238bf56f34db)
* Use an unsigned type (size_t) for all loop iterators.Richard Jones2010-08-171-22/+27
| | | | | | | | | | This resolves a warning from gcc 4.5: assuming signed overflow does not occur when simplifying conditional to constant This page explains the issues in some detail: http://www.airs.com/blog/archives/120 (cherry picked from commit 321ca1ef91a90cec5b94058b84420e8018e3f1d8)
* generator: Don't hard-code name in DeviceList check.Richard Jones2010-08-171-3/+6
| | | | | | Only one function currently uses DeviceList. The generated code unfortunately hard-coded the argument name from that function. (cherry picked from commit aac51942aab63a9355ad6724345ea923148bf2a9)
* doc: Add guestfish 'lvcreate 1M' gotcha.Richard Jones2010-08-171-0/+21
| | | | (cherry picked from commit 5b77be72bc4e46c7a53a24f1eb4cbd107a708f17)
* ocaml: Fix thread safety of strings in bindings (RHBZ#604691).Richard Jones2010-06-161-10/+15
| | | | | | | | | | | | | | | | | | | | | | There's a thread safety issue with the current OCaml bindings which is well explained in the bug report: https://bugzilla.redhat.com/show_bug.cgi?id=604691 This commit fixes the safety issue by copying strings temporarily before releasing the thread lock. Updated code looks like this: char *filename = guestfs_safe_strdup (g, String_val (filenamev)); int r; caml_enter_blocking_section (); r = guestfs_add_drive_ro (g, filename); caml_leave_blocking_section (); free (filename); if (r == -1) ocaml_guestfs_raise_error (g, "add_drive_ro"); Also included is a regression test.
* perl: Add explicit close() method (RHBZ#602592).Richard Jones2010-06-101-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | This add an optional explicit $g->close method which may be used to force the handle to be closed immediately. Note the provisos about this method in the manual page entry. Callers should *not* normally use this method. The implementation of the handle also changes. Before, the handle was a blessed reference to an integer (the integer being the pointer to the C guestfs_h handle). Now we change this to a hashref containing currently the following field: _g => pointer to C guestfs_h handle (as an integer) If this field is not present, it means that the handle has been explicitly closed. This avoids double-freeing the handle. The user may add their own fields to this hash in order to store per-handle data. However any fields whose names begin with an underscore are reserved for use by the Perl bindings. This commit also adds a regression test. This commit also changes the existing warning when you call a method without a Sys::Guestfs handle as the first parameter, into an error. This is because such cases are always errors.
* Add error callback (RHBZ#602599).Richard Jones2010-06-104-5/+58
| | | | Read the note in the man page before using this feature.
* Fix typo in documentation of guestfs_set_launch_done_callback.Richard Jones2010-06-101-1/+1
|
* file: Fix file command on /dev/VG/LV paths (RHBZ#582484).Richard Jones2010-06-081-1/+1
| | | | | | | | | | | | | Previous commit 4df593496e116dfb635731c058b7627e81fc179c broke the "file" command on logical volume paths, since these are symbolic links. We *should* follow these (only). This inadvertantly broke virt-inspector too, which indicates that we need more regression testing in this area. Since carrying whole Fedora images around could make the distribution even larger than now, I'm not sure at the moment how to do this. Thanks to Matt Booth for diagnosing this bug.
* file: Restrict to regular files (RHBZ#582484).Richard Jones2010-06-041-5/+18
| | | | | | | | | | | | | | | | | | | | | | The file call can hang if called on char devices (because we are using the file -s option). This is hard to solve cleanly without adding another file API. However this restricts file to regular files, unless called explicitly with a /dev/ path. For non-regular files, it will now return a string like "directory". There is a small semantic change for symbolic links. Previously it would not have worked at all on absolute links (or rather, the results would have been undefined). It would have treated relative symlinks to regular files as the regular file itself. Now it will return the string "symbolic link" in both cases. This commit also makes the API safe when called on untrusted filesystems. Previously a filesystem might have been set up so that (eg) /etc/redhat-release was a char device, which would have caused virt-inspector and virt-v2v to hang. Now it will not hang.
* touch: Restrict touch to regular files only (RHBZ#582484).Richard Jones2010-06-041-1/+4
|
* mkfs-b: Map block size to cluster size for VFAT and NTFS partitions ↵Richard Jones2010-06-031-2/+17
| | | | | | | (RHBZ#599464). This also adds a regression test for VFAT and (conditionally) NTFS filesystems.
* generator: Allow individual tests to depend on daemon features.Richard Jones2010-06-031-2/+12
| | | | | | | | Using IfAvailable "featurename" we allow individual tests to only run if the feature is available in the daemon. This will allow us to extend testing to a lot more optional features such as NTFS.
* tests: Factor out common code into 'is_available' function.Richard Jones2010-06-031-10/+16
| | | | This commit is just code motion.
* grub-install: Enable grub-install tests and create explicit device.map file.Richard Jones2010-06-031-4/+7
|
* grub-install: In docs suggest manually creating device.map (RHBZ#484986).Richard Jones2010-06-031-1/+12
|
* resize2fs: Document this command also works with ext4 (thanks Yufang Zhang).Richard Jones2010-06-021-3/+3
|
* fish: help command return error for non-existent commands (RHBZ#597145).Richard Jones2010-06-021-3/+5
| | | | | | | | | | | | | | With this change, the exit status indicates error for non-existent commands. $ guestfish -h foo foo: command not known, use -h to list all commands $ echo $? 1 $ guestfish help foo foo: command not known, use -h to list all commands $ echo $? 1
* daemon: write-file: Check range of size parameter (RHBZ#597135).Richard Jones2010-06-021-1/+3
| | | | This also adds a regression test.
* Fix and deprecate get_e2label and get_e2uuid (RHBZ#597112).Richard Jones2010-06-011-3/+8
| | | | | | | | | Fix these calls (see description in RHBZ#597112), but also deprecate them since the new calls vfs_label and vfs_uuid can work on any filesystem type. This also adds a regression test for the original bug reported in RHBZ#597112.
* New APIs: vfs-label and vfs-uuid return label and uuid for many fs types.Richard Jones2010-06-012-1/+24
| | | | | | | | | | | These APIs generalize the existing 'get-e2label' and 'get-e2uuid' calls, to provide calls which should be able to get the label and UUID for most filesystem types. These use 'blkid' to do the work. I have tested that the blkid commands themselves work on RHEL 5. (Suggested by Yufang Zhang).
* Fix documentation for vfs-type to reflect reality.Richard Jones2010-05-271-5/+6
|
* Clarify documentation on distro backports in version command.Richard Jones2010-05-271-2/+4
|
* Add reference to version number documentation to version command.Richard Jones2010-05-271-0/+2
|
* Clarify sparse behaviour of truncate-size command.Richard Jones2010-05-271-2/+7
|
* Fix typo in documentation of guestfs_readlinklist.Richard Jones2010-05-271-1/+1
|
* Fix missing word in docuentation of guestfs_readdir.Richard Jones2010-05-271-1/+1
|
* Revise documentation on creating files.Richard Jones2010-05-271-1/+5
|
* New API: fallocate64 (replaces fallocate).Richard Jones2010-05-272-2/+24
| | | | | | guestfs_fallocate takes an integer for the length, effectively limiting it to creating 1GB files. This new call takes an int64_t for the length, but is otherwise identical.
* Fix typo in description of echo-daemon command.Richard Jones2010-05-261-2/+2
|
* Add tests for available-all-groups command.Richard Jones2010-05-251-1/+1
|
* fish: New command: 'supported'Richard Jones2010-05-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This checks all available optional groups and prints out which ones are supported by the daemon. Note you must launch the appliance first. Example: ><fs> supported augeas yes inotify yes linuxfsuuid yes linuxmodules yes linuxxattrs yes lvm2 yes mknod yes ntfs3g yes ntfsprogs yes realpath yes scrub yes selinux yes xz yes zerofree yes
* New API: available-all-groups to return list of all optional groups.Richard Jones2010-05-252-1/+15
|
* guestfs_version: Correct documentation.Richard Jones2010-05-221-2/+3
| | | | | Remove reference to 'ELF weak linking tricks' and replace with suggestion to use dl* functions.
* Build workaround for Python 2.4.x in RHEL 5.Richard W.M. Jones2010-05-211-0/+6
| | | | | See: http://www.python.org/dev/peps/pep-0353/#conversion-guidelines
* C99 compatible build fix for RHEL 5.Richard W.M. Jones2010-05-211-3/+6
|
* New API: ntfsresize-size to allow shrinking NTFS (RHBZ#585223).Richard Jones2010-05-212-1/+8
|
* New API: pvresize-size to allow shrinking PVs (RHBZ#585222).Richard Jones2010-05-211-0/+7
|
* New API: resize2fs-size to allow shrinking ext2 filesystems (RHBZ#585221).Richard Jones2010-05-211-0/+7
|
* fish: Allow suffixes on number parameters (eg. 1M)Richard Jones2010-05-211-1/+4
| | | | | | | | | | | | | | | | This small change uses the gnulib xstrtoll functionality to enable suffixes on integer parameters in guestfish. For example: truncate-size /file 1G (previously you would have had to given the full number). This also applies to the 'alloc' and 'sparse' commands (and indirectly to the -N option). The specification for these commands has changed slightly, in that 'alloc foo 1MB' would now use SI units, allocating 1000000 bytes instead of a true megabyte. All existing uses would use 'alloc foo 1M' which still allocates true megabytes.
* generator: Make 'xz' into an optional group.Richard Jones2010-05-201-2/+2
| | | | | | | On Ubuntu <= Karmic, xz-utils was not packaged, and therefore any xz-related tests would fail. Thus make this an optional group so that we can test for this and avoid running the tests if xz utils are not present.
* generator: Check parameters are not NULL (RHBZ#501893).Richard Jones2010-05-201-10/+47
| | | | | | | | | | | | | | This adds additional tests to check that several types of parameter including String are not NULL when passed to the C functions. Previously this would cause a segfault inside libguestfs. With this change, you get an error message / exception. Of the possible pointer parameters, only OptString is now permitted to be NULL. This change does not affect the Perl bindings. This is because Perl XS code was already adding similar checks if you passed undef into a parameter expecting a string.
* generator: Some String parameters should be OptString (RHBZ#501894).Richard Jones2010-05-201-2/+2
| | | | | I haven't checked the list of functions exhaustively, but these are the obvious ones.
* New API: Implement pwrite system call (partial fix for RHBZ#592883).Richard Jones2010-05-202-2/+30
|