However we should be calling shutdown, since we're writing to the disk and need to catch qemu errors.
This makes fstrim work. It's not clear why exactly. Thanks: Paolo Bonzini.
This reverts commit accf1b6.
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.
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.
This makes fstrim work. It's not clear why exactly.
…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).
This was ignoring an old generated file (gobject/guestfs-gobject.h) which, if still around, would break the build.
…and should be removed.
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 289fd29.
Other than being too late for changing environment variables like LD_LIBRARY_PATH, now it is no more needed.
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.
Commit 71dfd73 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'.
… >= 5.
…ses. Since this is fixed in all currently supported versions of Fedora & RHEL, there's no need to document the problem in the FAQ.
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).
If possible, this means that the host will be able to reclaim most of the space used by formatted disks.
Allow callers to specify that all the disks from a domain are added with a specific discard mode (instead of always having discard disabled).
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).
Test that blkdiscard, -o discard, and fstrim work in reality, end-to-end.
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".
Followup of commit b1cf624.
This is just code motion.
This is just code motion, but sets the ground-work for adding a second mode (in-place image modification).
This is just code motion.
This is just code motion, there is no functional change.