]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
kvm tools: Add read-only support for block devices
authorPekka Enberg <penberg@kernel.org>
Wed, 13 Apr 2011 19:56:02 +0000 (22:56 +0300)
committerPekka Enberg <penberg@kernel.org>
Sat, 16 Apr 2011 09:17:29 +0000 (12:17 +0300)
commit0578ad0a43554bfc06e908388b930d333a919a7c
treeb64b0a3ae01ebce6b7a0f7722127ae807f061566
parenta25db78c4e132a165cb19438b05b0ed82f8fcaa1
kvm tools: Add read-only support for block devices

Add support for booting guests to host block devices in read-only mode.

Quoting Ingo Molnar:

  Booting into the host's userspace works out of box now. The
  following disk-image-less command:

     ./kvm run ../../arch/x86/boot/bzImage --readonly --image=/dev/sda --params="root=/dev/vda1"

  has booted all the way into the host's Fedora Rawhide userspace:

     ===================================
     Welcome to Fedora release 16 (Rawhide)!

     [...]

     Fedora release 16 (Rawhide)
     Kernel 2.6.39-rc3-tip+ on an x86_64 (ttyS0)

     aldebaran login:
     ===================================

  I ran this as unprivileged user (who had read access to the partitions in
  question).

  This is a very useful feature for testing kernels - i can test any random Linux
  box's userspace via KVM, without having to copy an image there! :-)

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/disk-image.c