summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* generator: Remove unnecessary parameter.Richard Jones2010-07-211-4/+4
| | | | | The 'name' parameter is not used on the right hand side of the match, so it can be removed.
* New APIs: lvm-set-filter and lvm-clear-filter.Richard Jones2010-07-162-1/+42
| | | | | | | These APIs allow you to change the device filter, the list of block devices that LVM "sees". Either you can set it to a fixed list of devices / partitions, or you can clear it so that LVM sees everything.
* Use an unsigned type (size_t) for all loop iterators.Richard Jones2010-07-161-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
* generator: Don't hard-code name in DeviceList check.Richard Jones2010-07-161-3/+6
| | | | | Only one function currently uses DeviceList. The generated code unfortunately hard-coded the argument name from that function.
* doc: Add guestfish 'lvcreate 1M' gotcha.Richard Jones2010-07-161-0/+21
|
* Make tmp directory world readable (RHBZ#610880).Richard Jones2010-07-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | If you have a restrictive umask (0077 for example) then files in the tmp directory would be created with 0600 permissions. Example: drwx------. 2 rjones rjones 4096 Jul 2 17:52 . drwxrwxrwt. 57 root root 102400 Jul 2 17:52 .. -rw-------. 1 rjones rjones 86328832 Jul 2 17:52 initrd lrwxrwxrwx. 1 rjones rjones 46 Jul 2 17:52 kernel -> /boot/vmlinuz-2.6.33-0.40.rc7.git0.fc13.x86_64 This in itself is not a problem. However in virt-v2v we also change UID:GID and the result is that qemu is unable to read the initrd file: qemu: could not load initial ram disk '/tmp/libguestfs2ssynP/initrd' With this patch we make the tmp directory and the files world readable. After the patch: $ ls -la /tmp/libguestfsJFVzPg/ total 116192 drwxr-xr-x. 2 rjones rjones 4096 Jul 2 18:03 . drwxrwxrwt. 56 root root 102400 Jul 2 18:03 .. -rw-r--r--. 1 rjones rjones 118869504 Jul 2 18:03 initrd lrwxrwxrwx. 1 rjones rjones 46 Jul 2 18:03 kernel -> /boot/vmlinuz-2.6.33-0.40.rc7.git0.fc13.x86_64
* 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
|
* New API: write for creating files with fixed content (RHBZ#501889).Richard Jones2010-05-203-51/+54
| | | | | | | | | | | | | The guestfs_write call can be used to create small files with arbitrary 8 bit content, including \0 bytes. This replaces and deprecates write-file, which cannot be modified to use BufferIn because of an unfortunate choice in the ABI: the size parameter to write-file, if zero, means that the daemon tries to calculate the length of the buffer using strlen. However this fails if we pass a zero-length buffer using BufferIn because then the daemon tries to do strlen on a (really) zero length buffer, not even containing a terminating \0 character, thus segfaulting.
* generator: Implement BufferIn parameter type (RHBZ#501889).Richard Jones2010-05-201-38/+165
| | | | | | | | | | | | The BufferIn argument turns into various things: in C const char *, size_t parameter pair in XDR an opaque<> type (instead of string) which allows \0 chars in other bindings mostly just a string, since most languages except for C permit strings to contain any 8 bit data
* Unify supermin appliance building using febootstrap 2.7Richard Jones2010-05-131-12/+10
|
* Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).Richard Jones2010-05-131-9/+9
| | | | | | | | | | | | | | | | | | | | | | | During a FileIn command (eg. upload, tar-in) if both sides experience errors, then both sides could send cancel messages, the result being lost synchronization. The reason for the lost synch was because the daemon was ignoring this case and sending an error message back which the library side (which had cancelled) was not expecting. Fix this by checking in the daemon for the case where the library also cancels during daemon cancellation, and not sending an error messages. This also includes an enhanced regression test which checks for this case. This extends the original fix in commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0. More details can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5