summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* libguestfs: Added gnulib includes from builddir, as suggested by the Gnulib ↵Hilko Bengen2011-12-021-1/+1
| | | | | | | | | documentation Since some modules (`getopt', for example) may copy files into the build directory, `top_builddir/lib' is needed as well as `top_srcdir/lib'. -- GNU Gnulib manual, section 2.2 Initial import (cherry picked from commit 1a35ca59088e572c11633e85524bb282cb436186)
* part-disk: Change default alignment of this to 64K (128 sectors).Richard W.M. Jones2011-11-241-5/+6
| | | | | | | This is the minimum alignment. 1MB would be better. Note that the exact behaviour is not defined in the API. (cherry picked from commit c4381dba737d5cb8aad8e1b2e2123b0fcaff1d1a)
* daemon: Define safe ADD_ARG macro for constructing arg lists on the stack.Richard W.M. Jones2011-11-225-87/+102
| | | | (cherry picked from commit edd502543adbdc2fa5dda0c015ea7c390bb39f64)
* Update FSF address.Matthew Booth2011-11-0972-72/+72
| | | | (cherry picked from commit 04ea1375c55aa67df4e7fc61dbb534111767f3b6)
* daemon: Use a private copy of /etc/lvm so we don't modify the real config.Richard W.M. Jones2011-11-093-16/+101
| | | | | | | | | | In the libguestfs live case we need to be careful not to modify the real /etc/lvm/lvm.conf file (when setting the filter rule). When the daemon starts, make a complete copy of /etc/lvm in a temporary directory, and adjust LVM_SYSTEM_DIR to point to the copy. All changes are made in the temporary copy. (cherry picked from commit 9c299b64bb24cefafa582fe425bb65b78373d205)
* daemon: Don't use files with fixed names in /tmp (thanks Steve Kemp).Richard W.M. Jones2011-11-092-20/+46
| | | | | | | Although this doesn't matter for the ordinary (appliance) case, it matters for the libguestfs live case. In that case it could cause the guest to be exploited by a tmp/symlink attack. (cherry picked from commit 6011b1f803ba7308c6a94b9bf6b7212cfccb9f42)
* Fix debug help error message.Matthew Booth2011-11-091-1/+1
| | | | | | | | | | | | When given an invalid debug command, libguestfs responds with the error message: libguestfs: error: debug: use 'debug help' to list the supported commands However this command does not work, as debug requires two arguments. This change updates the message to prompt the user to use 'debug help 0'. (cherry picked from commit 4e3a1205ebfec1a5cbc3062d6f73a684090e80b5)
* New APIs: copy-{file,device}-to-{file,device}.Richard W.M. Jones2011-10-262-0/+243
| | | | | | | | | | | The four new APIs: guestfs_copy_device_to_device, guestfs_copy_device_to_file, guestfs_copy_file_to_device, and guestfs_copy_file_to_file let you copy from a source to a destination, between files and devices, optionally allowing source and destination offsets and size to be specified.
* New API: part-to-partnumRichard W.M. Jones2011-10-251-0/+25
| | | | | | This converts a partition device name (eg. /dev/sda1) to a partition number (eg. 1). This is useful in conjunction with the parted APIs that mostly take a disk device + partnum.
* Revert "out-of-tree build: daemon"Richard W.M. Jones2011-10-241-2/+2
| | | | | | | | | | | | | This reverts commit 025dba7f803419f510fd8f085ce693838af82878. If build and source directories are the same, you get this error: make[3]: Leaving directory `/home/rjones/d/libguestfs/generator' make[2]: Circular guestfs_protocol.c <- guestfs_protocol.c dependency dropped. make[2]: Circular guestfs_protocol.h <- guestfs_protocol.h dependency dropped. rm -f guestfs_protocol.h ln guestfs_protocol.h ln: accessing `guestfs_protocol.h': No such file or directory
* out-of-tree build: daemonHilko Bengen2011-10-211-2/+2
|
* mount: No longer implicitly add -o sync,noatime options.Richard W.M. Jones2011-10-011-1/+1
|
* daemon: mkswap --help output changed, breaking linuxfsuuid group detection.Richard W.M. Jones2011-09-291-2/+7
|
* New APIs: compress-out, compress-device-out.Richard W.M. Jones2011-09-282-0/+208
| | | | | | | | | | | | | | | | | These APIs let you copy compressed files or devices out from the disk image. Compression is useful for large images which are mostly zeroes. We cannot currently do sparseness detection, and compression gives us a form of zero detection for free. Example usage: $ guestfish --ro -a /dev/vg_pin/F16x64 -i \ compress-out gzip /etc/passwd /tmp/passwd.gz $ file -z /tmp/passwd.gz /tmp/passwd.gz: ASCII text (gzip compressed data, was "passwd", from Unix, last modified: Sun Aug 28 14:40:46 2011)
* daemon: Move useful is_zero function to header file.Richard W.M. Jones2011-09-282-18/+18
| | | | Code motion.
* Add an optional group ("grub") for the guestfs_grub_install API.Richard W.M. Jones2011-09-151-1/+8
| | | | | | | | This also improves the documentation for this call, pointing out several pitfalls in using it. This unfortunately breaks existing callers that might use guestfs_grub_install without checking for this new group.
* daemon: Factor out name of virtio serial channel.Richard W.M. Jones2011-09-011-3/+5
| | | | This is just code motion.
* protocol: Fix case where download can fail for small files.Richard W.M. Jones2011-08-181-0/+6
| | | | | | | | | | | | | There is another case where downloads of small files could fail if the library side (writer) fails. In this case the library would send back a cancellation, but it would be received after the daemon had finished sending the whole file (because the file is small enough). The daemon would reenter the main loop and immediately get an unexpected cancel message, causing the daemon to die. This commit also makes test-cancellation-download-librarycancels.sh more robust. We use Monte-Carlo testing with a range of file sizes. Small file sizes should trigger the error case.
* Improve zeroing and detection of zeroes.Richard W.M. Jones2011-08-161-20/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code modifies zero, zero-device, is-zero, is-zero-device. zero and zero-device are modified so that if the blocks of the device already contain zeroes, then we don't write zeroes. The reason for this is to avoid unnecessarily making the underlying storage non-sparse or (in the qcow2 case) growing it. is-zero and is-zero-device are modified so that zero detection is faster. This is a nice side effect of making the first change. Since avoiding unnecessary zeroing involves reading the blocks before writing them, whereas before we just blindly wrote, this can be slower. As you can see from the tests below, in the case where the disk is sparse, it actually turns out to be faster, because we avoid allocating the underlying blocks. However in the case where the disk is non-sparse and full of existing data, it is much slower. There might be a case for an API flag to adjust whether or not we perform the zero check. I did not add this flag because it is unlikely that the caller would have enough information to be able to set the flag correctly. (Elapsed time in seconds) Format Test case Before After Raw Sparse 16.4 5.3 Preallocated zero 17.0 18.8 Preallocated random 16.0 41.3 Qcow2 preallocation=off 18.7 5.6 preallocation=metadata 17.4 5.8 The current code uses a fixed block size of 4K for reading and writing. I also tried the same tests with a block size of 64K but it didn't make any significant difference. (Thanks to Federico Simoncelli for suggesting this change)
* daemon: Don't include .gitignore in EXTRA_DIST.Richard W.M. Jones2011-08-071-2/+1
| | | | This updates commit 60d5a50f4d3d9e2c2f5a7d42a6859de709bda3f6.
* daemon: Remove separate configure of daemon subdirectory.Richard W.M. Jones2011-08-055-518/+9
| | | | | | | | | | | | | Combine the two Gnulib instances together. Add checks from old daemon/configure.ac into configure.ac. Fix daemon/Makefile.am so it is like a normal subdirectory Makefile.am. Because we are now using the replacement strerror_r function from Gnulib (instead of the one from glibc directly), this requires a small change to src/guestfs.c.
* Add regression test to catch missing libraries in the appliance.Richard W.M. Jones2011-08-021-0/+71
| | | | Related to RHBZ#727178.
* blkid: Use -c /dev/null option to kill the cache.Richard W.M. Jones2011-07-201-9/+4
| | | | | | On recent Debian, /etc/blkid.tab is now a symlink to /dev/.blkid.tab. Rather than chasing the cache file around (it may move to /run in future) use the -c /dev/null option to stop blkid from reading the cache.
* blkid: Detect when value not found and return empty string.Richard W.M. Jones2011-07-201-4/+15
| | | | | | | | | | | | | | If the blkid command returns 2, that means the value was not found. Note that this changes the output of the vfs-type API when the filesystem has no type (eg when it is empty). Previously this would return an error. Now it returns empty string "". We did not document this either way. Making it return empty string is consistent with vfs-label and vfs-uuid. This change broke list-filesystems, since that code was assuming that vfs-type could only return a filesystem type or an error.
* New API: write-appendRichard W.M. Jones2011-07-141-1/+29
| | | | Append content to the end of a file.
* build: Add ./configure --enable-install-daemonRichard W.M. Jones2011-07-142-0/+15
| | | | | | | | If enabled, then the daemon will be installed in $sbindir (eg. /usr/sbin/guestfsd). The default is off, as now. This option should be used by packagers when building the libguestfs live service.
* New API: btrfs-filesystem-resize (RHBZ#721160).Richard W.M. Jones2011-07-142-0/+85
| | | | This resizes a btrfs filesystem.
* mkfs: Don't die if mke2fs is not available.Richard W.M. Jones2011-07-141-4/+4
| | | | Allow other types of filesystems to be created.
* part-get-bootable: Fix when partitions are missing or unordered (RHBZ#602997).Richard W.M. Jones2011-07-121-4/+30
|
* New API: ntfsresize-opts (RHBZ#685009).Richard W.M. Jones2011-07-121-18/+34
| | | | | | This is a more comprehensive fix for RHBZ#685009. Add a new API which allows the --force flag to be passed, allowing multiple NTFS resize operations in a single session.
* New API: list-dm-devices (RHBZ#688062).Richard W.M. Jones2011-07-121-1/+79
| | | | List device mapper devices.
* list-9p: Avoid double free along error path.Richard W.M. Jones2011-07-121-1/+0
| | | | This updates commit 5f10c3350338bbca735a74db26f98da968957bd9.
* mkfs-opts: Add optional sectorsize parameter.Nikita A Menkovich2011-07-061-3/+20
|
* Implement inode option to mkfs_opts command.Nikita A Menkovich2011-07-041-3/+22
| | | | | | | This is needed because older versions of grub(for example in centos) do not understand filesystems created with newer version of e2fsprogs. By default in e2fsprogs 1.4+ creates partitions with 256 bit inode size, and grub expect 128 bit size.
* New API: mount-9p lets you mount 9p filesystems (RHBZ#714981).Richard W.M. Jones2011-06-221-0/+57
| | | | The updated patch makes 'options' into an optional parameter.
* New API: list-9p lists 9p filesystem mount tags (RHBZ#714981).Richard W.M. Jones2011-06-222-0/+171
|
* build: update to latest gnulibJim Meyering2011-06-102-11/+46
| | | | | * .gnulib: Update submodule to latest. * daemon/m4/gnulib-cache.m4: Regenerate.
* daemon: Keep Coverity happy by ignoring some return values.Richard W.M. Jones2011-06-093-7/+17
|
* Coverity: Don't return freed pointers from command* along error path.Richard W.M. Jones2011-06-091-2/+14
| | | | | | | | | | If the external command failed to run, we could free up the allocated *stdoutput and *stderror pointers, but then return those freed pointers to the caller. The caller usually tries to print and free *stderror, so this is a serious error. Instead, return *stdoutput as NULL, and *stderror pointing to a generic error message.
* Coverity: Missing return on error path.Richard W.M. Jones2011-06-091-0/+1
|
* Coverity: Ensure fp is closed along all error paths.Richard W.M. Jones2011-06-091-4/+6
|
* Coverity: Close directory handle along error paths.Richard W.M. Jones2011-06-091-0/+2
|
* Coverity: Don't leak argv arrays.Richard W.M. Jones2011-06-091-0/+4
|
* Coverity: Don't leak error strings.Richard W.M. Jones2011-06-095-3/+14
|
* Coverity: Check return value of sysroot_path.Richard W.M. Jones2011-06-091-1/+1
| | | | For some reason we were checking the parameter!
* Coverity: Check return value of malloc.Richard W.M. Jones2011-06-091-0/+4
|
* Coverity: Don't close fd_cwd if fd_cwd == -1.Richard W.M. Jones2011-06-091-2/+5
|
* Coverity: Avoid calling sort_strings (NULL, 0) on empty list.Richard W.M. Jones2011-06-091-2/+3
|
* Coverity: Don't call free_strings (NULL).Richard W.M. Jones2011-06-091-1/+0
|
* Coverity: Remove unreachable code.Richard W.M. Jones2011-06-094-12/+0
|