Commit Graph

6471 Commits

Author SHA1 Message Date
Pino Toscano
7fb823e427 php: make the test suite failures fatal
So far the failure of some test would have not reported a non-zero
return value by run-tests.php. Since now all the PHP tests pass, we can
ask for failures to be fatal, by exporting REPORT_EXIT_STATUS=1 for
run-tests.php.
2014-03-18 14:38:02 +01:00
Richard W.M. Jones
d521f7c2e3 build: Disable a couple more ineffective warnings. 2014-03-17 21:05:18 +00:00
Richard W.M. Jones
19dcc0de1f Annual scavange to find mixed declarations and statements.
Hopefully this is just code motion.
2014-03-17 19:54:16 +00:00
Richard W.M. Jones
6035c764e6 build: Remove -Wno-declaration-after-statement.
We have generally forbidden declaration-after-statement in our code
(although there are plenty of places that do it).  In any case this
warning is not in the default set, so we don't need to turn off the
warning.
2014-03-17 19:50:37 +00:00
Richard W.M. Jones
931aec5b88 virt-sparsify --in-place: Exit with code 3 if discard is not supported.
Also skip the test in this case instead of failing.
2014-03-17 12:36:43 +00:00
Richard W.M. Jones
5e1fc4640d mllib: Allow exit code to be specified when calling 'error' function. 2014-03-17 12:22:50 +00:00
Richard W.M. Jones
6e99530ea8 launch: Return errno == ENOTSUP if discard is not supported. 2014-03-17 12:22:50 +00:00
Richard W.M. Jones
0563405d2e ocaml: Add Guestfs.Errno submodule exposing useful raw errno numbers.
For use when calling G.last_errno.
2014-03-17 12:22:50 +00:00
Richard W.M. Jones
996c0a2868 Version 1.25.45. 1.25.45 2014-03-16 22:55:52 +00:00
Richard W.M. Jones
455ccc15c3 Add tests/run-xml-to-junit.* to EXTRA_DIST. 2014-03-16 22:55:24 +00:00
Richard W.M. Jones
7fe365eee6 tests/regressions/rhbz895904.sh: Rewrite without multi-line expression.
RHEL 6-era bash cannot handle the multi-line $(...) expression in the
original code.  Rewrite the test so it is semantically the same but
doesn't have the expression that old bash can't handle.
2014-03-16 22:45:30 +00:00
Richard W.M. Jones
93335b5c4a appliance: init: Remove unnecessary comment, whitespace changes. 2014-03-15 15:46:54 +00:00
Richard W.M. Jones
bae2134aef tests/discard: sync before close isn't necessary.
However we should be calling shutdown, since we're writing to the disk
and need to catch qemu errors.
2014-03-14 13:20:22 +00:00
Richard W.M. Jones
d46ceea601 tests: fstrim: Sync before running fstrim.
This makes fstrim work.  It's not clear why exactly.

Thanks: Paolo Bonzini.
2014-03-14 13:19:42 +00:00
Richard W.M. Jones
55730f6118 Revert "tests: fstrim: Remount the disk."
This reverts commit accf1b66aa.
2014-03-14 13:19:42 +00:00
Pino Toscano
56efdb29bf tests: skip the output of test-virt-rescue.pl from RUN_OUTPUT_FILE
The output of test-virt-rescue.pl contains non-ASCII chars which give
troubles when being XSLT-transformed, so just avoid its output to leave
the rest of the resulting XML well-formed.
2014-03-14 13:52:09 +01:00
Pino Toscano
38fbda9d37 tests: provide a simple way to extract the tests data from run
If the RUN_OUTPUT_FILE environment variable is set, "run" will output
to the file indicated by that snippets of XML with the results and
outputs of the tests run.

Together with the run-xml-to-junit.sh (and its associated
run-xml-to-junit.xsl style sheet) it is possible to convert that output
file to a jUnit-like XML file, which could be used in CI systems.
2014-03-14 13:52:09 +01:00
Richard W.M. Jones
accf1b66aa tests: fstrim: Remount the disk.
This makes fstrim work.  It's not clear why exactly.
2014-03-14 10:09:47 +00:00
Richard W.M. Jones
9b883d3c3e tests/discard: Ensure a significant number of blocks are freed up on the host.
It's reasonable to expect megabytes will be freed up and given back to
the host.  Previously we just tested that at least 1 block was
released.  This test checks that at least 1000 blocks are released
(since stat(2) returns blocks of 512 bytes: 512 bytes * 1000 = approx 0.5 MB).
2014-03-14 09:42:31 +00:00
Richard W.M. Jones
8584c8cadf gobject: Don't ignore old generated files.
This was ignoring an old generated file (gobject/guestfs-gobject.h)
which, if still around, would break the build.
2014-03-13 13:51:21 +00:00
Richard W.M. Jones
b96dfa60d3 gitignore: appliance: Don't ignore some files which are now obsolete and should be removed. 2014-03-13 13:01:14 +00:00
Richard W.M. Jones
bd226af94b Version 1.25.44. 1.25.44 2014-03-13 10:57:47 +00:00
Pino Toscano
083203c635 php: fix crash with OStringList optional arguments
Properly initialize the variables for them to NULL, so there is no crash
because of trying to use rubbish pointers.

Kind of followup of commit 289fd29f0b.
2014-03-13 11:43:25 +01:00
Pino Toscano
e411cf8269 php: remove the custom "env" loading in tests
Other than being too late for changing environment variables like
LD_LIBRARY_PATH, now it is no more needed.
2014-03-13 11:43:24 +01:00
Pino Toscano
5fbbfe7440 php: add a custom PHP runner for tests
Since the default PHP test runner ignores a good number of environment
variables to potentially tampering the test suite execution, create a
custom php-for-tests.sh script which does nothing more than sourcing the
custom environment that our run-php-tests.sh outputs and running the
actual "php" executable (the one found by configure).

