summaryrefslogtreecommitdiffstats
path: root/src/launch-libvirt.c
Commit message (Collapse)AuthorAgeFilesLines
* syntax: Remove include <assert.h> where assert is not used.Richard W.M. Jones2012-09-151-1/+0
| | | | Found by 'make syntax-check'.
* launch: libvirt: Enable sVirt.Richard W.M. Jones2012-09-141-21/+0
|
* launch: libvirt: Mark appliance disk as <shareable/> (thanks Dan Berrange).Richard W.M. Jones2012-09-141-0/+3
| | | | | | | | | | | This is a fix for multiprogramming: If two instances of libguestfs share the same appliance disk, then libvirt would unlabel the disk when one of the instances closes the handle, resulting in the other qemu being unable to continue accessing the appliance. Adding the flag makes libvirt understand that the disk is shared so it doesn't do this, and it apparently handles locking correctly too if we were using sanlock.
* shutdown: Add 'check_for_errors' hint along the shutdown path.Richard W.M. Jones2012-09-041-3/+5
| | | | | | | | This hint tells the backend whether anyone cares about errors when the appliance is shut down. Currently this only has any effect on the libvirt backend, where it controls whether or not we use the VIR_DOMAIN_DESTROY_GRACEFUL flag.
* launch: libvirt: Add VIR_DOMAIN_DESTROY_GRACEFUL flag.Richard W.M. Jones2012-09-041-2/+1
| | | | | | We want libvirt to report failures when destroying the guest. See: https://bugzilla.redhat.com/show_bug.cgi?id=853369#c12
* launch: libvirt: Direct mode flag is not (yet) supported, so give an error ↵Richard W.M. Jones2012-09-041-0/+6
| | | | | | in this case. We definitely intend to support this in future.
* launch: libvirt: Use guestfs_disk_format API to autodetect input format.Richard W.M. Jones2012-09-031-85/+19
|
* launch: libvirt: Remove code for creating sockdir.Richard W.M. Jones2012-08-301-107/+8
| | | | | | Create the sockets in g->tmpdir as usual. It's a bug in libvirt that it doesn't label the sockets correctly no matter where they are located.
* launch: libvirt: Avoid memory leak if sockdir is not created (found by ↵Richard W.M. Jones2012-08-301-0/+2
| | | | valgrind).
* launch: libvirt: Don't crash if shutdown_libvirt is called early in launch.Richard W.M. Jones2012-08-281-8/+13
| | | | | | | | | | | The assert (conn != NULL) was being triggered with this stack trace: at launch-libvirt.c:1305 fd=<optimized out>, error_if_eof=error_if_eof@entry=0) at proto.c:222 size_rtn=size_rtn@entry=0x7fffffffdb34, buf_rtn=buf_rtn@entry=0x7fffffffdb58) at proto.c:548 libvirt_uri=<optimized out>) at launch-libvirt.c:391
* launch: libvirt: Always create /var/run/libguestfs.Richard W.M. Jones2012-08-211-2/+4
| | | | | This directory won't necessarily exist (esp. if /var/run is really /run). So create it each time.
* launch: libvirt: Minimum libvirt version is now 0.10.0.Richard W.M. Jones2012-08-211-9/+26
|
* launch: libvirt: Suppress printing of libvirt errors to stderr and other ↵Richard W.M. Jones2012-07-241-4/+19
| | | | cleanups.
* launch: libvirt: Use SELinux-mandated directory for sockets (RHBZ#842307).Richard W.M. Jones2012-07-241-31/+147
| | | | | | Note this does not yet enable sVirt confinement of the appliance. That requires at least that SELinux policy goes upstream, plus there may still be bugs.
* launch: libvirt: Move free to end of function.Richard W.M. Jones2012-07-241-11/+6
| | | | This is just code motion.
* launch: libvirt: Add is_blk utility.Richard W.M. Jones2012-07-241-6/+12
| | | | This is just code motion.
* launch: libvirt: Set <emulator> in libvirt XML if g->qemu is not the default.Richard W.M. Jones2012-07-241-0/+9
|
* launch: Make get-pid and max-disks APIs into virtual methods of the current ↵Richard W.M. Jones2012-07-231-0/+14
| | | | attach-method.
* launch: libvirt: Use <driver name="qemu" type=[format] />.Richard W.M. Jones2012-07-231-3/+99
| | | | | | | | We were using format= which was bogus and libvirt was ignoring it and forcing raw format instead. Also in its default configuration libvirt won't do disk format autodetection at all, so we must do it instead.
* launch: libvirt: You can't set O_CLOEXEC flag using fcntl + F_SETFL.Richard W.M. Jones2012-07-231-1/+1
| | | | | | | And in any case there is no point, since proto.c already sets the SOCK_CLOEXEC flag (using accept4) on this socket. The code now matches the code in launch-appliance.c.
* launch: libvirt: Use accept4 to set socket flags correctly.Richard W.M. Jones2012-07-231-5/+1
|
* launch: libvirt: Add <on_reboot>destroy</on_reboot> to libvirt XML.Richard W.M. Jones2012-07-231-0/+17
| | | | | This causes libvirt to add the qemu -no-reboot option, which reflects existing behaviour.
* launch: libvirt: Move remaining to-do items to TODO file.Richard W.M. Jones2012-07-231-18/+0
|
* launch: libvirt: Add a hack to detect if KVM is available.Richard W.M. Jones2012-07-231-1/+5
| | | | | | | | We need to select the <domain type=...> attribute depending on whether KVM is detected in the libvirt capabilities. This is a hack because it doesn't try to parse the libvirt capabilities XML.
* launch: libvirt: Use <cpu model="host-model"/> (thanks Dan Berrange).Richard W.M. Jones2012-07-231-0/+6
| | | | | This ensures maximum performance of the appliance, particularly for things like MD where the guest needs to use optimal SSE instructions.
* launch: libvirt: Change disk XML according to whether host path is device or ↵Richard W.M. Jones2012-07-231-10/+39
| | | | file (thanks Dan Berrange).
* launch: libvirt: Use "guestfs-" prefix on random names (thanks Dan Berrange).Richard W.M. Jones2012-07-231-1/+1
|
* launch: libvirt: Enforce minimum version of libvirt 0.9.13.Richard W.M. Jones2012-07-231-0/+13
|
* launch: libvirt: Use snapshot=on instead of <readonly/>.Richard W.M. Jones2012-07-231-9/+33
| | | | | | | For compatibility with the appliance backend, devices added readonly are in fact added writable with snapshots on top. This is necessary because options like 'mount -o ro' usually require write access to the disk (eg. to replay journals).
* launch: Add libvirt backend.Richard W.M. Jones2012-07-221-0/+1052
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.