[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EB5DF80.5090809@suse.de>
Date: Sun, 06 Nov 2011 02:14:40 +0100
From: Andreas Färber <afaerber@...e.de>
To: Alexander Graf <agraf@...e.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Blue Swirl <blauwirbel@...il.com>,
"kvm@...r.kernel.org list" <kvm@...r.kernel.org>,
qemu-devel Developers <qemu-devel@...gnu.org>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
Pekka Enberg <penberg@...nel.org>, Avi Kivity <avi@...hat.com>,
Américo Wang <xiyou.wangcong@...il.com>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: [Qemu-devel] [PATCH] KVM: Add wrapper script around QEMU to test
kernels
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.
>
> 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.
>
> 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.
>
> 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 not,
> just compile it from source - it's not hard!
>
> To quickly get going, just execute the following as user:
>
> $ ./Documentation/run-qemu.sh -r / -a init=/bin/bash
Path needs updating.
>
> This will drop you into a shell on your rootfs.
>
> Happy hacking!
>
> Signed-off-by: Alexander Graf <agraf@...e.de>
>
> ---
> diff --git a/tools/testing/run-qemu/run-qemu.sh b/tools/testing/run-qemu/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=$(uname -m)
> +case $ARCH in
> +x86_64)
> + KERNEL_BIN=arch/x86/boot/bzImage
> + # SUSE and Red Hat call the binary qemu-kvm
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(which qemu-kvm 2>/dev/null)
> +
> + # Debian and Gentoo call it kvm
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(which kvm 2>/dev/null)
> +
> + # QEMU's own build system calls it qemu-system-x86_64
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(which qemu-system-x86_64 2>/dev/null)
> + ;;
> +i*86)
> + KERNEL_BIN=arch/x86/boot/bzImage
> + # SUSE and Red Hat call the binary qemu-kvm
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(which qemu-kvm 2>/dev/null)
> +
> + # Debian and Gentoo call it kvm
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(which kvm 2>/dev/null)
> +
> + KERNEL_BIN=arch/x86/boot/bzImage
Copy&paste?
> + # i386 version of QEMU
QEMU's own build system calls it qemu-system-i386 now. :)
> + [ "$QEMU_BIN" ] || QEMU_BIN=$(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...
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists