| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This is a shorter and more convenient way to disable errors
temporarily across calls.
|
| |
|
|
|
|
|
|
|
| |
<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.
|
|
|
|
|
| |
This enables the libguestfs user network, and is the equivalent of the
'virt-rescue --network' option.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new API splits orderly close into a two-step process:
if (guestfs_shutdown (g) == -1) {
/* handle the error, eg. qemu error */
}
guestfs_close (g);
Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors. Read the documentation for further information.
This change also:
- deprecates guestfs_kill_subprocess
- turns guestfs_kill_subprocess into the same as guestfs_shutdown
- changes guestfish and other tools to call shutdown + close
where necessary (not for read-only tools)
- updates documentation
- updates examples
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(RHBZ#803533).
For a test case, see:
https://bugzilla.redhat.com/show_bug.cgi?id=803533
In guestfish, we use the gnulib closeout module which sets up an
atexit handler to detect if there were any errors on stdout when the
program exits. This is so we can fail correctly in out of disk space
cases like:
guestfish [...] > output
However the atexit handler just checks that there was any error on
stdout (using ferror). If a pipe command such as:
><fs> command_with_lots_of_output | head
ran at any time during the session, the error flag would be set
(because the underlying writes failed with EPIPE errors).
So the commit first adds a test for ferror (stdout) after each command
that we issue. This brings error handling closer to the point of
failure, and so is generally a good thing.
Secondly we reset the error flag after detecting and dealing with the
error, so that avoids the redundant 'guestfish: write error' message
produced by gnulib closeout.
Thirdly we add a --pipe-error flag which causes guestfish commands to
fail on pipe commands line the one above. The default is off for
backwards compatibility reasons.
|
|
|
|
|
|
|
|
|
|
|
|
| |
gettextize provides a local file called "gettext.h". Remove this and
use <libintl.h> from glibc headers instead.
Most of this change is mechanical: #include <libintl.h> in every C
file which uses any gettext function. But also we remove the
gettext.h file, and adjust the "_" macros.
Note that this effectively removes the ./configure --disable-nls
option, although we don't know if that ever worked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The presumption is that all file descriptors should be created with
the close-on-exec flag set. The only exception are file descriptors
that we want passed through to exec'd subprocesses (mainly pipes and
stdin/stdout/stderr).
For open calls, we pass O_CLOEXEC as an extra flag, eg:
fd = open ("foo", O_RDONLY|O_CLOEXEC);
This is a Linux-ism, but using a macro we can easily make it portable.
For sockets, similarly:
sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...);
For accepted sockets, we use the Linux accept4 system call which
allows flags to be supplied, but we use the Gnulib 'accept4' module to
make this portable.
For dup, dup2, we use the Linux dup3 system call, and the Gnulib
modules 'dup3' and 'cloexec'.
|
|
|
|
|
| |
Analyze all uses of 'int' in the code, and replace with 'size_t' where
appropriate.
|
| |
|
|
|
|
|
| |
Return to the main program ('fish.c') and perform global cleanups when
the guestfish remote server exits.
|
|
|
|
|
|
|
| |
If the upload fails, this means we don't leave a partially
written file.
Also add a test for the edit command.
|
|
|
|
| |
Update all copyright dates to 2012.
|
|
|
|
|
|
| |
Ensure that the drv structure is always zeroed on allocation.
Don't leak old drv->device when add_drives is called multiple times.
|
|
|
|
|
|
| |
Handle SIGQUIT by guestfish, so that it can't be terminated.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
|
|
|
|
| |
Add 'event', 'list-events' and 'delete-event' commands so that event
handlers can be registered, listed and deleted in guestfish. The
event handler is a shell script snippet or host command.
Cc: Pádraig Brady <P@draigBrady.com>
|
| |
|
|
|
|
|
|
| |
NOTE this is just a cleanup. It is NOT necessary for correctness,
since libguestfs itself is correctly closing the handle in the exit
handler.
|
|
|
|
| |
This library could now be called from other virt tools.
|
| |
|
|
|
|
| |
pclose can return > 0 when the status of the command was non-zero.
|
|
|
|
|
| |
eg:
*stdin*:37: libguestfs: error: luks_close: Device lukstest is busy.
|
| |
|
|
|
|
|
| |
Decide early (before launch) if this is going to be an interactive
session, and set the is_interactive flag.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the hack that let you run ./fish/guestfish or
./fuse/guestmount. You now have to do:
./run ./fish/guestfish
or
./run ./fuse/guestmount
to run these programs without installing.
|
|
|
|
|
|
| |
This allows you to mount disks on (eg) /c and /e and have the
guestfish win:... path mechanism map drive letters to the
right places.
|
| |
|
|
|
|
|
| |
This allows the default for --ro or --rw to be controlled for the
three tools guestfish, guestmount and virt-rescue.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets you turn on ACLs and xattrs by doing:
-m /dev/sda1:/:acl,user_xattr
The extra parameter is passed through to mount_options:
libguestfs: trace: mount_options "acl,user_xattr" "/dev/sda1" "/"
Notes:
Labels: feature
|
|
|
|
|
| |
Notes:
Labels: cleanup
Depends: c8faa5d0b0a17689d27bd33bc787ba0fe9a3f076
|
|
|
|
| |
Notes:
Labels: bugfix
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API allows more than one callback to be registered for each
event, makes it possible to call the API from other languages, and
allows [nearly all] log, debug and trace messages to be rerouted from
stderr.
An older version of this API was discussed on the mailing list here:
https://www.redhat.com/archives/libguestfs/2010-December/msg00081.html
https://www.redhat.com/archives/libguestfs/2011-January/msg00012.html
This also updates guestfish to use the new API for its progress bars.
|
|
|
|
|
|
| |
The other programs have the variable, but the flag is not enabled
either because it doesn't make sense or because the implications are
not well understood.
|
|
|
|
|
|
|
|
|
|
| |
This optional flag controls whether this API call will try to connect
to a running virtual machine 'guestfsd' process.
If the flag is given and the virtual machine is running, then the
libvirt XML is parsed looking for a suitable <channel> element, and
'guestfs_set_attach_method' is called with the corresponding
virtio-serial socket path.
|
|
|
|
|
|
|
| |
On Debian we get this warning which I'm pretty sure is bogus:
fish.c:690: error: 'pcmd.cmd' may be used uninitialized in this
function [-Wuninitialized]
|
|
|
|
|
|
|
|
| |
The new guestfish construct "<! cmd" executes the shell command
"cmd", and then anything printed to stdout by "cmd" is parsed
and executed as a guestfish command.
This allows some very hairy shell scripting with guestfish.
|
|
|
|
| |
Factor out the code which splits a string into a command line.
|
|
|
|
|
|
| |
Note that 'time' and 'glob' (which both run subcommands) do not
correctly pass the exit_on_error flag in the remote case. This is not
a regression: the current code doesn't work either.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This removes the dependency from guestfish to the external
pod2text program (and hence the final dependency on perl for
guestfish). This is done by storing the formatted pod2text
output in guestfish as the help text.
|
|
|
|
|
|
|
| |
In the 'struct drv *drvs' structure, keep a list of the
device name(s) for each added drive or guest. The device name
is the canonical name as that drive would be known inside
libguestfs, eg. "/dev/sda"
|
|
|
|
|
|
|
|
|
|
| |
This adds the guestfish --rw option, intended in future
to be required for writing to disk images.
At the moment this does not change the default and so does
nothing. This patch is intended for backporting to the
stable branches so that we can start to introduce scripts
which use 'guestfish --rw'.
|
|
|
|
| |
(Thanks Eric Blake).
|
|
|
|
|
|
|
|
|
|
|
| |
This feature is also available in guestmount because of the
shared option parsing code.
You don't need to do anything to enable it, just using -i
will attempt decryption of encrypted partitions.
Only works for simple Fedora whole-disk encryption. It's a
work-in-progress to make it work for other types of encryption.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In guestfish, factor out the processing of the options -a, -c,
-d, -i, -m, -n, -r, -v, -V, -x into a separate set of files:
options.c, options.h, inspect.c, virt.c.
Change guestmount so that it uses these same files (from the
../fish directory) to process the same options.
This unifies the handling of these options between the two programs.
It also adds the useful inspection feature to guestmount, so you
can now do:
guestmount -d Guest -i --ro mnt/
|