This fixes the loading of the guestfs_php.so module in the test suite,
as the libguestfs.so.0 library can be found by that module.
2014-03-13 11:43:24 +01:00
Richard W.M. Jones
04aaa6ddfc appliance: Fix 'make clean' in appliance subdirectory.
Commit 71dfd73042 broke 'make clean' in
the appliance subdirectory, so it would remove all the supermin.d/*
files, but without removing stamp-supermin so you couldn't rebuild
supermin.d/ with a 'make' afterwards.

In any case, 'make clean' is not supposed to delete the appliance
(which is expensive to rebuild).

Fix this so that 'make clean' doesn't remove supermin.d/* files.
'make distclean' can be used to delete this, and since it also removes
stamp-supermin, it will be recreated properly by 'make'.
2014-03-13 10:38:41 +00:00
Richard W.M. Jones
a13109c260 FAQ: Make issues which will be fixed in libguestfs >= 1.26 / supermin >= 5. 2014-03-13 10:38:41 +00:00
Richard W.M. Jones
8df1c47269 FAQ: Remove section that only applied to obsolete Fedora & RHEL releases.
Since this is fixed in all currently supported versions of Fedora
& RHEL, there's no need to document the problem in the FAQ.
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
80d77e934f FAQ: Document virt-sparsify >= 1.26 can do in-place sparsification. 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
b7cec3e8f4 sparsify: Add a test of the virt-sparsify --in-place option. 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
e3a32f95d0 sparsify: Add virt-sparsify --in-place mode. 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
b48e885004 sysprep: Add disks with discard = "besteffort".
Since virt-sysprep tends to delete a lot of files, adding discard
support to it makes some sense.

Note that this probably won't have any effect for most filesystems
since:

(a) ext4 mounts also need to use -o discard,

(b) ext4, and maybe others, require you to call fstrim explicitly,
they don't discard automatically (except for userspace tools like
mkfs.ext4 but that doesn't apply in this case).
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
fb3afdff47 virt-format: Discard the data on the disks.
If possible, this means that the host will be able to reclaim most of
the space used by formatted disks.
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
93f1bfcad7 Pass discard parameter from add-domain to add-drive.
Allow callers to specify that all the disks from a domain are added
with a specific discard mode (instead of always having discard
disabled).
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
3106789d81 Pass cachemode parameter from add-domain to add-drive.
Allow callers to specify that all the disks from a domain are added
with a specific cachemode (instead of always having to use the
default, writeback).
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
a9fc09366a tests: Add tests of discard support.
Test that blkdiscard, -o discard, and fstrim work in reality, end-to-end.
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
b408419791 New API: blkdiscardzeroes - do discarded blocks read back as zeroes? 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
452b228b46 New API: blkdiscard - discard all blocks on a block device. 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
499b9ee416 New API parameter: Add discard parameter to guestfs_add_drive_opts.
This adds a discard parameter to guestfs_add_drive_opts which
approximately maps to the discard=ignore|unmap parameter supported by
qemu.

If discard is set to "enable" then we force discard=unmap (and try to
fail if it is not possible).  If discard is set to the more useful
"besteffort" option, then we enable discard if possible.  The default
is "disable".
2014-03-13 10:38:40 +00:00
Pino Toscano
53afa03af9 builder: fix typo in comment
Followup of commit b1cf6246f3.
2014-03-12 16:07:55 +01:00
Richard W.M. Jones
2489692067 sparsify: Move copying-mode code to a separate file.
This is just code motion.
2014-03-12 14:21:30 +00:00
Richard W.M. Jones
a665a570a3 sparsify: Refactor command line parsing to pass back a mode.
This is just code motion, but sets the ground-work for adding a second
mode (in-place image modification).
2014-03-12 14:21:30 +00:00
Richard W.M. Jones
63e836881e sparsify: Move command line parsing code to separate file.
This is just code motion.
2014-03-12 14:21:30 +00:00
Richard W.M. Jones
d263a301bf sparsify: Remove unused 'open' directive. 2014-03-12 14:21:30 +00:00
Richard W.M. Jones
8df13884df sparsify: Capture any exceptions and display nicer error messages.
This is just code motion, there is no functional change.
2014-03-12 14:21:30 +00:00
Richard W.M. Jones
073f90e681 sparsify: Remove unused variable definition. 2014-03-12 14:21:30 +00:00
Richard W.M. Jones
2b4baf3478 launch: libvirt: Move the is_kvm flag (derived from libvirt capabilities) to backend data struct.
This is just rearranging the data between structs.  There should be no
functional change.
2014-03-12 14:08:22 +00:00
Richard W.M. Jones
5e105e06be daemon: fstrim: Fix fstrim so it trims the correct filesystem.
We didn't call sysroot_path, so it was trimming the appliance instead
of the guest filesystem.
2014-03-12 14:08:22 +00:00
Richard W.M. Jones
46e30c1f7c daemon: fstrim: When debugging, capture and print fstrim -v output. 2014-03-12 14:08:22 +00:00
Pino Toscano
b1cf6246f3 builder: complete architecture handling
Add the possibility to choose which architecture use to build the wanted
image (--arch). Since this implies that running commands on the guest is
usually not possible when the architecture is different than the host
one, virt-builder will nevertheless try to check whether the host is
compatible with the guest, allowing to run commands only in that case.

The caching scheme is adapted to account for the architecture (with
--print-cache showing the architecture as well).
2014-03-12 15:06:55 +01:00