summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Avoid gcc warning about noreturn function in acl & cap code.Richard W.M. Jones2012-11-302-0/+10
| | | | | acl.c: In function 'do_acl_get_file': acl.c:158:1: error: function might be candidate for attribute 'noreturn' [-Werror=suggest-attribute=noreturn]
* daemon: isoinfo: Fix parsing of bogus dates.Richard W.M. Jones2012-11-291-1/+2
| | | | | | | | | | | | | | | | | eg: $ isoinfo --debug -d -i ubuntu-12.04-desktop-amd64.iso CD-ROM is in ISO 9660 format System id: Volume id: Ubuntu 12.04 LTS amd64 Volume set id: Publisher id: [...] Creation Date: 2012 04 25 16:13:46.00 Modification Date: 2012 04 25 16:13:46.00 Expiration Date: : : . Effective Date: : : . [...]
* daemon: Ignore lvresize error "New size..matches existing size" (RHBZ#834712).Richard W.M. Jones2012-11-231-6/+21
| | | | | The lvresize command unnecessarily gives an error if you don't change the size of the LV. Suppress this error.
* New APIs: Implement Linux filesystem capabilities.Richard W.M. Jones2012-11-222-0/+133
| | | | | | This adds the following new APIs: - cap_get_file - cap_set_file
* New APIs: Implement POSIX ACLs.Richard W.M. Jones2012-11-222-0/+177
| | | | | | | This adds the following new APIs: - acl_get_file - acl_set_file - acl_delete_def_file
* daemon: wipefs: Use --force option if available.Richard W.M. Jones2012-11-201-2/+40
| | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=872831 and https://bugzilla.redhat.com/show_bug.cgi?id=865961
* daemon: Perform device name translation on mke2fs journaldevice (RHBZ#876579).Richard W.M. Jones2012-11-151-4/+18
| | | | | | | Also various fixes: - remove fixed-size buffer - change if (err) free (err) -> free (err).
* New API: mklost_and_foundRichard W.M. Jones2012-11-021-0/+27
|
* daemon: Mark some functions as attribute((noreturn)).Richard W.M. Jones2012-10-251-2/+2
|
* NEW API: mktempWanlong Gao2012-10-173-21/+98
| | | | | | | | | | | | | | | | Used to create temporary directory or file with an optional suffix. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Split this out into a new file (daemon/mktemp.c). - I don't see a reason to deprecate the mkdtemp function which works fine. Instead remove complex dir-making code from the new function. - Test and fix the patch (missing close(fd)).
* daemon: Call udev-settle at the start of the daemon.Richard W.M. Jones2012-10-111-0/+11
|
* Revert "btrfs: Add a workaround for btrfs failures seen with kernel 3.7.0."Richard W.M. Jones2012-10-102-12/+0
| | | | | | | | | | Revert "btrfs: Add an extended workaround for btrfs failures seen with kernel 3.7.0." Reverted these workaround, since we may have found a fix for the btrfs bug itself (for details see RHBZ#863978). This reverts commit d9e5b514aa4ef6d659b267e8caef4ebec8a221b1 and commit a03f536f0dae3ca20e11b7c2ba41e4a7eb1f28c9.
* btrfs: Add an extended workaround for btrfs failures seen with kernel 3.7.0.Richard W.M. Jones2012-10-101-0/+5
| | | | | | | | | | See: https://bugzilla.redhat.com/show_bug.cgi?id=863978 and: http://thread.gmane.org/gmane.comp.file-systems.btrfs/20257 This extends the fix in commit d9e5b514aa4ef6d659b267e8caef4ebec8a221b1 because I missed the case where mkfs.btrfs is called directly.
* btrfs: Add a workaround for btrfs failures seen with kernel 3.7.0.Richard W.M. Jones2012-10-091-0/+7
| | | | | | | See: https://bugzilla.redhat.com/show_bug.cgi?id=863978 and: http://thread.gmane.org/gmane.comp.file-systems.btrfs/20257
* Add support for hotplugging (removing disks).Richard W.M. Jones2012-10-091-4/+97
| | | | | | | | New API: remove-drive. Note because of a bug in fuser, this only works with psmisc >= 22.20. This also updates the hotplugging tests.
* Add support for hotplugging (adding disks) to the libvirt attach-method.Richard W.M. Jones2012-10-082-0/+68
| | | | | | | | | | | | | When libvirt is used, we can allow disks to be hotplugged. guestfs_add_drive can be called after launch to hot-add a disk. When a disk is hot-added, we first ask libvirt to add the disk to the appliance, then we make an internal call into the appliance to get it to wait for the disk to appear (ie. udev_settle ()). Hot-added disks are tracked in the g->drives array. This also adds a test.
* launch: Add add_drive 'label' option.Richard W.M. Jones2012-10-081-0/+76
| | | | | | | | | | | | | | | | | | | | | New API: list-disk-labels Allow the user to pass an optional disk label when adding a drive. This is passed through to qemu / libvirt using the disk serial field, and from there to the appliance which exposes it through udev, creating a special alias of the device /dev/disk/guestfs/<label>. Partitions are named /dev/disk/guestfs/<label><partnum>. virtio-blk and virtio-scsi limit the serial field to 20 bytes. We further limit the name to maximum 20 ASCII characters in [a-zA-Z]. list-devices and list-partitions are not changed: these calls still return raw block device names. However a new call, list-disk-labels, returns a hash table allowing callers to map between disk labels, and block device and partition names. This commit also includes a test.
* daemon: Add guestfsd.pod to EXTRA_DIST.Richard W.M. Jones2012-10-071-1/+3
| | | | This fixes commit df2469a48f4641bdfe26a4179dd946df190fa970.
* docs: Add guestfsd(8) man page.Richard W.M. Jones2012-10-032-0/+120
|
* daemon: When sorting devices, don't fail on mix of /dev/sd and /dev/vdRichard W.M. Jones2012-09-281-0/+8
| | | | | | | | | | | | | | (RHBZ#858128). If compare_device_names was given two devices with devices with different interfaces (eg. /dev/sda and /dev/vda) then it would try to compare the partition numbers, and fail when it could parse them. It's arguable what we should be doing in this case (except for strongly discouraging people from using the interface feature), but let's at least not cause the daemon to assert-fail. Found by Red Hat QA, thanks Mohua Li.
* NEW API:ext:mke2fsWanlong Gao2012-09-241-1/+368
| | | | | | | | | | | New api mke2fs for full configuration of filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Update description. - Run and fix the tests. - Remove bogus filename from po/POTFILES.
* generator: xdr: Re-code procedure table.Richard W.M. Jones2012-09-241-1/+1
| | | | This is just code motion.
* New API: rm-f: remove a file, ignoring errors if it doesn't exist.Richard W.M. Jones2012-09-171-0/+18
|
* Fix multiple errors where jump skips variable initialization.Richard W.M. Jones2012-09-171-3/+7
| | | | | | | <file>: error: jump skips variable initialization [-Werror=jump-misses-init] This has only just appeared, possibly related to previous gnulib update. In any case, this is just code motion / cleanup.
* syntax: Remove definitions of O_CLOEXEC, except in examples (thanks Jim ↵Richard W.M. Jones2012-09-171-4/+0
| | | | | | | Meyering). The gnulib <fcntl.h> replacement header will now define this symbol if it's not defined already.
* syntax: xfs: Rewrite split_strdup function to avoid use of strncpy.Richard W.M. Jones2012-09-151-6/+8
| | | | Found by 'make syntax-check'.
* syntax: Remove gnulib "ignore-value.h" in files that don't use it.Richard W.M. Jones2012-09-151-1/+0
| | | | Found by 'make syntax-check'.
* syntax: Remove include <dirent.h> in files that don't use it.Richard W.M. Jones2012-09-152-2/+0
| | | | Found by 'make syntax-check'.
* syntax: xfs: Remove useless if before free.Richard W.M. Jones2012-09-151-4/+4
| | | | Found by running 'make syntax-check'.
* daemon: provide list of checksum commandsOlaf Hering2012-09-031-7/+14
| | | | | | | While adding the list of external commands I missed the various checksum tools. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* daemon: remove call to obsolete udevsettleOlaf Hering2012-09-031-8/+0
| | | | | | | udevadm is included in all reasonable recent distributions. This avoids 'command not found' errors in verbose mode. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* daemon: collect list of called external commandsOlaf Hering2012-08-3050-202/+350
| | | | | | | | | | | | | | | | | | | | | | | | guestfsd calls many different tools. Keeping track of all of them is error prone. This patch introduces a new helper macro to put the command string into its own ELF section: GUESTFSD_EXT_CMD(C_variable, command_name); This syntax makes it still possible to grep for used command names. The actual usage of the collected list could be like this: objcopy -j .guestfsd_ext_cmds -O binary daemon/guestfsd /dev/stdout | tr '\0' '\n' | sort -u The resulting output will be used to tell mkinitrd which programs to copy into the initrd. Signed-off-by: Olaf Hering <olaf@aepfle.de> RWMJ: - Move str_vgchange at request of author. - Fix snprintf call in daemon/debug.c
* daemon: Remove e2prog hack (only needed for RHEL 5).Richard W.M. Jones2012-08-304-110/+18
| | | | Instead this patch will be carried out of tree in the oldlinux branch.
* NEW API:xfs:xfs_repairWanlong Gao2012-08-301-0/+122
| | | | | | | | | | Add a new api xfs_repair for repairing an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Fix non-error return path so it doesn't send two replies. - Document return code.
* New APIs: hivex_*Richard W.M. Jones2012-08-292-1/+515
| | | | | | | | | | | Transscribe many hivex(3) APIs into the libguestfs API. There is one hive handle per libguestfs handle, as with Augeas. Note that hivex uses iconv_open for some APIs (eg. hivex_value_string). But since we delete all the i18n files from the appliance, this doesn't work -- iconv_open returns EINVAL. Therefore hivex APIs which require iconv cannot be bound in the daemon.
* Modified API: mkswap now takes optional arguments.Richard W.M. Jones2012-08-281-23/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional label and uuid arguments, and deprecate mkswap-L and mkswap-U. This also adds a call to udev_settle after creating the swap device. This is an attempt to workaround the following problem seen in Koji and Rawhide: libguestfs: trace: mkswap_L "swapit" "/dev/sda1" libguestfs: send_to_daemon: 72 bytes: 00 00 00 44 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 83 | 00 00 00 00 | ... guestfsd: main_loop: proc 210 (part_disk) took 2.28 seconds guestfsd: main_loop: new request, len 0x44 mkswap -f -L swapit /dev/sda1 libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 83 | 00 00 00 01 | 00 12 37 cf | ... libguestfs: trace: mkswap_L = 0 libguestfs: trace: swapon_label "swapit" libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 ae | 00 00 00 00 | ... guestfsd: main_loop: proc 131 (mkswap_L) took 0.77 seconds guestfsd: main_loop: new request, len 0x34 swapon -L swapit swapon: cannot find the device for swapit guestfsd: error: swapit: swapon: cannot find the device for swapit libguestfs: recv_from_daemon: 100 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 ae | 00 00 00 01 | 00 12 37 d0 | ... libguestfs: trace: swapon_label = -1 (error) swapon_label: swapit: swapon: cannot find the device for swapit test_swapon_label_0 FAILED
* xfs_growfs: drop the unstructed outputWanlong Gao2012-08-211-7/+6
| | | | | | | Just drop the unstructed output since we can get the structed info from xfs_info instead. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: xfs: xfs_adminWanlong Gao2012-08-211-0/+69
| | | | | | | | | | | Add new api xfs_admin to change parameters of an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Remove printuuid, printlabel, since they don't change any settings. - Adjusted the documentation. - Fix the tests.
* New API: fill-dir: Fill a directory with files (for testing).Richard W.M. Jones2012-08-171-0/+28
|
* guestfs_ls: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-43/+0
|
* New API: ls0 - List files, separated by \0 characters.Richard W.M. Jones2012-08-171-0/+64
| | | | | This API is not especially useful on its own. It will be used to reimplement guestfs_ls to work without protocol limits.
* guestfs_readlinklist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-1/+1
|
* guestfs_lstatlist, guestfs_lxattrlist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-172-3/+3
| | | | | Note that the code to do this was already in virt-ls, so this is change is mostly just moving the code into the core library.
* guestfs_write, guestfs_write_append: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-2/+2
| | | | | | | | Note that we keep the old daemon calls, but rename them as "internal_write" and "internal_write_append". This lets us implement the new library-side calls more efficiently in the common case when the uploaded content is smaller than the message buffer. In most cases the new calls won't end up using a temporary file.
* guestfs_read_lines: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-48/+0
| | | | This also makes a larger test suite for this command.
* guestfs_read_file: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-59/+0
|
* guestfs_find: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-83/+0
| | | | | This also reimplements the virt-ls -R option to use the replacement guestfs_find API, which is simpler (though actually less efficient).
* guestfs_cat: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-69/+0
|
* tar-out: Add list of excluded patterns (--exclude=...) (RHBZ#847881).Richard W.M. Jones2012-08-141-5/+59
|
* daemon: New utility functions 'join_strings', 'concat_strings'.Richard W.M. Jones2012-08-142-0/+48
| | | | Useful functions for concatenating strings together.