| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
| |
This commit tidies up the code for the 'glob' command. It also makes
the command return an error if malloc fails (previously it would just
print a message but not return any error indication).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
| |
Not used at present.
|
|
|
|
|
|
|
| |
Fix typos spotted by http://github.com/lyda/misspell-check.
* configure.ac: As above.
* ocaml/examples/guestfs-ocaml.pod: Likewise.
* fish/guestfish.pod: Likewise.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
| |
When these tests were originally in the old regressions/ directory,
they used to refer to guestfish via the path '../fish/guestfish'.
Some of the tests were also called 'test-guestfish-*'.
Now that the tests have been moved into the fish/ directory, neither
of these things make sense. So change the relative path to
'./guestfish' and rename all 'test-guestfish-*' as 'test-*'.
|
| |
|
|
|
|
| |
files (RHBZ#788641).
|
|
|
|
|
|
|
| |
If the upload fails, this means we don't leave a partially
written file.
Also add a test for the edit command.
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
| |
binary.
The error messages would be prefixed by the path to the
alternate binary, eg:
../fish/guestfish: invalid escape sequence in string (starting at offset 0)
Fix this by normalizing the messages further.
|
| |
|
| |
|
|
|
|
| |
(Includes fix by RWMJ)
|
| |
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
|
| |
Various messages were added and changed when this variable was set
while tests were running.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
In particular this stops a problem with guestmount where if the -i
option half-recognizes the guest OS, it would mount the disk (and
fail, giving only warnings), leaving the mountpoint unusable.
(Thanks Pádraig Brady)
|
| |
|
|
|
|
| |
inspection (RHBZ#760775).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The error message now looks like this:
guestfish: '/dev/vda6' could not be mounted. Did you mean one of these?
/dev/sda1 (ext4)
/dev/vg_f15x32/lv_root (ext4)
/dev/vg_f15x32/lv_swap (swap)
Note that '/dev/sda1' has been canonicalized.
|
|
|
|
| |
This also frees the list returned by guestfs_list_filesystems.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Tools like virt-edit would not be able to edit disks marked as
<readonly/> in the libvirt XML. It's not clear if this is a bug or a
feature.
|
| |
|
|
|
|
| |
This isn't really necessary, but it keeps valgrind happy.
|
|
|
|
|
|
|
| |
Killing it is always a bad idea, because the qemu subprocess will be
left hanging around. The best thing is to send the exit command.
This also makes the change to virt-sysprep.
|
|
|
|
|
|
| |
NOTE this is just a cleanup. It is NOT necessary for correctness,
since libguestfs itself is correctly closing the handle in the exit
handler.
|
| |
|
| |
|
| |
|