Go to file
Eric Blake d51023d4c2 qemu: fix restoring a compressed save image
Latent bug introduced in commit 2d6a581960 (Aug 2009), but not exposed
until commit 1859939a (Jan 2011).  Basically, when virExec creates a
pipe, it always marks libvirt's side as cloexec.  If libvirt then
wants to hand that pipe to another child process, things work great if
the fd is dup2()'d onto stdin or stdout (as with stdin: or exec:
migration), but if the pipe is instead used as-is (such as with fd:
migration) then qemu sees EBADF because the fd was closed at exec().

This is a minimal fix for the problem at hand; it is slightly racy,
but no more racy than the rest of libvirt fd handling, including the
case of uncompressed save images.  A more invasive fix, but ultimately
safer at avoiding leaking unintended fds, would be to _always and
atomically_ open all fds as cloexec in libvirt (thanks to primitives
like open(O_CLOEXEC), pipe2(), accept4(), ...), then teach virExec to
clear that bit for all fds explicitly marked to be handed to the child
only after forking.

* src/qemu/qemu_command.c (qemuBuildCommandLine): Clear cloexec
flag.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Tweak test.
2011-03-28 10:26:32 -06:00
.gnulib@422ab2e0d7 build: nuke all .x-sc* files, and fix VPATH syntax-check 2011-03-23 15:51:32 -06:00
daemon Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
docs docs: document recent hook additions 2011-03-28 09:51:04 -06:00
examples maint: kill all remaining uses of old DEBUG macro 2011-02-21 08:46:52 -07:00
include Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
m4 maint: update to latest gnulib 2010-11-17 10:13:12 -07:00
po Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
python python: Use hardcoded python path in libvirt.py 2011-03-14 12:37:19 +01:00
src qemu: fix restoring a compressed save image 2011-03-28 10:26:32 -06:00
tests qemu: fix restoring a compressed save image 2011-03-28 10:26:32 -06:00
tools Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
.dir-locals.el maint: make spacing in .sh files easier 2011-03-14 21:57:42 -06:00
.gitignore Add vim configuration that makes vim auto-indent code 2011-03-17 17:08:51 -06:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap maint: update an email address preference 2010-08-10 08:13:22 -06:00
AUTHORS maint: update authors 2011-03-22 08:33:22 -06:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
ChangeLog-old generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
HACKING Add vim configuration that makes vim auto-indent code 2011-03-17 17:08:51 -06:00
Makefile.am build: nuke all .x-sc* files, and fix VPATH syntax-check 2011-03-23 15:51:32 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking maint: relax git minimum version 2010-02-24 14:29:27 -05:00
TODO Update todo list file to point at bugzilla/website 2010-10-13 16:45:26 +01:00
acinclude.m4 maint: turn on gcc logical-op checking 2010-07-28 15:25:36 +02:00
autobuild.sh Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
autogen.sh build: avoid problems with autogen.sh runs from tarball 2011-02-12 06:28:28 -07:00
bootstrap build: nuke all .x-sc* files, and fix VPATH syntax-check 2011-03-23 15:51:32 -06:00
bootstrap.conf build: nuke all .x-sc* files, and fix VPATH syntax-check 2011-03-23 15:51:32 -06:00
cfg.mk maint: prohibit access(,X_OK) 2011-03-24 15:18:44 -06:00
configure.ac Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
libvirt.pc.in * libvirt.pc.in: applied patch from Daniel Berrange to fix --cflags 2006-03-24 13:18:12 +00:00
libvirt.spec.in Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
mingw32-libvirt.spec.in Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00

README

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>