| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a wrapper or mini-library for running external command,
loosely based on libvirt's virCommand interface.
Amongst the advantages are:
- Can redirect errors into the error log (RHBZ#713678).
- Can redirect output into a callback function.
- Handles shell quoting properly.
- Safely resets signal handlers, closes file descriptors, etc.
- Single place where we can implement other improvements in future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)).
|
|
|
|
| |
Also run 'make update-po'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit models libvirt authentication events through the API,
adding one new event (GUESTFS_EVENT_LIBVIRT_AUTH) and several new
APIs:
guestfs_set_libvirt_supported_credentials
guestfs_get_libvirt_requested_credentials
guestfs_get_libvirt_requested_credential_prompt
guestfs_get_libvirt_requested_credential_challenge
guestfs_get_libvirt_requested_credential_defresult
guestfs_set_libvirt_requested_credential
See the documentation and example which shows how to use the new API.
This commit also changes existing calls to virConnectOpen* within the
library so that the new API is used.
Also included is an example (but not a test, because it's hard to see
how to automatically test the libvirt API).
|
|
|
|
| |
No change, just code motion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The code was identical -- just copied with s/resize/sparsify/.
Instead of duplicating identical code, cause the Makefile.am to use
the code from the ../resize/ directory.
Unfortunately because there are two Utils modules (which are
different), this means we had to rename those modules to Resize_utils
and Sparsify_utils respectively. So this is a rather larger change
than intended. However it's just code motion.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This command was not tested at all. As a result we didn't notice that
it was broken for a long time (RHBZ#853159).
This adds a test that drives the command through a pty. It uses the
perl 'Expect' module, although this is not required.
|
| |
|
|
|
|
| |
Detect the disk image format of a file, in a secure way.
|
|
|
|
|
|
| |
Remove hostname from network interface configuration.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
| |
This just generates the code; it's not called.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This allows you to add scripts that run in the context of
the guest the first time it boots.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The compress flag can be used to control compression, one of: (none),
"compress", "gzip", "bzip2", "xz", "lzop". Thus these calls can now
be used instead of tgz-in/tgz-out/txz-in/txz-out, and also support
more compression types.
Mark these APIs as once_had_no_optargs so that compatibility code is
generated.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We just remove the process accounting files previously without
touch a empty file, this will cause psacct runs error.
Restart the service can't help us create this file auto.
couldn't open file '/var/account/pacct': No such file or directory
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
| |
Implement rsync.
|
| |
|
|
|
|
|
|
|
|
| |
This commit makes grep into an optargs API, with flags for extended,
fixed, [case-]insensitive and compressed.
At the same time it deprecates: egrep, fgrep, grepi, egrepi, fgrepi,
zgrep, zegrep, zfgrep, zgrepi, zegrepi and zfgrepi.
|
|
|
|
|
|
| |
New api xfs_growfs for expanding a XFS filesystem.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Typical output:
><fs> utsname
uts_sysname: Linux
uts_release: 3.5.0-1.fc18.x86_64
uts_version: #1 SMP Mon Jul 23 17:43:39 UTC 2012
uts_machine: x86_64
|
| |
|
| |
|