summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version 1.16.27.1.16.27stable-1.16Richard W.M. Jones2012-07-0720-21377/+22521
|
* Update gnulib to latest version.Richard W.M. Jones2012-07-072-0/+2
| | | | (cherry picked from commit 1596b6026ddd1e343efc6a74fc23f46e4975868f)
* launch: Correction in comment.Richard W.M. Jones2012-07-071-4/+2
| | | | | | | | https://bugs.launchpad.net/qemu/+bug/1021649 is invalid, probably caused by a Fedora ROM. This updates commit 52d188e32fb8addb45bf926df07e34ab35898f85. (cherry picked from commit 6e5a85bb9b6557bc337625a339728e23f5f2dd94)
* qemu: Use sgabios by default (thanks Dan Berrange).Richard W.M. Jones2012-07-071-0/+9
| | | | (cherry picked from commit 52d188e32fb8addb45bf926df07e34ab35898f85)
* qemu or qemu-kvm >= 1.1.0 is required.Richard W.M. Jones2012-07-071-1/+2
| | | | | | | | | Earlier versions of qemu contained a bug in the qcow2 code which causes qemu to segfault when shutting down and flushing its internal cache, and this can result in data loss. Cherry picked from commit 7996e0882442dc7bac2ab573e2fcac0b488c8cc7 and changed to suit stable-1.16 releases.
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-0729-81/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit ffbf1475f7ae7c462db289ad4834391469e72edd)
* close: Warn if qemu exits unsuccessfully.Richard W.M. Jones2012-07-071-1/+19
| | | | | | Currently guestfs_close has no method to return an error indication, so this commit simply prints the error on stderr. (cherry picked from commit bcc4ffb52b9f4b5db7861682905ec32844f4603b)
* close: Rearrange the order in which the handle is closed and freed.Richard W.M. Jones2012-07-071-29/+27
| | | | | | | | | | | | | | | The order is now: - remove the handle from the list of handles - send close trace message - sync and shutdown qemu - run user close callback - free temporary directory - free memory This commit ought to be no functional change. (cherry picked from commit fc3c6fff4b0a6ffeb75aa78b1d73241a14a03cd1)
* perl, python, ruby: Fix comments on call to close method.Richard W.M. Jones2012-07-073-1/+10
| | | | | | | | Make the comments consistent. Also make the Perl example call $g->close explicitly so it is consistent with the other examples. (cherry picked from commit 27ebf517fae972eee49ae5911a03fabe5f4b6e54)
* examples: In create_disk example, don't call set_autosync.Richard W.M. Jones2012-07-077-56/+1
| | | | | | This is now set by default in all supported versions of libguestfs. It's just confusing if the examples refer to it. (cherry picked from commit 917550a117904ec1a06b77a7870a147014d71adb)
* daemon: Run fsync on block devices after sync (RHBZ#836710).Richard W.M. Jones2012-07-072-0/+79
| | | | | | | | | | | | | | | | | | | On Linux, sync(2) does not actually issue a write barrier, thus it doesn't force a flush of the underlying hardware write cache (or qemu's disk cache in the virtual case). This can be a problem, because libguestfs relies on running sync in the appliance, followed by killing qemu (using SIGTERM). In most cases, this is fine, because killing qemu with SIGTERM should cause it to flush out the disk cache before it exits. However we have found various bugs in qemu which cause qemu to crash while doing the flush, leaving the data unwritten (see RHBZ#836913). The solution is to issue fsync(2) to the block devices. This has a write barrier, so it ensures that qemu writes out its cache long before we get around to killing qemu. (cherry picked from commit c0a3c9ce70b98171e737e49e6dccc4457963f2ec)
* daemon: Code tidy up in devsparts.Richard W.M. Jones2012-07-071-8/+9
| | | | | | No functional change. (cherry picked from commit cb24ceedd8a8ef7da71cfcce6db10669de47685c)
* Add notes about how qemu cache=none works internally.Richard W.M. Jones2012-07-071-1/+12
| | | | | This is just a comment and has no functional effect. (cherry picked from commit 0437a7905619b8370e25fbae1a3e6388c5277be9)
* Rename qemu option cache=off to cache=none.Richard W.M. Jones2012-07-072-9/+9
| | | | | | | | | Note that qemu treats these identically, so this change has no functional effect. (cherry picked from commit 1608ca182b094a1dbe22094f39a5e86f18f728b7) Conflicts: src/launch.c
* appliance: Update paths to udevd.Richard W.M. Jones2012-07-071-1/+3
| | | | | | systemd is playing a WTF game with udevd, moving it around and renaming it unnecessarily in each release. Chase all known locations. (cherry picked from commit 906f8e3ae24a084d9a70d33d84c0ce29bdafa79c)
* appliance: Update comment to note that systemd package now contains udevd.Richard W.M. Jones2012-07-071-1/+1
| | | | (cherry picked from commit 100271c7bc00a1f9baacd8c56b43e156b736fc12)
* tests: Add a test of /dev/disk/by-id paths (RHBZ#627675).Richard W.M. Jones2012-07-071-0/+8
| | | | (cherry picked from commit 5489304c8d2836713ec58051c24514eba22b8c94)
* tests: Use qemu-img to create an overlay for testing, instead of copying.Richard W.M. Jones2012-07-072-16/+18
| | | | | | | | | | | Replace: cp tests/guests/fedora.img test.img with the longer but possibly more space-efficient equivalent: qemu-img create -F raw -b tests/guests/fedora.img -f qcow2 test.qcow2 (cherry picked from commit 339f3647f889424af2a2256c4fcad0b44982c275)
* inspect: Check partition exists when doing fstab mapping.Richard W.M. Jones2012-07-071-8/+26
| | | | | | If the partition name we're about to return doesn't really exist, then don't perform the mapping. (cherry picked from commit ea8421c5d297698856a87c2cfe4a6b42796175a8)
* inspect: Guess device name from /dev/disk/by-id/*-partN path (RHBZ#627675).Richard W.M. Jones2012-07-071-0/+74
| | | | | | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=836573#c3 for an explanation. Useful function 'is_partition' shows how to tell if a device name represents a partition. (cherry picked from commit 7eaa99994ebd354f4b078d4068695984989a907f)
* inspect: Refactor resolve_fstab_device code into multiple functions.Richard W.M. Jones2012-07-071-68/+103
| | | | | | | This is mostly code motion, although it also fixes a memory leak in an extremely rare failure case, and it generally tidies up the existing code. (cherry picked from commit 47b8225b05a7e35411f954f61f3eb3115c5a9f45)
* New API: guestfs_nr_devicesRichard W.M. Jones2012-07-073-1/+30
| | | | | | | This returns the number of whole block devices added. It is usually simpler to call this than to list the devices and count them, which is what we do in some places in the current codebase. (cherry picked from commit 152b179a19e43fcb0baec65ea65d394ee1dba891)
* New API: device-index.Richard W.M. Jones2012-07-073-2/+38
| | | | | | | | This returns the index of the device, eg. /dev/sdb => 1. Or you can think of it as the order that the device was added, or the index of the device in guestfs_list_devices. (cherry picked from commit a9d7d044f552855a7ef78d953c0c2672e35bfc80)
* ruby: Fix detection of library (thanks Hilko Bengen).Richard W.M. Jones2012-07-071-7/+25
| | | | | | | | | | On Debian, the Ruby C extensions library isn't '-lruby', it's something like '-lruby1.8' or '-lruby-1.9.1' and these can even be parallel-installed. Fix detection so we use Ruby's own rbconfig.rb file to find the right library to use. (cherry picked from commit cba49169094f04dead9b165b6b5991afa92132ff)
* ruby: Changing spacing in configure file.Richard W.M. Jones2012-07-071-5/+5
| | | | | No functional change. (cherry picked from commit b07d0968823d008776345a1c724713d2320e1571)
* ruby: Remove useless AC_SUBST in configure file.Richard W.M. Jones2012-07-071-1/+0
| | | | (cherry picked from commit b9f858e5eefa0d2abae5ff0a61a39b0d34334bc1)
* run: Rearrangement and add comments.Richard W.M. Jones2012-07-071-2/+5
| | | | | No functional change. (cherry picked from commit 2d56e5af900662ea0a13e9e8ea4a802609214ecc)
* Version 1.16.26.1.16.26Richard W.M. Jones2012-06-2818-129/+153
|
* Ensure #include <config.h> occurs in every C file.Richard W.M. Jones2012-06-288-0/+16
| | | | (cherry picked from commit 1d17a6e9d8f434f952f3c171b5a81ca6b916fa1f)
* src/actions.c: Include <config.h> in this generated file.Richard W.M. Jones2012-06-281-0/+2
| | | | | | | | On RHEL 5, because _GNU_SOURCE was not defined, open_memstream was not being declared, resulting in miscompilation and a segfault in the trace code whenever open_memstream returned a pointer >= 0x80000000 (which would be truncated to a 32 bit int and then sign-extended). (cherry picked from commit 6777425636d1c04494e52c61dc44f523458d12d3)
* gobject: bindtests: gjs exception behaviour changed, fix test.Richard W.M. Jones2012-06-281-1/+1
| | | | | | | | | | When libguestfs calls 'error (g, "error")', gjs in F17 throws error.message == "Error invoking Guestfs.test0rinterr: error" In F18, error.message is simply the string "error". Fix the test so it works for both cases. (cherry picked from commit 6afb7336e33dc28c4fd1a4545a8298ee36c10723)
* ./run: Fix indenting for shell script.Richard W.M. Jones2012-06-281-8/+8
| | | | (cherry picked from commit bbb7d75c91450ab029edb794b0486eeb8220e4fd)
* launch: Avoid double-close when qemu exits early.Richard W.M. Jones2012-06-281-2/+6
| | | | | | | | | | | | | | | | The stdin and stdout of the qemu process are aliased to g->fd: g->fd[0] = wfd[1]; g->fd[1] = rfd[0]; However if the child exits early, then child_cleanup closes g->fd[0], g->fd[1], AND the code at the cleanup1 label closes wfd[1], rfd[0], resulting in a double-close. Avoid this case by setting wfd[1], rfd[0] to -1. In the cleanup1 label, only close wfd[1], rfd[0] if they are not -1, and add the same for g->fd[0], g->fd[1]. (cherry picked from commit c87956837e962072fff61edef5b18e55ad42d730)
* launch: Ensure errno from test_qemu_cmd is captured and printed.Richard W.M. Jones2012-06-281-5/+3
| | | | (cherry picked from commit 9e221e55b61e9f1cd0caf292ca609a4ca26f1d4d)
* launch: Set g->sock = -1 to avoid double-close.Richard W.M. Jones2012-06-281-0/+1
| | | | | This fixes commit ef5c02c6ee72eb8e127115923951777a2c2b8480. (cherry picked from commit 11317b5d1243f3afc35f7abe8edc646f75813e36)
* launch: Log errors from close syscall.Richard W.M. Jones2012-06-281-1/+6
| | | | (cherry picked from commit ef5c02c6ee72eb8e127115923951777a2c2b8480)
* tests: Add thread IDs to test of bug 790721.Richard W.M. Jones2012-06-281-5/+10
| | | | (cherry picked from commit 90d0beb3c528d91029349b64d0159836c776189b)
* lib: Remove obsolete NETWORK, ROUTER definitions in header file.Richard W.M. Jones2012-06-281-21/+0
| | | | | These haven't been used since we switched over to virtio-serial. (cherry picked from commit 78a515ec4a4e8650bd2e1ffc0bfbb97b9568306d)
* test-virt-resize: Replace truncate with guestfish sparse.Richard W.M. Jones2012-06-281-1/+1
| | | | | | | | Another instance of 'truncate' command. See commit 39df80dcc0e485e69048bddbf33c259ce532e50d for an explanation. (cherry picked from commit ef1514aa1e0a099d71cbb7d2c5f24f9f32e1939d)
* part-get-bootable: Fix when partitions are missing or unordered (RHBZ#602997).Richard W.M. Jones2012-06-281-4/+16
| | | | | | | | | The original fix for this in commit 511c82df46f5c6f4a7f984fdb81d4691038ed6da was not complete, in that it did not fix the case of the old (pre '-m' option) parted. This doesn't matter for Fedora, but it matters for RHEL 5 which has this ancient parted. (cherry picked from commit 4d3ec25b47361601604e2f585178393e60f4cd4d)
* ruby: Add a replacement rb_hash_lookup function for Ruby 1.8.5.Richard W.M. Jones2012-06-283-1/+23
| | | | | This function was first added to Ruby in 1.8.7. (cherry picked from commit 8098d062b4cb70defd4aecba0ba8cd75cf893751)
* ruby: Fix libruby test.Richard W.M. Jones2012-06-281-3/+2
| | | | | | | If -lruby was not available, this used to define HAVE_LIBRUBY=0. However this meant that the later test -n "$HAVE_LIBRUBY" would be successful, whereas it should fail in this case. (cherry picked from commit 823ba05ebd8f1a12574a3f154aaf7c8b4f2aeeac)
* tests: Add SKIP_TEST_* variables to allow these tests to be skipped.Richard W.M. Jones2012-06-286-0/+30
| | | | | | By setting these variables, we can skip tests that fail on RHEL 5. (cherry picked from commit 145f35badfd9ca4a6d9f54f7732566a5e5114876)
* Version 1.16.25.1.16.25Richard W.M. Jones2012-06-2120-222/+540
|
* build: Workaround for AC_PROG_SED not existing.Richard W.M. Jones2012-06-211-1/+7
| | | | | This didn't exist on ancient autoconf in RHEL 5. (cherry picked from commit 489da3ccdf96e995d3f53fe68eced37b16baa1d2)
* build: Define abs_builddir if not defined already.Richard W.M. Jones2012-06-211-0/+3
| | | | | | | | | This is missing on RHEL 5. This updates commit 50aa9533e4a505e1c64dbedddb30491bfbb755d6. Cherry picked from commit bc7f1a5ef156576c069f47ea33f4977979ac032d and backported to libguestfs 1.16.
* fuse: Skip 'truncate' tests if this command is missing.Richard W.M. Jones2012-06-211-9/+12
| | | | (cherry picked from commit d7c9c6a0d926982b64d13949a5da580ea4ecc4b6)
* tests: Replace truncate command with 'guestfish sparse'.Richard W.M. Jones2012-06-215-6/+12
| | | | | | | | | | | | | 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 Cherry picked from commit 39df80dcc0e485e69048bddbf33c259ce532e50d and backported to libguestfs 1.16 branch.
* fuse: Add replacement for fuse_opt_add_opt_escaped.Richard W.M. Jones2012-06-212-3/+44
| | | | | | | | | | | | RHEL 5-era FUSE didn't have this function. I copied the function out of upstream FUSE, since the license is compatible. Cherry picked from commit 4846b84476015874d569c14c2c30fcd71aa4d54c and backported to libguestfs 1.16. This includes more of the development 'configure.ac' than is strictly necessary, but on the other hand it brings the code closer to that development branch.
* build: Define builddir and abs_srcdir when they are missing.Richard W.M. Jones2012-06-2113-10/+46
| | | | | | | | | | | | | | | | | | | | | | RHEL 5-era autoconf did not define these, so define them manually when they are missing. Define builddir as '.' The scripts require this. It won't work in the srcdir != builddir case, but we don't care about that for RHEL 5. This commit also moves the builddir / abs_srcdir variable setting above the include of subdir-rules.mk, in case that include uses these variables. Useful script: for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do if ! grep -q '^abs_srcdir' $f; then echo missing in $f fi done (cherry picked from commit 50aa9533e4a505e1c64dbedddb30491bfbb755d6)