summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Set O_CLOEXEC flag on the virtio-serial file descriptor.Richard Jones2010-08-271-1/+7
|
* Add a core_pattern debug commandMatthew Booth2010-08-261-0/+53
| | | | | | This adds a new debug command, core_pattern, which writes a new pattern for coredump files to the appliance kernel, and sets the daemon's hard and soft core limits to infinity.
* Change protocol to send Linux errno from daemon to library.Richard Jones2010-08-241-4/+5
| | | | | | | This changes the protocol so that the Linux errno (if available) is sent back to the library. Note that the errno is not yet made available to callers, since it is not clear how best to present this Linux-specific number.
* Use virtio-serial, remove other vmchannel methods.Richard Jones2010-08-241-133/+6
| | | | | | | | | | | | | This adds support for virtio-serial, and removes all other vmchannel methods. Virtio-serial is faster than other methods, and is now widely available. I tested this by using the guestfs_upload API on an 83 MB file: before: 6.12 seconds (14.1 MB/sec) after: 4.20 seconds (20.6 MB/sec) (note this is with the current 8K chunk size)
* Change to using ext2-based, cached supermin appliance.Richard Jones2010-08-233-0/+34
| | | | | | | | | | | | This changes the method used to build the supermin appliance to use the new ext2-based appliance supported by latest febootstrap. The appliance can also be cached, so we avoid rebuilding it each time it is used. Mailing list discussion goes into the rationale and details: https://www.redhat.com/archives/libguestfs/2010-August/msg00028.html Requires febootstrap >= 2.8.
* New APIs: findfs-label and findfs-uuidRichard Jones2010-08-172-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | These two calls wrap up the /sbin/findfs command, allowing you to find a filesystem by only knowing its label or UUID. This is especially useful when resolving LABEL=... or UUID=... entries in /etc/fstab. Sample guestfish session: ><fs> vfs-uuid /dev/vda1 277dd61c-bf34-4253-a8dc-df500a05e7df ><fs> findfs-uuid 277dd61c-bf34-4253-a8dc-df500a05e7df /dev/vda1 ><fs> vfs-label /dev/vda1 /boot ><fs> findfs-label /boot /dev/vda1 ><fs> vfs-uuid /dev/VolGroup00/LogVol00 40ce7c36-82ce-4a12-a99d-48f5e054162c ><fs> findfs-uuid 40ce7c36-82ce-4a12-a99d-48f5e054162c /dev/mapper/VolGroup00-LogVol00 ><fs> findfs-uuid 12345678 libguestfs: error: findfs_uuid: findfs: unable to resolve 'UUID=12345678'
* New API: is-lv: check if a block device is a logical volume (RHBZ#619793)Richard Jones2010-07-301-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new API, guestfs_is_lv (g, device), which returns true iff the named device is an LVM2 logical volume. A sample guestfish session: ><fs> lvs /dev/vg_f13x64/lv_root /dev/vg_f13x64/lv_swap ><fs> list-devices /dev/vda ><fs> list-partitions /dev/vda1 /dev/vda2 ><fs> is-lv /dev/vg_f13x64/lv_root true ><fs> is-lv /dev/vg_f13x64/lv_swap true ><fs> is-lv /dev/vda false ><fs> is-lv /dev/vda1 false ><fs> is-lv /dev/vda2 false
* New APIs: Support for creating LUKS and managing keys.Richard Jones2010-07-221-20/+184
| | | | | | | | | | | | | | | | | | | This commit adds four APIs for creating new LUKS devices and key management. These are: luks_format Format a LUKS device with the default cipher. luks_format_cipher Format with a chosen cipher. luks_add_key Add another key to an existing device. luks_kill_slot Delete a key from an existing device. This enables all the significant functionality of the cryptsetup luks* commands. Note that you can obtain the UUID of a LUKS device already by using vfs-uuid. This also includes a regression test covering all the LUKS functions.
* New APIs: Support for opening LUKS-encrypted disks.Richard Jones2010-07-212-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for opening LUKS-encrypted disks, via three new APIs: luks_open: Create a mapping for an encrypted disk. luks_open_ro: Same, but read-only mapping. luks_close: Close a mapping. A typical guestfish session using this functionality looks like this: $ guestfish --ro -a encrypted.img ><fs> run ><fs> list-devices /dev/vda ><fs> list-partitions /dev/vda1 /dev/vda2 ><fs> vfs-type /dev/vda2 crypto_LUKS ><fs> luks-open /dev/vda2 luksdev Enter key or passphrase ("key"): ><fs> vgscan ><fs> vg-activate-all true ><fs> pvs /dev/dm-0 ><fs> vgs vg_f13x64encrypted ><fs> lvs /dev/vg_f13x64encrypted/lv_root /dev/vg_f13x64encrypted/lv_swap ><fs> mount /dev/vg_f13x64encrypted/lv_root / ><fs> ll / total 132 dr-xr-xr-x. 24 root root 4096 Jul 21 12:01 . dr-xr-xr-x 20 root root 0 Jul 21 20:06 .. drwx------. 3 root root 4096 Jul 21 11:59 .dbus drwx------. 2 root root 4096 Jul 21 12:00 .pulse -rw-------. 1 root root 256 Jul 21 12:00 .pulse-cookie dr-xr-xr-x. 2 root root 4096 May 13 03:03 bin NOT included in this patch: - An easier way to use this from guestfish. - Ability to create LUKS devices. - Ability to change LUKS keys on existing devices. - Direct access to the /dev/mapper device (eg. if it contains anything apart from VGs).
* New APIs: lvm-set-filter and lvm-clear-filter.Richard Jones2010-07-162-0/+245
| | | | | | | 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.
* file: Fix file command on /dev/VG/LV paths (RHBZ#582484).Richard Jones2010-06-081-1/+6
| | | | | | | | | | | | | 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-11/+35
| | | | | | | | | | | | | | | | | | | | | | 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-0/+20
|
* daemon: Rearrange code in 'file' command.Richard Jones2010-06-041-16/+15
| | | | | | | | path = path to access file (/sysroot/.. or /dev/..) display_path = original path, saved so we can display it buf = optional buffer which is freed along return codepaths There should be no change to the semantics of the code.
* Update to latest gnulib.Richard Jones2010-06-041-0/+1
|
* mkfs-b: Map block size to cluster size for VFAT and NTFS partitions ↵Richard Jones2010-06-031-5/+34
| | | | | | | (RHBZ#599464). This also adds a regression test for VFAT and (conditionally) NTFS filesystems.
* mkfs-b: Check that blocksize parameter is > 0 and a power of 2.Richard Jones2010-06-033-0/+14
|
* parted: Check partition number >= 1 in several calls.Richard Jones2010-06-021-0/+30
|
* daemon: Parse output of old parted which didn't support -m option (RHBZ#598309).Richard Jones2010-06-021-83/+284
| | | | | | | | This fixes the following commands when run with RHEL 5-era parted: get-bootable get-parttype part-list
* daemon: count_strings function returns size_tRichard Jones2010-06-023-4/+4
|
* base64-in: Ignore garbage characters in input.Richard Jones2010-06-021-1/+1
| | | | | | | | On RHEL 5 you have to specify the -i option to get the external 'base64' command to ignore \n characters. (The Fedora version seems to ignore these characters anyway). Add this option so the tests can pass on RHEL 5.
* daemon: write-file: Check range of size parameter (RHBZ#597135).Richard Jones2010-06-021-1/+22
| | | | This also adds a regression test.
* daemon: Limit label lengths (RHBZ#597118).Richard Jones2010-06-022-0/+42
|
* Fix and deprecate get_e2label and get_e2uuid (RHBZ#597112).Richard Jones2010-06-011-82/+2
| | | | | | | | | 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-011-0/+12
| | | | | | | | | | | 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).
* daemon: Kill blkid cache to improve reliability of blkid commands.Richard Jones2010-06-011-0/+7
| | | | | By killing the cache file, we make blkid work in situations such as a just-created filesystem.
* daemon: Generalize the implementation of vfs-type.Richard Jones2010-06-011-3/+9
| | | | Note that there is no change to the semantics of the code.
* New API: fallocate64 (replaces fallocate).Richard Jones2010-05-271-0/+11
| | | | | | 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.
* New API: available-all-groups to return list of all optional groups.Richard Jones2010-05-251-0/+18
|
* New API: ntfsresize-size to allow shrinking NTFS (RHBZ#585223).Richard Jones2010-05-211-0/+21
|
* New API: pvresize-size to allow shrinking PVs (RHBZ#585222).Richard Jones2010-05-211-0/+24
|
* New API: resize2fs-size to allow shrinking ext2 filesystems (RHBZ#585221).Richard Jones2010-05-211-0/+36
|
* generator: Make 'xz' into an optional group.Richard Jones2010-05-201-0/+8
| | | | | | | 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.
* New API: Implement pwrite system call (partial fix for RHBZ#592883).Richard Jones2010-05-201-0/+31
|
* New API: write for creating files with fixed content (RHBZ#501889).Richard Jones2010-05-201-0/+28
| | | | | | | | | | | | | 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.
* Improve errors from tar-in/tgz-in commands (RHBZ#591155 RHBZ#591250).Richard Jones2010-05-133-7/+46
| | | | | | | | | | | | | | | | | | | | This commit improves the error messages from the tar-in, tgz-in (etc) commands by capturing the stderr from the tar command in a file and sending that back in the error message. The method used for the error file is primitive, and there is a case for a more generic error file mechanism, but this will do for now. Sample error messages after this change: $ virt-tar -u /tmp/test1.img /tmp/not.tar / tar_in: tar subcommand failed on directory: /: tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors at /home/rjones/d/libguestfs/tools/virt-tar line 247. $ virt-tar -u /tmp/test1.img /tmp/test.tar / tar_in: tar subcommand failed on directory: /: tar: access.log: Cannot open: Read-only file system tar: Exiting with failure status due to previous errors at /home/rjones/d/libguestfs/tools/virt-tar line 247.
* Combine common code in daemon/tar.c.Richard Jones2010-05-131-120/+20
| | | | | This commit shouldn't result in any change in the semantics of the code.
* Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).Richard Jones2010-05-138-44/+51
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix error message in string-e command (RHBZ#588651).Richard Jones2010-05-131-0/+6
|
* New API: fill-pattern for creating files with predefined patterns.Richard Jones2010-05-121-0/+46
|
* Run udev_settle() after swapon/swapoff (RHBZ#516096).Richard Jones2010-05-121-0/+5
|
* daemon: Use 'error' instead of 'perror' before calling 'abort'.Richard Jones2010-05-071-4/+5
|
* daemon: gnulib module 'error' is used directly by the daemon.Richard Jones2010-05-071-0/+1
|
* daemon: Use parens around code section for safety.Richard Jones2010-05-071-1/+2
|
* daemon: Fix read-file so it fails gracefully for large files (RHBZ#589039).Richard Jones2010-05-072-8/+18
| | | | | | | | | | | | | | | | Pengzhen Cao noticed that read-file would fail for files larger than the protocol size; this is *not* the bug. However it would also lose protocol synchronization after this. The reason was that functions which return RBufferOut in the generator must not 'touch' the *size_r parameter along error return paths. I fixed read-file and initrd-cat, and I checked that pread was doing the right thing. This also adds regression tests for read-file with various categories of large file.
* daemon: Fix wc* commands to work on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-071-8/+10
|
* daemon: Fix strings to work on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-071-7/+11
|
* daemon: Fix head and tail commands to work on absolute symbolic links ↵Richard Jones2010-05-071-8/+10
| | | | (RHBZ#579608).
* daemon: Fix grep and related to work on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-071-8/+10
|
* daemon: Fix checksum to work on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-071-11/+23
|