From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMrK2-0005Ue-0J for qemu-devel@nongnu.org; Sat, 05 Nov 2011 21:14:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMrK0-00024j-Ua for qemu-devel@nongnu.org; Sat, 05 Nov 2011 21:14:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56907 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMrK0-00024a-Hc for qemu-devel@nongnu.org; Sat, 05 Nov 2011 21:14:52 -0400 Message-ID: <4EB5DF80.5090809@suse.de> Date: Sun, 06 Nov 2011 02:14:40 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1320543320-32728-1-git-send-email-agraf@suse.de> In-Reply-To: <1320543320-32728-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] KVM: Add wrapper script around QEMU to test kernels List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Pekka Enberg , "kvm@vger.kernel.org list" , qemu-devel Developers , "linux-kernel@vger.kernel.org List" , Blue Swirl , Avi Kivity , =?ISO-8859-15?Q?Am=E9rico_Wang?= , Ingo Molnar , Linus Torvalds Am 06.11.2011 02:35, schrieb Alexander Graf: > On LinuxCon I had a nice chat with Linus on what he thinks kvm-tool > would be doing and what he expects from it. Basically he wants a > small and simple tool he and other developers can run to try out and > see if the kernel they just built actually works. >=20 > Fortunately, QEMU can do that today already! The only piece that was > missing was the "simple" piece of the equation, so here is a script > that wraps around QEMU and executes a kernel you just built. >=20 > If you do have KVM around and are not cross-compiling, it will use > KVM. But if you don't, you can still fall back to emulation mode and > at least check if your kernel still does what you expect. I only > implemented support for s390x and ppc there, but it's easily extensible > to more platforms, as QEMU can emulate (and virtualize) pretty much > any platform out there. >=20 > If you don't have qemu installed, please do so before using this script= . Your > distro should provide a package for it (might even call it "kvm"). If n= ot, > just compile it from source - it's not hard! >=20 > To quickly get going, just execute the following as user: >=20 > $ ./Documentation/run-qemu.sh -r / -a init=3D/bin/bash Path needs updating. >=20 > This will drop you into a shell on your rootfs. >=20 > Happy hacking! >=20 > Signed-off-by: Alexander Graf >=20 > --- > diff --git a/tools/testing/run-qemu/run-qemu.sh b/tools/testing/run-qem= u/run-qemu.sh > new file mode 100755 > index 0000000..70f194f > --- /dev/null > +++ b/tools/testing/run-qemu/run-qemu.sh > +# Try to find the KVM accelerated QEMU binary > + > +[ "$ARCH" ] || ARCH=3D$(uname -m) > +case $ARCH in > +x86_64) > + KERNEL_BIN=3Darch/x86/boot/bzImage > + # SUSE and Red Hat call the binary qemu-kvm > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which qemu-kvm 2>/dev/null) > + > + # Debian and Gentoo call it kvm > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which kvm 2>/dev/null) > + > + # QEMU's own build system calls it qemu-system-x86_64 > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which qemu-system-x86_64 2>/dev/null) > + ;; > +i*86) > + KERNEL_BIN=3Darch/x86/boot/bzImage > + # SUSE and Red Hat call the binary qemu-kvm > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which qemu-kvm 2>/dev/null) > + > + # Debian and Gentoo call it kvm > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which kvm 2>/dev/null) > + > + KERNEL_BIN=3Darch/x86/boot/bzImage Copy&paste? > + # i386 version of QEMU QEMU's own build system calls it qemu-system-i386 now. :) > + [ "$QEMU_BIN" ] || QEMU_BIN=3D$(which qemu 2>/dev/null) We should first test for qemu-system-i386, then fall back to old qemu. Andreas P.S. You're still ahead of time... --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg