| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(RHBZ#713678)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)).
|
| |
|
|
|
|
|
|
|
|
| |
The cleanup of package managers cache is already implemented
by sprep_operation_package_manager_cache.ml, so remove this
TODO item.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In languages like Python where we release a global lock around
long-running libguestfs functions, it is also useful to *not* release
this lock for small, non-blocking functions.
Therefore mark all functions with a 'blocking' boolean flag. It
defaults to true, and is true by definition for all daemon functions.
For non-daemon functions, I have classified them manually.
Only when the blocking flag is set do we generate the code to release
and reacquire the lock around libguestfs calls.
|
|
|
|
| |
It's wrong to use it, and in any case it doesn't do anything on Linux.
|
| |
|
|
|
|
| |
This updates commit 9466060201600db47016133d80af22eb38091a49.
|
|
|
|
| |
This fixes commit 9466060201600db47016133d80af22eb38091a49.
|
| |
|
|
|
|
| |
This fixes commit 91b2238fc8e462c02f697f0c053043a55f43c13d.
|
|
|
|
| |
This updates commit d83d17e9dbfb24496a0841fc2aed436181ca0341.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guestfs_parse_environment_list.
Add a new function for creating a handle:
guestfs_h *guestfs_create_flags (unsigned flags [, ...]);
This variant lets you supply flags and extra arguments, although extra
arguments are not used at the moment.
Of particular interest is the ability to separate the creation of the
handle from the parsing of environment variables like
LIBGUESTFS_DEBUG. guestfs_create does both together, which prevents
us from propagating errors from parsing environment variables back to
the caller (guestfs_create has always printed any errors on stderr and
then just ignored them).
If you are interested in these errors, you can now write:
g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT);
if (!g)
exit (EXIT_FAILURE);
r = guestfs_parse_environment (g);
if (!r)
exit (EXIT_FAILURE);
Also you can *omit* the call to guestfs_parse_environment, which
creates a handle unaffected by the environment (which was not possible
before).
This commit also includes new (backwards compatible) changes to the
OCaml, Perl, Python, Ruby and Java constructors that let you use the
flags.
|
| |
|
| |
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
| |
Normally we check if libvirt is installed, and the default is still to
do this.
However having this option makes it simpler to check if a change to
the code has broken the case where libvirt is not installed.
In fact, this change revealed one such place, which is also fixed in
this commit.
|
|
|
|
|
| |
For some reason it was stuck under "CALLS WITH OPTIONAL ARGUMENTS",
which made no sense.
|
|
|
|
|
|
| |
This means that we can use virConnectPtr and virDomainPtr instead of
using void* types. In the case where libvirt support is disabled or
not present, effectively nothing changes.
|
|
|
|
| |
No change, just code motion.
|
| |
|
|
|
|
|
| |
Just make the output of ./configure --help and the <config.h>
file consistent.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
If TMPDIR is not set, we must choose one, because otherwise libvirt
will use a random TMPDIR: http://bugzilla.redhat.com/865464
The convenient guestfs___persistent_tmpdir function does everything
needed in this case.
|
|
|
|
| |
(RHBZ#859875).
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This is just code motion.
|
| |
|
| |
|
|
|
|
|
| |
For more information on this topic, see:
https://www.redhat.com/archives/libguestfs/2012-October/msg00045.html
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit ed7fda161e1f3d0beb02a368fcbcf5ed95dcdac1 changed the
way that the drives are handled across appliance shutdowns.
Previously during the following sequence of calls:
create the handle
add drive(s)
launch
kill subprocess
launch
the added drives are still in the handle at the second launch.
After the above commit, the added drives are removed from the handle,
which means the second launch happens with no drives (which could be
an error).
This was never actually defined either way, so in this case fix the
test to re-add the drive before the second launch.
Since hotplugging was added, it isn't really feasible to return to the
original semantics, since users might remove drives, in which case we
have lost information about those drives so we cannot restore them on
the second launch.
NOTE: PLEASE CALLERS DON'T DO THIS! Always use a new handle for each
launch of the appliance.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This fixes commit 7786d56db8c22413949f98ef6b15fe0ea367d195.
|
| |
|
|
|
|
|
|
|
| |
See:
https://bugzilla.redhat.com/show_bug.cgi?id=863978
and:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/20257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# virt-filesystems -v -d 6326ad4e-5805-2ab4-1338-d1dad8c76162 --all
libguestfs: libvirt version = 10002
libguestfs: [00000ms] connect to libvirt
libguestfs: [00001ms] get libvirt capabilities
libguestfs: [00234ms] build appliance
libguestfs: [00234ms] create libvirt XML
libguestfs: error: error constructing libvirt XML at "xmlTextWriterWriteAttribute (xo, BAD_CAST "file", BAD_CAST appliance)": No such file or directory
libguestfs: closing guestfs handle 0x656270 (state 0)
# ls -lh /usr/lib64/guestfs/*
-rw-r--r-- 1 root root 13M Oct 8 16:15 /usr/lib64/guestfs/initramfs.x86_64.img
-rw-r--r-- 1 root root 3.7M Oct 6 09:25 /usr/lib64/guestfs/vmlinuz.x86_64
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
|
|
|
|
|
|
| |
New API: remove-drive.
Note because of a bug in fuser, this only works with psmisc >= 22.20.
This also updates the hotplugging tests.
|