| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(RHBZ#859875).
|
| |
|
|
|
|
| |
This is 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.
|
|
|
|
|
| |
It is slightly dangerous to use @PATTERNS@, since these might
be substituted by autoconf when they appear in Makefile.am files.
|
|
|
|
|
|
|
| |
<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.
|
|
|
|
|
|
|
| |
Meyering).
The gnulib <fcntl.h> replacement header will now define this symbol if
it's not defined already.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux PATH_MAX is 4096, but on some platforms it can be much larger
or even not defined (ie. unlimited). Therefore using a PATH_MAX-sized
stack buffer is not a great idea for portable programs.
This change removes use of PATH_MAX-sized stack-allocated buffers.
This change only applies to the library and standalone programs.
Inside the daemon, memory allocation is much more complicated so I
have not changed those (yet).
Found by 'make syntax-check'.
|
|
|
|
| |
Found by 'make syntax-check'.
|
|
|
|
| |
Found by 'make syntax-check'.
|
|
|
|
|
|
|
|
|
|
| |
This adds standard LICENSE and BUGS sections to all of the man pages
that are processed by podwrapper.
Modify all the calls to $(PODWRAPPER) to add the right --license
parameter according to the content. Note that this relaxes the
license on some code example pages, making them effectively BSD-style
licensed.
|
|
|
|
|
|
|
|
|
|
| |
section.
Ensure each man page contains consistent COPYRIGHT and AUTHOR
sections.
Remove the LICENSE section. We will add that back in podwrapper in a
later commit.
|
|
|
|
|
|
| |
Since our minimum supported version is now 1.16 and mount was fixed in
1.13.16, it is now safe to replace mount-options + empty options with
mount wherever it occurs.
|
|
|
|
|
| |
This enables the libguestfs user network, and is the equivalent of the
'virt-rescue --network' option.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
RWMJ:
Fixed whitespace in generator_xdr.ml
|
|
|
|
| |
It should work with any attach-method.
|
|
|
|
|
|
|
|
|
|
| |
You can now choose the default attach method in two ways:
(1) Set the LIBGUESTFS_ATTACH_METHOD environment variable.
(2) ./configure --with-default-attach-method=appliance|libvirt|...
Note that (1) overrides (2).
|
|
|
|
|
|
|
| |
This is just code motion.
Some files cannot be renamed. Notably rpcgen input and output files
must not contain dash characters, else rpcgen breaks.
|
|
|
|
|
| |
This file handles the -d option for guestfish and other C command line
utilities. Renaming this file makes it less confusing.
|
| |
|
|
|
|
|
| |
This will allow us to easily change the location of this
script in future.
|
|
|
|
|
|
| |
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MALLOC_PERTURB_ is a glibc feature which causes malloc to wipe memory
before and after it is used, allowing both use-after-free and
uninitialized reads to be detected with relatively little performance
penalty:
http://udrepper.livejournal.com/11429.html?nojs=1
Modify the ./run script so that it always sets this.
We were already using MALLOC_PERTURB_ in most tests. Since ./run is
now setting this, we can remove it from individual Makefiles. Most
TESTS_ENVIRONMENT will now simply look like this:
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
|
|
|
|
|
|
| |
This option, when added via
TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test
allows us to run the tests and only print the full output (including
debugging etc) when the test fails.
|
|
|
|
| |
The test uses FUSE, so we need a way to disable it on RHEL 5.
|
|
|
|
|
|
|
|
|
| |
Old KVM can't add /dev/null readonly. Treat /dev/null as a special
case.
We also fix a few tests where /dev/null was being used with
format=qcow2. This was always incorrect behaviour, but qemu appears
to tolerate it.
|
|
|
|
|
|
|
|
|
|
| |
RHEL 5 didn't have the truncate command, but we can replace:
truncate -s SIZE FILE
with the roughly equivalent command:
guestfish sparse FILE SIZE
|
|
|
|
| |
This API makes device names canonical, eg. /dev/vda1 -> /dev/sda1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test used the external 'od' command to compare the output of
guestfish with what it's supposed to be. Unfortunately by default
this outputs groups of 2-byte words, with the words' endianness
affected by the current hardware endianness. For example:
x86-64$ echo -n ab | od
0000000 061141
0000002
ppc64$ echo -n ab | od
0000000 060542
0000002
By using 'od -b' instead we can output bytes instead of words, and
there is no endianness issue, and the output is clearer:
x86-64$ echo -n ab | od -b
0000000 141 142
0000002
ppc64$ echo -n ab | od -b
0000000 141 142
0000002
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example:
><fs> glob echo /dev/*
/dev/vda
/dev/vda1
/dev/vda2
/dev/vda3
><fs> glob echo /dev/v*/*
/dev/vg_f16x64/lv_root
/dev/vg_f16x64/lv_swap
|
|
|
|
| |
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.
|