summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* generator: Refactor code for Perl bindings.Richard W.M. Jones2010-10-231-146/+133
| | | | | | | This simplifies the code that generates the Perl bindings by removing repeated sections. Cherry picked from commit ea6209198026080a9d9e588283e83aa9c4e2f177.
* generator: Missing newline character.Richard W.M. Jones2010-10-231-1/+1
| | | | Cherry picked from commit ed74706d80394fef709ec0258fc5cf7d974ff8b1.
* fish: Change 'int argc' to 'size_t argc' throughout.Richard W.M. Jones2010-10-231-2/+2
| | | | Cherry picked from commit 6391d1a7cfa10337a75465c72d49df3c9ebc65ca.
* fish: In guestfish(1) turn command references into links.Richard W.M. Jones2010-10-231-1/+1
| | | | Cherry picked from commit 585fceb3350c17a3d6ed7f2daffd5e2b3e5fc3e1.
* generator: Don't use real uuidgen for UUIDs.Richard Jones2010-10-231-11/+16
| | | | | | | This was one reason why capitests/tests.c changed every time the generator was run. Cherry picked from commit 451a28349b11fe08cb3f7ca84e58b6e69646707b.
* generator: Fix incorrect shortdesc in docs for 'is-dir' command.Richard Jones2010-10-231-1/+1
| | | | (cherry picked from commit 55b6e18f95950b1a2ec69d549c9e6c8a5758d166)
* generator: Fix documentation for 'is-file' command.Richard Jones2010-10-231-2/+2
| | | | (cherry picked from commit 22aa9268f548eab9763311a080859d8cf2257a93)
* guestfs: Reference guestfs-browser architecture in threads documentation.Richard Jones2010-10-231-0/+3
| | | | (cherry picked from commit 13be76168260ee57e3d134177066ca7ceb984092)
* guestfs: More accurate documentation for initial message.Richard Jones2010-10-231-4/+3
| | | | (cherry picked from commit e2ef068cb7d18f0c0d4931f97332a38ea4ea2477)
* guestfs: Remove traces of documentation for non-existent 'low-level API'Richard Jones2010-10-231-13/+10
| | | | (cherry picked from commit 6d9f8f5c140c3116fb0292fcf73f560812c7d5fb)
* guestfs: Fix typo in man page.Richard Jones2010-10-231-1/+1
| | | | (cherry picked from commit f3c05da4f9c226c18476eb135dfcb5875d65bf63)
* fish: Generate list of prepared disk image types.Richard Jones2010-10-231-0/+114
| | | | | | This commit shouldn't change the semantics of the code. Cherry picked from commit 60cdd02b02578b427ca3926d566811c6bb7a9970.
* build: guestfs-structs.h was missing from libguestfs_la_SOURCES.Richard Jones2010-09-081-0/+1
| | | | (cherry picked from commit 5fc69ce3ece5e4d4a3da9d78da244c4fa301b5ac)
* perl: Document handle is a hashref.Richard Jones2010-09-081-0/+18
| | | | | For details see commit eb566f7dc7974b42ac65729a2e5e5bcee329a0a9. (cherry picked from commit b8b0c99b46172712aa190f70182734934587af7b)
* perl: Add documentation about testing availability of methods and features.Richard Jones2010-09-081-0/+31
| | | | (cherry picked from commit 0f24424f357e854a9da382de11e4fe81305c8743)
* Consistent use of 'void *opaque' to refer to opaque pointer in C API.Richard Jones2010-09-082-10/+10
| | | | | | | | We inconsistently used 'void *data' or 'void *opaque' all over to refer to the same thing. Use 'void *opaque' in all places in the published API and documentation. Cherry picked from commit 867319ec5f9030d3c14c32e3302606f2bf11ac27.
* Rename global 'xdr_str'.Richard Jones2010-08-261-5/+5
| | | | | | | | Two bits of XDR both contained a definition called 'str' which means that 'xdr_str' was being exported globally twice. Because of the linker script this didn't affect us. But it's best to rename this global so that conflicts cannot arise. (cherry picked from commit 27ef6f9171127afd248f38d280cf3d0eae51fdaf)
* Add -nodefconfig command line option to qemu.Daniel Berrange2010-08-261-0/+3
| | | | | | Without this option, qemu will read some defaults from /etc/qemu/ configuration files. (cherry picked from commit 6d15d4e7c27477507ba355384a340ce86cec617b)
* Make print_timestamped_message into a cross-module function.Richard Jones2010-08-262-9/+9
| | | | | This is just code movement. (cherry picked from commit 4b753c62089be663ac722e4a875bb061d259e87d)
* Factor out code for locating the temporary directory.Richard Jones2010-08-262-11/+22
| | | | | | | | This is just code movement. For stable-1.4 branch, cherry picked from commit a2d4a8bf073c3551d174bd6c406e0cf3d27fb560 and backported.
* Whitespace change: Add blank line between structures and functions.Richard Jones2010-08-261-0/+1
| | | | (cherry picked from commit 4d2f1632ad655130fafab3bf7fe8fa5cb59705d8)
* generator: No need to redefine safe_* macros.Richard Jones2010-08-261-7/+0
| | | | | | These are already defined in "guestfs-internal.h" which is included in the .c file. (cherry picked from commit 3cd272fc6acb043b4002dbcbbf741cecbc4820be)
* Add safe_strndup call.Richard Jones2010-08-262-0/+10
| | | | (cherry picked from commit 3905cc7ab496549b6ca0a0f67ec61d1d16968c33)
* 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).