summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* daemon: Fix hexdump to work on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-071-7/+11
|
* daemon: Fix for commands working on absolute symbolic links (RHBZ#579608).Richard Jones2010-05-072-5/+102
| | | | | | | | | | | | | | | | The original idea (suggested by Al Viro) was to fork and chroot into the sysroot and read the file from there. Because of the separate process being chrooted, absolute links would be resolved correctly. The slightly modified idea is to open the file in the daemon process (but temporarily chrooted, so symlinks resolve correctly), fork, and have the subprocess just be responsible for copying the file. (Strictly speaking we don't need to fork, but this implementation is simpler). This commit just includes the changes needed to the command*() functions in daemon/guestfsd.c and adds an absolute symlink to the test ISO for testing it. Later commits will fix the broken daemon commands themselves.
* daemon: Change command to abort() on resource problems.Richard Jones2010-05-071-7/+12
| | | | | | | | | | | | | The comment in the code describes it thus: /* Note: abort is used in a few places along the error paths early * in this function. This is because (a) cleaning up correctly is * very complex at these places and (b) abort is used when a * resource problem is indicated which would be due to much more * serious issues - eg. memory or file descriptor leaks. We * wouldn't expect fork(2) or pipe(2) to fail in normal * circumstances. */
* Update to latest gnulib.Richard Jones2010-05-061-0/+3
|
* Change network configuration to use macros.Richard Jones2010-05-041-4/+9
| | | | | | | | | | | | | Change the network configuration so everything is set using some macros at the top of src/guestfs.c. Also, rename the macros used in the daemon so they are not the same. It was a very long time since these sets of macros had to match the ones defined in src/guestfs.c, despite what the comment said. Note that this commit should not change the semantics of the program at all.
* lvresize: Use --force so it can make LVs smaller (RHBZ#587484).Richard Jones2010-04-301-1/+1
| | | | This also adds a regression test for this bug.
* New API: checksums-out for checksumming many files.Richard Jones2010-04-231-0/+84
| | | | Useful API for verifying the integrity of virtual machines.
* daemon: Split out checksum type to program name mapping into function.Richard Jones2010-04-231-14/+22
| | | | This shouldn't change the semantics of the program.
* New APIs: base64-in and base64-out for uploading/downloading base64 content.Richard Jones2010-04-192-0/+151
|
* New API: debug-upload (not a formal part of the API/ABI).Richard Jones2010-04-191-9/+82
| | | | | | | | | | | | Allow arbitrary files to be uploaded into the appliance, but only when --enable-debug-command is enabled. This lets you run shell scripts, like this: ><fs> debug-upload -<<EOF /tmp/script.sh 0700 #!/bin/sh - # ... EOF ><fs> debug sh "/tmp/script.sh"
* Fix upload losing synchronization if root not mounted (RHBZ#576879).Richard Jones2010-04-178-51/+34
| | | | | | | | | | | | Modify the generator so that it can correctly handle early cancellation for Pathname|Device|.. parameters. This fixes the upload command, but consequently we need to fix the parameters for tar_in and t?z_in commands. This should also mean that 'win:' can now be used as the second argument of tar_in and t?z_in commands in guestfish, whereas previously this wouldn't have worked. Adds a regression test for the original problem.
* Improved checking, documentation of modes (RHBZ#582901, RHBZ#582929).Richard Jones2010-04-174-0/+20
| | | | | | | | | | | chmod: Disallow negative mode, document mode affected by umask. mkdir-mode: Disallow negative mode, document that filesystems may interpret the mode in different ways. mknod: Disallow negative mode, document mode affected by umask. umask: Check the range of umask mask value carefully.
* New API: get-umask, returns the current umask (RHBZ#582891).Richard Jones2010-04-171-0/+17
|
* New API: Add aug-clear call for clearing an Augeas node.Richard Jones2010-04-131-0/+20
|
* New API: lvresize-free to extend LVs into percentage of free space.Richard Jones2010-04-121-0/+26
|
* New API: checksum-device for checksumming devices.Richard Jones2010-04-101-12/+24
| | | | Analogous to the usual 'checksum' call.
* New partition APIs: part_del, part_get_bootable, part_get/set_mbr_idRichard Jones2010-04-101-0/+101
| | | | These APIs flesh out further the partitioning API.
* daemon: More reliable parsing of the output from 'parted print'.Richard Jones2010-04-101-19/+33
| | | | | | | | Previously we used strtok. However this has the problem that strtok considers multiple delimiter characters to be like a single delimiter, eg. "1:::2" would be parsed the same as "1:2". In other words, the previous code would skip over or fail if there are empty fields.
* daemon: Make the RUN_PARTED macro take an error statement.Richard Jones2010-04-101-7/+9
| | | | | This allows us to make the RUN_PARTED macro do something else along the error path, other than just returning -1.
* New API: vgscanRichard Jones2010-04-101-0/+18
| | | | | Implement vgscan to allow for a full rescan of all LVM PVs, VGs and LVs.
* New API: ntfsresize.Richard Jones2010-04-101-0/+23
| | | | | This implements the ntfsresize operation, using the external program from ntfsprogs.
* Allow aug-ls to take Augeas variable as argument (RHBZ#580016).Richard Jones2010-04-091-4/+5
|
* New API calls to upload/download txz files (RHBZ#580556).Richard Jones2010-04-081-6/+34
|
* Code cleanups related to RHBZ#580246.Richard Jones2010-04-084-24/+32
| | | | | | | | | | | | | | This includes various code cleanups: (a) A regression test for RHBZ#580246. (b) Use write instead of fwrite to write out the tar file. This is just because the error handling of write seems to be better specified and easier to use. (c) Use size_t instead of int for length. (d) Clearer debug messages when in verbose mode.
* Fix tar-in command hangs when running out of disk space (RHBZ#580246).Richard Jones2010-04-082-3/+6
| | | | | | | | | | | | | | | | | | | | The problem was this sequence of events: (1) File transfer goes through OK. (2) pclose returns failure (because 'tar' subprocess failed) (3) We try to cancel the transfer by calling cancel_receive. Step (3) fails because the transfer (as far as the library is concerned) has succeeded, so causing a hang. The more fundamental reason why we see steps (1) and (2) is that 'tar' does NOT fail immediately if there is a write error. Instead it continues reading and discarding the input until the end of the input before giving "Error exit delayed from previous errors". IMHO this is a bug with tar, since an ENOSPC write error should be fatal for tar.
* Check error returns from posix_fallocate (RHBZ#579664).Richard Jones2010-04-071-4/+4
| | | | | | | | | | | | | | | | | | | | | posix_fallocate has a non-standard way to return error indications. Thus all our calls to posix_fallocate were effectively unchecked. For example: $ guestfish alloc test.img 1P $ echo $? 0 $ ll test.img -rw-rw-r--. 1 rjones rjones 0 2010-04-06 11:02 test.img $ rm test.img With this change, errors are detected and reported properly: $ ./fish/guestfish alloc test.img 1P fallocate: File too large This is a fix for: https://bugzilla.redhat.com/show_bug.cgi?id=579664
* Signed/unsigned warning on 64 bit.Richard Jones2010-04-071-1/+1
|
* New API: guestfs_zero_device to zero whole devices.Richard Jones2010-03-311-0/+37
|
* daemon: Set TERM=dumb inside the daemon.Richard Jones2010-03-301-0/+1
| | | | | | | | | | | | | | | Since commit 977edb3185fe8f we have been passing TERM from the library into the appliance (for the benefit of virt-rescue). However this changes the output of parted, which I would argue is a bug in parted: TERM=xterm /sbin/parted -m -- /dev/sda unit b print 2>&1 | hexdump -C 00000000 1b 5b 3f 31 30 33 34 68 42 59 54 3b 0a 2f 64 65 |.[?1034hBYT;./de| Notice the escape-sequence junk before the official "BYT;" header. By setting TERM=dumb we avoid this.
* Fix the error message when reply body is too large (RHBZ#509597).Richard Jones2010-03-271-1/+1
|
* Const-correctness fix.Jim Meyering2010-03-261-1/+1
|
* appliance: Set $PATH instead of hard-coding paths to binaries everywhere.Richard Jones2010-03-2615-68/+88
| | | | | | Change the appliance so PATH includes common directories. Thus we don't need to hard-code paths to binaries (eg. "/sbin/fdisk") everywhere.
* Fix lvresize test on RHEL 5, by fixing guestfs_e2fsck_l.Richard Jones2010-03-241-2/+9
| | | | | | | | | The problem is that mkfs was making an ext2 filesystem, which later we were checking with e4fsck. e4fsck corrects an "error" on the filesystem: /dev/VG/LV: Adding dirhash hint to filesystem. e4fsck returns 1 (errors corrected) which we were interpreting as an error return.
* Use ext4 dev tools on RHEL 5 (RHBZ#576688).Richard Jones2010-03-241-51/+85
|
* New API: guestfs_copy_size to copy a fixed number of bytes.Richard Jones2010-03-231-0/+81
| | | | | | | This is similar to 'guestfs_dd', but it copies just a fixed number of bytes from the source to the destination. It's an error if the source is too short or if the destination is too small.
* New APIs: Query the relationship between LVM objects.Richard Jones2010-03-181-0/+83
| | | | | | | | | These calls allow you to query the relationship between LVM objects, for example, which PVs contain a VG, or which LVs are contained in a VG. See the example / test program 'regressions/test-lvm-mapping.pl' for an example of how to do this from Perl.
* daemon: Add a trim utility function.Richard Jones2010-03-182-0/+24
| | | | | This function trims the whitespace from around a string. It does this in-place, so it can be called for malloc'd strings.
* Tab to space (whitespace fixes only).Richard Jones2010-03-121-1/+1
|
* Distribute .gitignore files.Richard Jones2010-02-151-1/+2
| | | | | These are useful for Debian since they keep the tarball unpacked in git.
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-1241-113/+116
| | | | | | | | | | | | | | | | | | | | The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
* New API call: initrd-cat to list a file from an initrd.Richard Jones2010-02-091-0/+121
|
* Implement 'vgrename' and 'lvrename' APIs.Richard Jones2010-01-281-0/+44
|
* Add 'filesize' call.Richard Jones2010-01-251-0/+18
| | | | | Returns the size of a file. You can already do this with 'stat', but this call is good for scripting.
* Update to latest Gnulib.Richard Jones2010-01-132-2/+7
|