summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* blkid: split the RHEL5 which can't support some optionsWanlong Gao2011-12-051-7/+73
| | | | | | | RHEL5 shoult not support '-p', '-i' and '-o export' options. But we just split it according to the '-p' option. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Revert "blkid: Use -c /dev/null because RHEL 5 blkid doesn't have -p option."Richard W.M. Jones2011-12-041-5/+2
| | | | This reverts commit 6533491b178d18bfab8240cf093be4ef9b547548.
* Revert "blkid: Fix mistake in previous commit."Richard W.M. Jones2011-12-041-1/+1
| | | | This reverts commit c48226a5026816b115ab63b50d3601531aff59dc.
* blkid: Fix mistake in previous commit.Richard W.M. Jones2011-12-031-1/+1
| | | | This updates commit 6533491b178d18bfab8240cf093be4ef9b547548.
* blkid: Use -c /dev/null because RHEL 5 blkid doesn't have -p option.Richard W.M. Jones2011-12-031-2/+5
|
* daemon: Use pkg-config to locate Augeas CFLAGS / libraries.Richard W.M. Jones2011-12-031-2/+2
| | | | | | | | | | | | | | | | | | Augeas 0.10 depends on libxml2, so this is now required in the appliance (in fact, it was already present). However this exposed two bugs: (1) In libguestfs we use a home-brewed recipe for Augeas flags, resulting in this error: /usr/include/augeas.h:24:25: fatal error: libxml/tree.h: No such file or directory (2) Augeas's own augeas.pc didn't include the libxml2 flags, so it was broken. This requires a patch to Augeas 0.10, see: https://www.redhat.com/archives/augeas-devel/2011-December/msg00008.html Change to using pkg-config to detect Augeas. It is still an optional library.
* NEW API: add blkid command to print the attributes of the deviceWanlong Gao2011-12-031-0/+75
| | | | | | | | | | | | A NEW API blkid. It can print the device attributes. Use it after list-devices, we can list ower devices and the attributes of each device. Use it like: blkid <device> It's should be a usefull function. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* mkfs: enable to make xfs filesystems when the device already has a filesystemWanlong Gao2011-12-021-0/+3
| | | | | | | | Just add the -f option to mkfs.xfs to make sure we can make a xfs filesystem when the device already has a filesystem on it. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* libguestfs: Added gnulib includes from builddir, as suggested by the Gnulib ↵Hilko Bengen2011-12-011-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
* debian: Use mdadm -D --export instead of mdadm -DY.Richard W.M. Jones2011-11-241-2/+2
| | | | For compatibility with mdadm on Debian Squeeze.
* 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.
* New API: md-stop for stopping MD devicesWanlong Gao2011-11-241-0/+16
| | | | | | | | This API is used to stop a md device. When we want to move a device to another md array, we should stop the md device which contained this device first. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Rename mdadm_ apis to md_Matthew Booth2011-11-241-12/+12
| | | | | | | | | This change renames the following 2 apis: * mdadm_create -> md_create * mdadm_detail -> md_detail This is more consistent with list_md_devices, and removes a reference to an implementation detail from the api.
* New API: mdadm-detail.Matthew Booth2011-11-171-0/+80
|
* New API: list-md-devices.Matthew Booth2011-11-113-7/+80
| | | | | | | Return a list of Linux MD devices detected in the guest. This API complements list_devices, list_partitions, list_lvs and list_dm_devices.
* New API: mdadm-create for creating MD devices.Richard W.M. Jones2011-11-112-0/+171
|
* New API: Bind the tune2fs command.Richard W.M. Jones2011-11-111-0/+149
| | | | | | | | | | | | | Previously we bound the 'tune2fs -l' command so that we could list out the tunables of an ext2/3/4 filesystem. Also commands like set_e2label and set_e2uuid used tune2fs. This commit binds many of the tunables that can be set using tune2fs. The coverage is not complete, but we can add more later because this uses optional parameters so the call is extensible without breaking ABI. The current change gives us enough for using libguestfs within OpenStack.
* daemon: Define safe ADD_ARG macro for constructing arg lists on the stack.Richard W.M. Jones2011-11-115-87/+102
|
* Update FSF address.Matthew Booth2011-11-0872-72/+72
|
* daemon: Use a private copy of /etc/lvm so we don't modify the real config.Richard W.M. Jones2011-11-043-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.
* daemon: Don't use files with fixed names in /tmp (thanks Steve Kemp).Richard W.M. Jones2011-11-042-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.
* Fix debug help error message.Matthew Booth2011-10-311-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'.
* 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.