From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvanQ-0008Ri-30 for qemu-devel@nongnu.org; Mon, 22 Aug 2011 16:08:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvanO-0007Q8-Cj for qemu-devel@nongnu.org; Mon, 22 Aug 2011 16:08:32 -0400 Received: from mout.perfora.net ([74.208.4.195]:55287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvanO-0007LG-22 for qemu-devel@nongnu.org; Mon, 22 Aug 2011 16:08:30 -0400 From: Michael Roth Date: Mon, 22 Aug 2011 12:09:15 -0500 Message-Id: <1314032960-23474-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC] QEMU Guest Tools ISO Follow-up List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com These patches apply on top of master (8-22), and can also be obtained from: git://repo.or.cz/qemu/mdroth.git guest-tools-iso-v1 This is a follow-up to the previous discussion regarding deployment QEMU/KVM guest dependencies via a distributable ISO: http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg02239.html At the time a cross-platform byte-compiled python install framework was being explored, but since qemu-ga will likely be the only user for a while I wanted to focus on putting together a dead simple framework for linux guests and going from there. This current framework works as follows: Adding a tool: 1) A tool intended for guest deployment adds distribution files (init/config scripts, etc) to qemu.git/guest-tools-iso/projects/ 2) A linux executable/script, preferably a simple shell script to ensure the guest can run it, is placed in that same directory to handle all the install logic. 3) The logic to build the required binaries for that tool/project is added to qemu.git/scripts/build-guest-iso.sh Generating an ISO/tarball: 1) qemu.git/scripts/build-guest-iso.sh is invoked: scripts/build-guest-iso.sh 2) guest-tools-iso/ gets copied to $tmp/qemu-guest-tools-$VERSION 3) The ISO-generation logic for each project (in build-guest-iso.sh) will build/copy binaries and dynamically-generated files to $tmp/projects/ 4) An ISO and tarball of the contents of $tmp/qemu-guest-tools-$VERSION are then created and placed in the current directory. libvirt/virsh/hmp/qmp users would install the tools by mounting the ISO and running the installer for their platform. Ideally, this would be done via a new interface that does intelligent things: for instance, automatically locating the appropriate ISO in the host, or checking if the guest agent is already installed and kicking off the installer automatically after mounting (and if not, passing back some indication that something like virt-manager can use to guide the user to the next steps). For users of GUI-based management tools like virt-manager, this would all manifest in a simple, tooltip-guided "Install Guest Additions" button, as with virtualbox/VMWare. TODO/KNOWN ISSUES: - qemu-ga has a single notable dependency, glib, which makes it easy to build a single executable 32-bit and 64-bit executable that runs on multiple distros. Even so, we have issues with glibc that require an older host, like RHEL5, or a cross-build environment, to build. With other projects this mismatches will be more pronounced. To take some of the subtleties out of the equation, it would be ideal to tie this ISO generation command into Makefile and do some logic during configuration to gather up all these variables and determine whether or not we can generate the ISO and what's needed to build it. So far the known requirements are glibc <= 2.5 and glib >= 2.0. A user could then attempt to resolve these dependencies by building on a different host, or putting together a cross-build environment that meets these dependencies. Similar handling would be needed for MinGW-based builds when support for windows guest tools are added. - Support for interactive/graphical installs would be nice. For now we're command-line only. - Currently every tool's installer script needs to do stuff to figure out what arch/distro/platform it's on. Ideally this would all be done via the installer harness, which would then pass the information to individual installers as environment variables or parameters. Any comments on the approach/code are welcome. guest-tools-iso/install.linux | 7 ++ .../projects/qemu-ga/debian/qemu-ga.init | 112 ++++++++++++++++++++ .../projects/qemu-ga/debian/qemu-ga.sysconfig | 14 +++ guest-tools-iso/projects/qemu-ga/install.linux | 61 +++++++++++ .../projects/qemu-ga/redhat/qemu-ga.init | 97 +++++++++++++++++ .../projects/qemu-ga/redhat/qemu-ga.sysconfig | 14 +++ scripts/build-guest-iso.sh | 46 ++++++++ 7 files changed, 351 insertions(+), 0 deletions(-)