summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* launch: Add libvirt backend.Richard W.M. Jones2012-07-224-2/+1061
| | | | | | | | | | | | Complete the attach-method libvirt backend. This backend uses libvirt to create a transient KVM domain to run the appliance. Note that this still will only work with local libvirt URIs since the <kernel>, <initrd> and appliance links in the libvirt XML refer to local files, and virtio serial only works locally (limitation of libvirt). Remote support will be added later.
* Add attach-method "libvirt" or "libvirt:<URI>".Richard W.M. Jones2012-07-214-1/+28
| | | | | With this commit, you can set the attach method to libvirt, but calling launch will give an error.
* launch: Make 'drive_name' into a common function.Richard W.M. Jones2012-07-212-5/+5
| | | | This is just code motion.
* appliance: Push appliance building lock into guestfs___build_appliance.Richard W.M. Jones2012-07-212-17/+27
| | | | | | | | | Since we will be calling guestfs___build_appliance from the libvirt code in future, there's no point having two places where we have to acquire the lock. Push the lock down into this function instead. Because "glthread/lock.h" includes <errno.h> we have to add this header to the file too.
* fuse:remove the unused macro when fuse is not availableWanlong Gao2012-07-211-1/+1
| | | | | | Just make gcc happy when fuse is not available. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* launch: Abstract attach method operations.Richard W.M. Jones2012-07-206-111/+171
| | | | | | g->attach_ops points to a structure which contains the operations supported by each attach method backend (ie. appliance, unix, etc.).
* launch: Move the command line building code entirely into launch-appliance.c.Richard W.M. Jones2012-07-203-47/+19
| | | | | Although we still use the handle as convenient temporary storage.
* launch: Move guestfs_config API and build list of qemu parameters in handle.Richard W.M. Jones2012-07-205-32/+67
| | | | | | Move and rewrite guestfs_config so it accumulates a list of qemu parameters in the handle. These are added to the appliance at launch time (with attach method == unix:... you'll now get an error).
* launch: Move launch timing / messages code into launch.c.Richard W.M. Jones2012-07-204-77/+78
|
* lib: Use bool (from <stdbool.h>) for a few fields in the handle.Richard W.M. Jones2012-07-201-10/+12
|
* lib: Rearrange fields in guestfs handle.Richard W.M. Jones2012-07-201-39/+38
| | | | Arrange the fields more logically. This is just code motion.
* launch: Remove some dead code from the appliance method.Richard W.M. Jones2012-07-191-42/+0
|
* lib: Split launch.c into separate files.Richard W.M. Jones2012-07-195-1245/+1272
| | | | | | | | | | | | | | | | | | | | | | launch-appliance.c contains the code associated with the 'appliance' attach-method. Mostly. In fact there are a few APIs which don't fit so nicely: - config: deprecated API which fiddles with the qemu command line directly - max-disks: depends on the qemu implementation (virtio-scsi or not) - debug-drives: used for testing only launch-unix.c contains the code associated with 'unix:<path>'. launch.c is the common code for launching, along with a few other APIs such as guestfs_add_drive_opts. This commit also reduces the number of headers to just those which are required.
* Remove debug-cmdline API.Richard W.M. Jones2012-07-191-20/+0
| | | | | Note that debug* calls are not part of the stable API and can be removed or changed at any time.
* lib: Use safe_asprintf when constructing attach_method.Richard W.M. Jones2012-07-192-6/+2
| | | | Just a small code cleanup / simplification.
* build: Rename most C files that contain underscore with dash.Richard W.M. Jones2012-07-197-10/+10
| | | | | | | This is just code motion. Some files cannot be renamed. Notably rpcgen input and output files must not contain dash characters, else rpcgen breaks.
* build: Rename src/virt.c to src/libvirtdomain.cRichard W.M. Jones2012-07-192-1/+1
| | | | | This file contains the code implementing guestfs_add_domain (for adding a libvirt domain) so this name is less confusing.
* build: Arrange libguestfs_la_SOURCES in order.Richard W.M. Jones2012-07-191-1/+1
|
* New API: add new api xfs_infoWanlong Gao2012-07-181-1/+1
| | | | | | | | | | | | Add xfs_info to show the geometry of the xfs filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Updated po/POTFILES. - Use xfs_ prefix for all struct fields. - Return uninitialized fields as -1 / empty string. - Copyedit the description.
* docs: Use L<...> for links.Richard W.M. Jones2012-07-171-1/+1
| | | | | Instead of working around bugs, podwrapper has been fixed so that links work in all output formats.
* docs: febootstrap is in section 8 of the manual, not section 1.Richard W.M. Jones2012-07-161-1/+1
|
* build: Change calls to podwrapper.sh to use $(PODWRAPPER).Richard W.M. Jones2012-07-161-1/+1
| | | | | This will allow us to easily change the location of this script in future.
* generator: Rename 'add_drive_opts' API to 'add_drive'.Richard W.M. Jones2012-07-141-10/+0
| | | | | | By using the once_had_no_optargs flag, this change is backwards compatible for callers (except Haskell, PHP and GObject as discussed in earlier commit).
* tests: Rename test0* functions as internal_test*.Richard W.M. Jones2012-07-111-0/+1
| | | | | The internal_* prefix is reserved for internal functions such as these tests.
* Revert "launch: Correction in comment."Richard W.M. Jones2012-07-081-2/+4
| | | | | | This reverts commit 6e5a85bb9b6557bc337625a339728e23f5f2dd94. It turns out this is a bug in QEMU after all.
* 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.
* qemu: Use sgabios by default (thanks Dan Berrange).Richard W.M. Jones2012-07-061-0/+9
|
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-033-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
* close: Warn if qemu exits unsuccessfully.Richard W.M. Jones2012-07-031-1/+19
| | | | | Currently guestfs_close has no method to return an error indication, so this commit simply prints the error on stderr.
* close: Rearrange the order in which the handle is closed and freed.Richard W.M. Jones2012-07-031-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.
* Add notes about how qemu cache=none works internally.Richard W.M. Jones2012-07-021-1/+12
| | | | This is just a comment and has no functional effect.
* Rename qemu option cache=off to cache=none.Richard W.M. Jones2012-07-022-10/+10
| | | | | Note that qemu treats these identically, so this change has no functional effect.
* inspect: Check partition exists when doing fstab mapping.Richard W.M. Jones2012-06-291-8/+26
| | | | | If the partition name we're about to return doesn't really exist, then don't perform the mapping.
* inspect: Guess device name from /dev/disk/by-id/*-partN path (RHBZ#627675).Richard W.M. Jones2012-06-291-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.
* inspect: Refactor resolve_fstab_device code into multiple functions.Richard W.M. Jones2012-06-291-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.
* New API: guestfs_nr_devicesRichard W.M. Jones2012-06-291-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.
* Update API support from tarballs.Richard W.M. Jones2012-06-2823-0/+11670
|
* launch: Avoid double-close when qemu exits early.Richard W.M. Jones2012-06-261-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].
* launch: Ensure errno from test_qemu_cmd is captured and printed.Richard W.M. Jones2012-06-261-5/+3
|
* launch: Set g->sock = -1 to avoid double-close.Richard W.M. Jones2012-06-261-0/+1
| | | | This fixes commit ef5c02c6ee72eb8e127115923951777a2c2b8480.
* launch: Log errors from close syscall.Richard W.M. Jones2012-06-261-1/+6
|
* launch: Treat /dev/null specially, for old KVM.Richard W.M. Jones2012-06-251-0/+19
| | | | | | | | | Old KVM can't add /dev/null readonly. Treat /dev/null as a special case. We also fix a few tests where /dev/null was being used with format=qcow2. This was always incorrect behaviour, but qemu appears to tolerate it.
* lib: Remove obsolete NETWORK, ROUTER definitions in header file.Richard W.M. Jones2012-06-251-21/+0
| | | | These haven't been used since we switched over to virtio-serial.
* ppc64: is_openable function needed on all platforms now.Richard W.M. Jones2012-06-141-4/+0
| | | | This fixes commit 295d6af48d1d8c5238d1536b0c6a2ece42b0b445.
* virtio-scsi: Increase udev timeout.Richard W.M. Jones2012-06-141-1/+1
| | | | | In Koji, when you've got 200+ disks, udev times out before all the udev events have been processed.
* New API: device-index.Richard W.M. Jones2012-06-131-1/+1
| | | | | | 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.
* New API: guestfs_canonical_device_name.Richard W.M. Jones2012-06-132-1/+24
| | | | This API makes device names canonical, eg. /dev/vda1 -> /dev/sda1.
* New API: guestfs_max_disks.Richard W.M. Jones2012-06-132-0/+23
| | | | Returns the maximum number of disks that may be added to a handle.
* Update documentation on maximum number of disks.Richard W.M. Jones2012-06-131-8/+10
|
* virtio-scsi: Fix disk name calculation.Richard W.M. Jones2012-06-131-2/+3
| | | | This fixes commit 0c0a7d0d868d153adf0600189f771459e1068b0a.