This is essentially just code motion, except:
(1) It cleans up a few variable declarations which were implicitly
used by the old macro that aren't needed any more.
(2) The options are reordered alphabetically.
libxml2 is very commonly available on Linux distros and has also been
ported (and is widely available) on Mac OS X and Windows. Therefore
simply require libxml2, and remove a lot of conditional code.
Add a remote drive by doing:
guestfish -a ssh://example.com/path/to/disk.img
There are several different protocols supported, as explained in the
man page.
This affects all virt-* tools that use the common guestfish options
parsing code.
It's simpler to use the glibc 'program_invocation_short_name(3)'
feature, and fall back to a generic solution. Also remove risky
assignments to argv[0].
In virt-df and virt-alignment-scan, ensure that errors that happen in
worker threads are propagated all the way up and result in
exit(EXIT_FAILURE).
Note that this makes the align/test-virt-alignment-scan-guests.sh test
fail (for a genuine reason). This is fixed in the following commit.
This updates commit 8b90f55dc7.
For example:
$ guestfish --long-options
--add
--cmd-help
--connect
--csh
--domain
--echo-keys
[etc.]
The idea of this is to make it easier to write a bash completion
script that accurately expands --<TAB> options for each command.
The libutils convenience library is a place for code shared between
the main library, language bindings and virt tools. Note that the
code is statically linked into both the library, each binding and each
tool, but this is an improvement because (a) the source is shared and
(b) libguestfs.so can export fewer private functions.
Currently it contains the cleanup functions, and the functions
guestfs___free_string_list function and guestfs___for_each_disk.
guestfs___for_each_disk has changed so that it no longer
unconditionally sets the error in the guestfs handle. Instead callers
can control error handling.
Not to be confused with the libxml2 macro 'BAD_CAST' which converts
from 'signed char *' to 'unsigned char *'.
The 'bad_cast' function was defined and used all over the place as a
replacement for a '(char *)' cast. I think it is better to make these
casts explicit, instead of hiding them in an obscure function.
Certain functions are intended to be internal only, but we currently
export them anyway. This change moves them into a separate section of
guestfs.h protected by a GUESTFS_PRIVATE variable. This change also
enables private structs, but doesn't implement any.
This change only affects the C api. Language bindings aren't affected,
but probably should be in the future.
Rename guestfs_safe_malloc et al to guestfs___safe_malloc etc.
To use the private functions, code now has to define
-DGUESTFS_PRIVATE_FUNCTIONS=1. This will make it easier for us in
future to work out which programs are using these functions and to
minimize both the number of programs and the functions they are
calling.
Note that the Perl, Python, OCaml, Ruby and Java bindings use
guestfs_safe_* calls. None of the other bindings do. This is a bug
(in the bindings using those functions): these functions will call the
out of memory callback on failure. This function defaults to abort(),
and since this happens from a language binding, there is no way to
change this default.
These configure flags enable code profiling (with gprof) and code
coverage (with gcov) respectively.
Although this is a nice idea, it's not currently very useful.
Libtool mangles filenames in such a way that gcov cannot locate its
datafiles.
Profiling is of dubious utility with libguestfs which is not CPU-bound
and relies extensively on running external programs (oprofile-like
system profiling that took into account libguestfs + qemu or
libguestfs + qemu + the appliance + filesystem tools *would* be
useful).
Also neither flag will help in capturing data from the appliance.
'make extra-tests' was a monolithic set of tests that did all sorts of
things: valgrind, tests over local guests, tests with upstream qemu,
tests with upstream libvirt, tests with the appliance attach method.
This made it hard to perform individual tests, eg. just valgrind
testing. It was also hard to maintain because the tests were not
located in the same directories as the programs and sometimes
duplicated tests that were run elsewhere.
This commit splits up 'make extra-tests' into 5 separate targets:
make check-valgrind # run a subset of tests under valgrind
make check-valgrind-local-guests # test under valgrind with local guests
make check-with-appliance # test with attach-method == appliance
make check-with-upstream-qemu # test with an alternate/upstream qemu
make check-with-upstream-libvirt # test with an alternate/upstream libvirt
(You can also still run 'make extra-tests' which is now simply
a rule that runs the above 5 targets in order).
This replaces everything that was in the tests/extra directory,
so that has now gone.
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.
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.
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 output looks like this:
F16x64:/dev/sda1 1048576 1024K ok
F16x64:/dev/sda2 2097152 2048K ok
F16x64:/dev/sda3 526385152 2048K ok
If the --uuid option is used, then UUIDs are shown instead of names.