Commit Graph

21 Commits

Author SHA1 Message Date
Richard W.M. Jones
5a2e320ec9 configure: Add --enable-code-profiling and --enable-code-coverage flags.
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.
2012-12-04 14:11:14 +00:00
Richard W.M. Jones
3636c5fcff tests: Replace 'make extra-tests' with individual tests.
'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.
2012-11-13 15:26:29 +00:00
Richard W.M. Jones
2d220f5da2 tools: Modify existing tools to use guestfs_{push,pop}_error_handler.
This is a shorter and more convenient way to disable errors
temporarily across calls.
2012-11-09 19:51:09 +00:00
Richard W.M. Jones
101fd44fc5 format: Allow virt-format test to be skipped by setting SKIP_TEST_VIRT_FORMAT_SH=1. 2012-11-06 13:05:49 +00:00
Richard W.M. Jones
9fce75aa13 syntax: Remove gnulib c-ctype.h in files that don't use it.
Found by 'make syntax-check'.
2012-09-15 12:34:41 +01:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
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.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
f1d98bbc79 man pages: Ensure consistent copyright/author sections, remove license
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.
2012-08-21 20:16:29 +01:00
Richard W.M. Jones
6054051a9d fish: Rename fish/virt.c to fish/domain.c
This file handles the -d option for guestfish and other C command line
utilities.  Renaming this file makes it less confusing.
2012-07-19 16:11:26 +01:00
Richard W.M. Jones
f2ea617e22 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.
2012-07-16 18:56:57 +01:00
Richard W.M. Jones
ffbf1475f7 New API: guestfs_shutdown: Cleanly shutdown the backend.
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
2012-07-03 21:27:29 +01:00
Richard W.M. Jones
927ef14c58 run: Set MALLOC_PERTURB_ to a random value.
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
2012-06-28 13:19:39 +01:00
Richard W.M. Jones
05d4e07918 tests: Add ./run --test option.
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.
2012-06-26 23:34:30 +01:00
Richard W.M. Jones
6cb74d46ba virt-format: Don't call wipefs unless API is available.
This API is optional.  Don't call it unless it's available
in the appliance.
2012-06-22 10:57:55 +01:00
Richard W.M. Jones
b05611d8ef Use the new lvcreate-free API to create largest possible LVs. 2012-03-15 16:15:45 +00:00
Richard W.M. Jones
d66dd2260c Fix strict-overflow bugs and reenable this warning.
In two places, we were counting things in an array using an 'int'.  In
theory, the int could overflow, so gcc determines this to be undefined
behaviour.

The fix is to use size_t or ssize_t instead.
2012-03-12 16:27:10 +00:00
Richard W.M. Jones
e9e0920c00 format: Remove unused variables. 2012-03-12 11:53:04 +00:00
Richard W.M. Jones
4504f424f5 dist: Distribute all tests, even when configured with --disable-appliance. 2012-03-07 19:21:14 +00:00
Hilko Bengen
c8a11468c4 Do not run test-virt-format.sh if appliance has not been built 2012-02-12 12:35:26 +01:00
Richard W.M. Jones
badf2d6c4d virt-format: Add a test. 2012-02-10 14:01:38 +00:00
Wanlong Gao
088546af9d virt-format: erase the filesystem signatures before erase partitions
erase the filesystem signatures on each device, then erase
the partitions, avoid to list all the partitions here.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-02-10 09:34:17 +00:00
Richard W.M. Jones
6de1a1242e New tool: virt-format: erase and make blank disks.
This tool allows you to easily reformat a disk, creating a blank disk
with optional partition, LVM and empty filesystem.
2012-01-18 16:28:31 +00:00