summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* New API: set-label, for setting a label on any filesystem.Richard W.M. Jones2012-02-274-25/+105
| | | | | | Currently only ext2/3/4 and (newly) NTFS are supported. This change also deprecates set-e2label.
* New APIs: ntfsclone-in, ntfsclone-out.Richard W.M. Jones2012-02-272-0/+213
|
* New API: ntfsfix for fixing problems on NTFS.Richard W.M. Jones2012-02-271-0/+29
| | | | Note this is not a "chkdsk" equivalent tool.
* daemon: Return error properly when user tries to mount appliance root ↵Richard W.M. Jones2012-02-131-1/+4
| | | | | | | | | | | | (RHBZ#789960). In the case where the caller attempts to mount the "hidden" appliance root device (eg. /dev/vdb if /dev/vda is the only normal block device added), we were calling reply_with_error but not actually returning immediately, resulting in protocol desynchronization. This commit fixes this obvious mistake.
* wipefs: Include "optgroups.h".Richard W.M. Jones2012-02-101-0/+1
| | | | This fixes commit a2b3e0900ee14e5a49d526c24e22edefc3030f99.
* NEW API: add a new api wipefsWanlong Gao2012-02-101-0/+24
| | | | | | | Add the new api wipefs to erase the filesystem signatures on a device but now erase any data. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: llz: This runs ls -laZ and is useful for showing SELinux contexts.Richard W.M. Jones2012-02-091-0/+26
|
* findfs: Remove /run/blkid/blkid.tab.Richard W.M. Jones2012-02-081-0/+1
| | | | | See this util-linux commit: https://github.com/karelzak/util-linux/commit/b82590ad46acf9fe8d332b53875e24c3c31e2482
* blockdev, parted: Call udev_settle before and after commands. (RHBZ#769304)Richard W.M. Jones2012-02-062-52/+115
| | | | | | | See comments in the code for details. This is an alternate fix to commit a9c8123c72db47bcab8dd738e8d5256a9ae87f11.
* Revert "daemon: Run udev_settle after pwrite-device finishes."Richard W.M. Jones2012-02-062-17/+4
| | | | This reverts commit a9c8123c72db47bcab8dd738e8d5256a9ae87f11.
* Clarify the error message when unavailable functions are called (RHBZ#679737).Richard W.M. Jones2012-02-017-134/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callers are supposed to use the availability API to check for functions that may not be available in particular builds of libguestfs. If they don't do this, currently they tend to get obscure error messages, eg: libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory This commit changes the error message to explain what callers ought to be doing instead: libguestfs: error: zerofree: feature 'zerofree' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. This patch makes the stubs check for availability. The stub code changes to: static void zerofree_stub (XDR *xdr_in) { [...] /* The caller should have checked before calling this. */ if (! optgroup_zerofree_available ()) { reply_with_error ("feature '%s' is not available in this\n" "build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\n" "how to check for the availability of features.", "zerofree"); goto done; } [...]
* daemon: Fix crash in aug-defnode (RHBZ#785668).Richard W.M. Jones2012-01-301-6/+15
|
* daemon: Fix use-after-free in case-insensitive-path (found by valgrind).Richard W.M. Jones2012-01-241-38/+81
| | | | | | | | | This commit tidies up the code by splitting out the path element-searching code into a separate function. Valgrind found that 'closedir' frees the 'struct dirent *', which wasn't immediately obvious. So now we do the 'closedir' after all operations which touch 'd->d_name'.
* daemon: Fix leaking error message (found by valgrind).Richard W.M. Jones2012-01-241-0/+1
|
* daemon: Close inotify handle on exit.Richard W.M. Jones2012-01-241-0/+11
|
* daemon: Close augeas handle on exit.Richard W.M. Jones2012-01-241-0/+11
|
* daemon: Fix leak of strings in md-detail (found by valgrind).Richard W.M. Jones2012-01-241-2/+2
|
* daemon: md: Whitespace changes, and use size_t for i instead of pointer.Richard W.M. Jones2012-01-241-20/+23
| | | | This is just a code clean-up with no functional change.
* daemon: Fix leak of strings in blkid (found by valgrind).Richard W.M. Jones2012-01-241-2/+2
|
* daemon: blkid: Whitespace changes, and use size_t for i instead of pointer.Richard W.M. Jones2012-01-241-18/+21
| | | | This is just a code clean-up with no functional change.
* daemon: Return value from write syscall is ssize_t, not int.Richard W.M. Jones2012-01-241-1/+1
|
* daemon: Don't leak 'cmdline' (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
|
* daemon: Length of message is a 32 bit unsigned quantity.Richard W.M. Jones2012-01-241-2/+2
|
* daemon: Fix use of uninitialized stack data (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
| | | | | This uninitialized data was also sent over the protocol, potentially being a serious information leak.
* daemon: Fix memory leak in 'initrd-cat' (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
|
* debian: Debian 6 blkid has -p but not -i.Richard W.M. Jones2012-01-231-30/+62
| | | | | | Fix the existing test to work correctly in this case. Other cleanups.
* daemon: Move internal-autosync function to new file internal.c.Richard W.M. Jones2012-01-213-18/+47
| | | | This is just code motion.
* daemon: Run udev_settle after pwrite-device finishes.Richard W.M. Jones2012-01-192-4/+17
| | | | | | | When you call close on any block device, udev kicks off a rule which runs blkid to reexamine the device. We need to wait for this rule to finish running since it holds the device open and can cause other operations to fail, notably BLKRRPART.
* daemon: pwrite/pread: Don't double close on error path.Richard W.M. Jones2012-01-191-2/+0
| | | | | In Linux, close (fd) closes the file descriptor even if it returns an error.
* Tempus fugit.Richard W.M. Jones2012-01-1820-20/+20
| | | | Update all copyright dates to 2012.
* resize2fs-M: fix double-free along error path (thanks Matthew Booth).Richard W.M. Jones2012-01-161-4/+2
|
* e2fsck-f: change the internal to use e2fsckWanlong Gao2012-01-131-21/+7
| | | | | | | | Since we implement the new api e2fsck, just change the internal of e2fsck_f to use e2fsck now. v1->v2: use optargs_bitmask Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* NEW API: add a new api e2fsckWanlong Gao2012-01-131-0/+49
| | | | | | | | | | | | | | m: Wanlong Gao <gaowanlong@cn.fujitsu.com> Add a new api e2fsck with two options: correct: same as '-p' option of e2fsck forceall: same as '-y' option of e2fsck Thanks for Rich's idea. v1->v2: use optargs_bitmask v2->v3: change the optargs_bitmask check Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* ext2: tweak the error returned message of resize2fs-M(BZ755729)Wanlong Gao2012-01-131-2/+7
| | | | | | | Tweak the error message "e2fsck -f" and "e2fsck -fy". Indicate the user to use the correct and/or forceall options. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* daemon: debug segv correct use of dereferencing NULL.Richard W.M. Jones2012-01-091-1/+7
|
* mkfs: optimization and code cleanupWanlong Gao2011-12-231-15/+14
| | | | | | | | | | | v1->v2: fix a typo pointed by Matt Optimizations by reducing the STREQ operations and do some code cleanup. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: Whitespace changes.
* tests: Split regressions -> various subdirectories of tests/Richard W.M. Jones2011-12-221-2/+6
|
* daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).Richard W.M. Jones2011-12-081-18/+5
| | | | | | | | | | This also adds comprehensive tests for utimens on regular files, directories (RHBZ#761451), named pipes (RHBZ#761460), symbolic links, block and char devices. Note that there is a small change in the (previously undefined) semantics of this call: It now sets the time on a symbolic link itself, not on what the symbolic link points to.
* daemon: Allow utimens to work for directories (RHBZ#761451).Richard W.M. Jones2011-12-081-1/+1
| | | | | | You don't need to open the file O_WRONLY in order to call futimens on the file descriptor. Opening it O_WRONLY fails for directories. Therefore open O_RDONLY instead.
* 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.