summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-061-0/+9
| | | | (cherry picked from commit 52d188e32fb8addb45bf926df07e34ab35898f85)
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-063-60/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-061-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-061-33/+31
| | | | | | | | | | | | | | 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)
* Add notes about how qemu cache=none works internally.Richard W.M. Jones2012-07-061-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-062-10/+10
| | | | | | | Note that qemu treats these identically, so this change has no functional effect. (cherry picked from commit 1608ca182b094a1dbe22094f39a5e86f18f728b7)
* inspect: Check partition exists when doing fstab mapping.Richard W.M. Jones2012-07-061-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-061-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)
* New API: guestfs_nr_devicesRichard W.M. Jones2012-07-061-1/+1
| | | | | | | | 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)
* inspect: Refactor resolve_fstab_device code into multiple functions.Richard W.M. Jones2012-07-061-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)
* 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)
* 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)
* arm: Use #if defined instead of #ifdef.Richard W.M. Jones2012-06-211-1/+1
| | | | | No functional change. (cherry picked from commit 4e5d3b06fb2f366c0010ae6aa15f9dee74261917)
* ppc64: Avoid "defined by not used" warning for is_openable function.Richard W.M. Jones2012-06-211-0/+4
| | | | (cherry picked from commit 450493cf6b563389bd11f02284bd22d7ed90b5da)
* trace: Fix display of non-printing characters.Richard W.M. Jones2012-06-011-0/+5
| | | | | | | | Previously the code would drop the first character in any sequence of non-printing characters that occurred within a string. Fix for commit e6f18c59d577dd0b443bc6a1d76f699c4e0dde9f. (cherry picked from commit 73071b3163774ff9a514a05bc8e6fb35fa910787)
* trace: Fix escaping of non-printable signed characters.Richard W.M. Jones2012-06-011-1/+1
| | | | | Fix for commit e6f18c59d577dd0b443bc6a1d76f699c4e0dde9f. (cherry picked from commit fba81add94cde015afe8a65245cb4e60a1d3e6bf)
* inspection: Don't fail if /etc/HOSTNAME or /etc/hostname are empty files ↵Richard W.M. Jones2012-06-012-4/+24
| | | | | | | | | | | | | | | | | | | (RHBZ#823821). Change guestfs___first_line_of_file so that if the file is empty this returns an empty string instead of an error. This is consistent with the behaviour of this function in the case where the file starts with a \n character, where it would previously have returned an empty string. Change all callers so that they handle this case. Then change the hostname parsing code so that it doesn't give up when /etc/HOSTNAME is empty, but falls through to the next alternative, and similarly for /etc/hostname. Thanks Todd Mummert for finding and diagnosing this bug. (cherry picked from commit f00066d22b11bf40d0272f68565a2a27fea15627)
* inspection: Use parse_release_file to parse ttylinux release file.Richard W.M. Jones2012-06-011-2/+1
| | | | | | | | | | parse_release_file should be used to set fs->product_name, instead of calling guestfs___first_line_of_file directory, although currently the two are equivalent. This is code motion and fixes commit b648b1813fc8e55db790435b5414d9be3ec765d2. (cherry picked from commit cffb7fefc88a317f957785f6448fb24183c8c629)
* Update API support.Richard W.M. Jones2012-05-217-0/+3090
|
* NEW API: add new api btrfs-fsckWanlong Gao2012-05-151-1/+1
| | | | | | | | | Add the new API btrfs-fsck to check the btrfs filesystem. Btrfs is currently under heavy development, and not suitable for any uses other than benchmarking and review. But it'll be useful in the near future. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: add new api btrfs-set-seeding to enable or disable seeding.Wanlong Gao2012-05-141-1/+1
| | | | | | | Add the new API btrfs-set-seeding to support the seeding-device feature for btrfs. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* qemu: Move -nodefaults etc logically together.Richard W.M. Jones2012-05-121-16/+16
| | | | This is just code motion.
* arm: Add configure flag '--with-qemu-options'.Richard W.M. Jones2012-05-121-0/+65
| | | | | | | This flag allows extra QEMU options to be passed on the command line. This is useful mainly on arm (see the notes in the updated README file).
* arm: Disable -machine, -enable-kvm options except on x86, x86-64.Richard W.M. Jones2012-05-121-0/+5
| | | | | | | Presently KVM is only applicable to x86 and x86-64 (although that will change in future, and there are rumoured to be implementations for some current non-x86 architectures). In any case having these options breaks ARM, so disable them for non-x86 architectures at the moment.
* arm: On Linux ARM kernels, the serial console is ttyAMA0.Richard W.M. Jones2012-05-121-1/+7
| | | | Cope with unnecessary lack of standardization.
* arm: Disable test for -no-hpet during launch.Richard W.M. Jones2012-05-121-0/+8
|
* arm: Set minimum LIBGUESTFS_MEMSIZE at 128.Richard W.M. Jones2012-05-121-1/+1
| | | | | | | | For ARM Versatile ("versatilepb") architecture, memsize must be set to 256 (megabytes) else the appliance is unable to boot. Previously setting LIBGUESTFS_MEMSIZE=256 was not allowed. Versatile Express has larger limits.
* configure: Allow systemtap/DTrace userspace probes to be disabled.Richard W.M. Jones2012-05-111-2/+2
| | | | | | | | | './configure --disable-probes' will disable these probes. Otherwise they are autodetected as before. The <sys/sdt.h> produces lots of errors when you try to compile with these probes enabled under clang, so it is necessary to provide a way to disable them for clang users.
* Update API support.Richard W.M. Jones2012-05-0326-0/+12671
|
* Turn libguestfs FAQ into a man page: guestfs-faq(1).Richard W.M. Jones2012-05-011-0/+3
|
* doc: Rewrite description section in man page guestfs(3).Richard W.M. Jones2012-05-011-31/+12
| | | | | Make the introduction in the man page shorter and punchier, so it leads readers directly to other pages of interest.
* Remove "convenience header" "gettext.h" and use <libintl.h> instead.Richard W.M. Jones2012-05-013-278/+2
| | | | | | | | | | | | 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.
* Move 'libguestfs.pc' (pkgconfig file) to src/ directory.Richard W.M. Jones2012-04-302-0/+17
| | | | Since it describes the C library, it's better in the src/ directory.
* lib: Remove the BUSY state.Richard W.M. Jones2012-04-264-86/+31
| | | | | | | | | | | | | | | Originally this state was intended so that in some way you could find out if the appliance was running a command. However there was never a thread-safe way to access the state of the handle, so in effect you could never do anything useful safely with this information. This commit completely removes the BUSY state. The only visible change is to the guestfs_is_busy API. Previously you could never call this safely from another thread. If you called it from the same thread it would always return false (since the current thread can't be running a libguestfs command at that point by definition). Now it always returns false.
* New btrfs APIs.Richard W.M. Jones2012-04-251-1/+1
| | | | | | | | | | | | | | | | Bind the easy parts of the 'btrfs' program. The new APIs are: btrfs-device-add: add devices to a btrfs filesystem btrfs-device-delete: remove devices from a btrfs filesystem btrfs-filesystem-sync: sync a btrfs filesystem btrfs-filesystem-balance: balance a btrfs filesystem btrfs-subvolume-create: create a btrfs snapshot btrfs-subvolume-delete: delete a btrfs snapshot btrfs-subvolume-list: list btrfs snapshots and subvolumes btrfs-subvolume-set-default: set default btrfs subvolume btrfs-subvolume-snapshot: create a writable btrfs snapshot
* Check library still compiles without libvirt.Richard W.M. Jones2012-04-181-0/+2
|
* Don't abort inspection if mdadm.conf ARRAY doesn't have a uuidMatthew Booth2012-04-181-1/+1
|
* fuse: Improve reporting in mount-local when verbose is enabled.Richard W.M. Jones2012-04-161-3/+10
|
* New APIs for reading and writing ext2 file attributes and file generation.Richard W.M. Jones2012-04-131-1/+1
| | | | | | | | | | | | The new APIs are: get-e2attrs: List ext2 file attributes of a file. set-e2attrs: Set or clear ext2 file attributes of a file. get-e2generation: Get ext2 file generation of a file. set-e2generation: Set ext2 file generation of a file. These are implemented using the lsattr and chattr programs from e2fsprogs.
* lib: Escape , as ,, on qemu command line (RHBZ#811649).Richard W.M. Jones2012-04-121-3/+16
|
* lib: Remove check_path function, limitation is colon, not comma (RHBZ#811649).Richard W.M. Jones2012-04-121-12/+8
| | | | | | | | | | | | | | | Remove the bogus check_path function and move the functionality into the two places where it was being used. qemu -cdrom , works fine, I tested it. Colon cannot be used in a block device filename anywhere, since the qemu block driver interprets it as a prefix. There is no known way to work around this problem. I checked this is true with kwolf. Comma is fine in -drive options, provided it is escaped by doubling it.
* Revert "launch: don't add a drive twice"Richard W.M. Jones2012-04-121-19/+2
| | | | This reverts commit be47b66c3033105a2b880dbc10bfc2b163b7eafe.
* inspection: Remove spurious warning for Ubuntu 10.04 with encrypted swap ↵Richard W.M. Jones2012-04-121-1/+1
| | | | (RHBZ#811872).
* New man page: guestfs-performance(1).Richard W.M. Jones2012-04-111-0/+1
| | | | This contains tips for engineering libguestfs for greatest performance.
* docs: Add libguestfs-test-tool(1) and libguestfs-make-fixed-appliance(1) to ↵Richard W.M. Jones2012-04-111-1/+3
| | | | | | guestfs(3) man page. Inexplicably these were not included before.
* launch: Set error when qemu fails early during launch (RHBZ#811650).Richard W.M. Jones2012-04-111-1/+4
| | | | | This caused the Python bindings (and probably others) to segfault because guestfs_last_error(g) would return NULL.