]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agokvm tools: NULL-terminate init env
Pekka Enberg [Thu, 29 Sep 2011 14:31:16 +0000 (17:31 +0300)]
kvm tools: NULL-terminate init env

This patch fixes 'kvm run' rootfs boot failures:

  Starting '/bin/sh'...
  Init failed: Bad address

Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Support multiple net devices
Sasha Levin [Wed, 28 Sep 2011 05:45:55 +0000 (08:45 +0300)]
kvm tools: Support multiple net devices

This patch adds support for multiple network devices. The command line syntax
changes to the following:

--network/-n [mode=tap/user/none][,guest_ip=ip][,host_ip=
ip][,guest_mac=mac][,script=file]

Each of the parameters is optional, and the config defaults to a TAP based
networking with a sequential MAC.

Acked-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix up build instructions on Fedora
Pekka Enberg [Tue, 27 Sep 2011 14:12:47 +0000 (17:12 +0300)]
kvm tools: Fix up build instructions on Fedora

Fix up build instructions so that people can build the tool on fresh
installation of Fedora.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Set active console before running /bin/sh
Sasha Levin [Tue, 27 Sep 2011 13:03:47 +0000 (16:03 +0300)]
kvm tools: Set active console before running /bin/sh

This patch sets active console to the serial console before running the
shell. Doing so fixes two issues:

* Fix job control.

* Set all env vars.

The user visible issues are less warnings (no more of this:
  sh: cannot set terminal process group (-1): Inappropriate ioctl for device
  sh: no job control in this shell)

A working 'top', and a working ctrl-c.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools, ui: Add some missing key codes
Alessandro Guido [Mon, 26 Sep 2011 11:12:12 +0000 (13:12 +0200)]
kvm tools, ui: Add some missing key codes

Add some missing keys to the SDL ui. This needed a bit of rework of
keyboard event handling since some of the new codes are multi-byte,
so I had to introduce a struct that keeps that information alongside
the code itself. Peculiar cases like PAUSE or PRNT SCRN are special
cased, however they aren't wired yet since I couldn't test them (I think
input grabbing is required to make them work).

Acked-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Alessandro Guido <ag@alessandroguido.name>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: don't use custom strtoul for hex numbers
Andy Shevchenko [Fri, 23 Sep 2011 14:53:44 +0000 (17:53 +0300)]
kvm tools: don't use custom strtoul for hex numbers

Cc: kvm@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Clear presence of performance-energy bias bit
Cyrill Gorcunov [Sun, 18 Sep 2011 07:33:33 +0000 (11:33 +0400)]
kvm tools: Clear presence of performance-energy bias bit

In case if host machine supports performance-energy bias
capability it should not be propagated to KVM hypervisor.

Otherwise the kernel tries to do read MSR_IA32_ENERGY_PERF_BIAS
register and cause kernel panic (general protection fault).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Document steps to debug kernel using KGDB
Sasha Levin [Mon, 19 Sep 2011 11:05:56 +0000 (14:05 +0300)]
kvm tools: Document steps to debug kernel using KGDB

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Fix INTx handling
Sasha Levin [Mon, 19 Sep 2011 10:40:45 +0000 (13:40 +0300)]
kvm tools: Fix INTx handling

Since we didn't raise the ISR INTx interrupts were sometimes ignored by
the guest. This caused hangs on boot when starting a guest without MSIX
support.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Use correct subsys id in virtio-pci
Sasha Levin [Sun, 18 Sep 2011 18:25:51 +0000 (21:25 +0300)]
kvm tools: Use correct subsys id in virtio-pci

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Use host's resolv.conf within the guest
Sasha Levin [Wed, 14 Sep 2011 16:28:26 +0000 (19:28 +0300)]
kvm tools: Use host's resolv.conf within the guest

Since kernel IP autoconfiguration doesn't set up /etc/resolv.conf, we'll
use the one located within the host, since this was anyway what we simulated
within the DHCP offer packets.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Don't copy network autoconfiguration script
Sasha Levin [Wed, 14 Sep 2011 16:28:25 +0000 (19:28 +0300)]
kvm tools: Don't copy network autoconfiguration script

Network autoconfiguration was moved to the kernel, but the setup code still
tried to copy the script over to the rootfs. This prevented from /virt/ to
be properly created.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Allow remapping guest TTY into host PTS
Sasha Levin [Fri, 16 Sep 2011 08:49:13 +0000 (11:49 +0300)]
kvm tools: Allow remapping guest TTY into host PTS

This patch adds the '-tty' option to 'kvm run' which allows the user to
remap a guest TTY into a PTS on the host.

Usage:
        'kvm run --tty [id]'

The tty will be mapped to a pts and will be printed on the screen:
        '  Info: Assigned terminal 1 to pty /dev/pts/X'

At this point, it is possible to communicate with the guest using that pty.

This is useful for debugging guest kernel using KGDB:

1. Run the guest:
        'kvm run -k [vmlinuz] -p "kgdboc=ttyS1 kgdbwait" --tty 1'

And see which PTY got assigned to ttyS1.

2. Run GDB on the host:
        'gdb [vmlinuz]'

3. Connect to the guest (from within GDB):
        'target remote /dev/pty/X'

4. Start debugging! (enter 'continue' to continue boot).

Cc: David Evensky <evensky@dancer.ca.sandia.gov>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
13 years agokvm tools: Don't use i8042 AUX port
Sasha Levin [Wed, 14 Sep 2011 07:24:53 +0000 (10:24 +0300)]
kvm tools: Don't use i8042 AUX port

We are enabling i8042 even without VNC or SDL so that we could use it's
reset method to reboot the guest.

AUX port might cause delays during boot. Disable it if the user didn't ask
for VNC or SDL.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Use kernel dhcp for network autoconfiguration
Sasha Levin [Wed, 14 Sep 2011 07:11:09 +0000 (10:11 +0300)]
kvm tools: Use kernel dhcp for network autoconfiguration

This patch removes the manual/usermode dhcp client configuration and instead
uses the DHCP client built within the kernel.

Since this client is tightly integrated with NFS (if NFS config is set), we
will add a specific NFS root addr in our DHCP offer to point it to a non
existent address so that we won't hang trying to poke it for our root.

Acked-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix 32bit build errors
Sasha Levin [Wed, 14 Sep 2011 08:17:27 +0000 (11:17 +0300)]
kvm tools: Fix 32bit build errors

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: remove addr_type - unused but set variable
Hagen Paul Pfeifer [Wed, 7 Sep 2011 18:48:37 +0000 (20:48 +0200)]
kvm tools: remove addr_type - unused but set variable

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix compat message formatting
Sasha Levin [Mon, 12 Sep 2011 17:25:29 +0000 (20:25 +0300)]
kvm tools: Fix compat message formatting

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Modify 'kvm run' to use virt fs
Sasha Levin [Mon, 12 Sep 2011 17:25:28 +0000 (20:25 +0300)]
kvm tools: Modify 'kvm run' to use virt fs

'kvm run' will now create a 'default' profile and boot into it.

Currently we boot into rw rootfs of the host, which is risky. Instead,
we can boot in a 'safe' enviroment with networking.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guestfs network autoconfiguration
Sasha Levin [Mon, 5 Sep 2011 23:23:55 +0000 (02:23 +0300)]
kvm tools: Add guestfs network autoconfiguration

Add a script to automatically configure networking in the guest.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Teach 'run' to handle guestfs
Sasha Levin [Mon, 5 Sep 2011 23:23:54 +0000 (02:23 +0300)]
kvm tools: Teach 'run' to handle guestfs

This patch allows to run previously created guestfs by simply specifying it
with the '-d' parameter.

This allows running guestfs which were created before using:

kvm setup -n [name]

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Attach default 'root=' only if required
Sasha Levin [Mon, 5 Sep 2011 23:23:53 +0000 (02:23 +0300)]
kvm tools: Attach default 'root=' only if required

This patch fixes a case where the 'root=' parameter was passed twice
when using virtio-9p root mode.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix 32bit warnings
Sasha Levin [Mon, 5 Sep 2011 23:23:52 +0000 (02:23 +0300)]
kvm tools: Fix 32bit warnings

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Remove unconditional warning in ivshmem
Sasha Levin [Mon, 5 Sep 2011 23:23:51 +0000 (02:23 +0300)]
kvm tools: Remove unconditional warning in ivshmem

This patch prevents printing a warning if ivshmem device wasn't requested.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add ivshmem device
Sasha Levin [Mon, 29 Aug 2011 12:25:00 +0000 (15:25 +0300)]
kvm tools: Add ivshmem device

The patch adds an ivshmem device which can be used to share memory between
guests on the same host.

This implementation is lacking inter-guest communication which should be
implemented later once information regarding the client-server protocol is
gathered, though infrastructure used to add and remove clients already exists
in the patch (but isn't used anywhere).

Patch is based on David Evansky's shmem device.

Original-patch-by: David Evensky <evensky@sandia.gov>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, setup: Create private directory
Hagen Paul Pfeifer [Wed, 24 Aug 2011 22:26:23 +0000 (00:26 +0200)]
kvm tools, setup: Create private directory

If ~/.kvm-tools is not already created all successive mkdir calls will fail.
Fix this by create the directory explicitly.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, setup: Create /tmp in guest filesystems
Pekka Enberg [Wed, 24 Aug 2011 15:25:04 +0000 (18:25 +0300)]
kvm tools, setup: Create /tmp in guest filesystems

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Introduce 'kvm setup' command
Pekka Enberg [Wed, 24 Aug 2011 13:23:38 +0000 (16:23 +0300)]
kvm tools: Introduce 'kvm setup' command

This patch implements 'kvm setup' command that can be used to setup a guest
filesystem that shares system libraries and binaries from host filesystem in
read-only mode.

You can setup a new shared rootfs guest with:

  ./kvm setup -n default

and launch it with:

  ./kvm run --9p /,hostfs -p "init=virt/init" -d ~/.kvm-tools/default/

We want to teach 'kvm run' to be able to launch guest filesystems by name in
the future. Furthermore, 'kvm run' should setup a 'default' filesystem and use
it by default unless the user specifies otherwise.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: MSI-X fixes
Sasha Levin [Tue, 23 Aug 2011 19:28:53 +0000 (22:28 +0300)]
kvm tools: MSI-X fixes

Several fixes in this patch:

* Don't ignore function level and per-vector masking. We're not
supposed to signal when masked and not doing so will improve
performance a bit (in addition to behaving correctly).

* Implement the missing PBA array. 'lspci -vv' will now show the correct
output:
Capabilities: [40] MSI-X: Enable+ Count=5 Masked-
Vector table: BAR=1 offset=00000000
PBA: BAR=3 offset=00000000

* Checking whether MSI-X is enabled or not is done by probing the
corresponding bit within the PCI header instead of trying to track
the status ourselves.

* Fallback to INTx if MSI-X isn't enabled.

* Use correct max size for MSI-X table.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add entry to MAINTAINERS file
Pekka Enberg [Wed, 24 Aug 2011 14:51:08 +0000 (17:51 +0300)]
kvm tools: Add entry to MAINTAINERS file

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate pci layer out of virtio-console
Sasha Levin [Wed, 24 Aug 2011 09:09:10 +0000 (12:09 +0300)]
kvm tools: Separate pci layer out of virtio-console

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Move ioeventfd registration to virtio-pci
Sasha Levin [Wed, 24 Aug 2011 09:09:09 +0000 (12:09 +0300)]
kvm tools: Move ioeventfd registration to virtio-pci

This patch removed ioeventfd registration from devices and moves it
to a single place in virtio-pci layer.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, 9p: Fix walk to prepare correct path name
Aneesh Kumar K.V [Mon, 22 Aug 2011 09:35:34 +0000 (15:05 +0530)]
kvm tools, 9p: Fix walk to prepare correct path name

Fix walk operation with multiple names.

Acked-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, 9p: Implement 9p2000.L extensions
Aneesh Kumar K.V [Mon, 22 Aug 2011 09:35:33 +0000 (15:05 +0530)]
kvm tools, 9p: Implement 9p2000.L extensions

This patch implement dotl protocol for the server. 9p2000.L enables better
interop with Linux client and offers larger set of features.

Acked-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer out of virtio-blk
Sasha Levin [Mon, 22 Aug 2011 12:58:18 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer out of virtio-blk

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer out of virtio-9p
Sasha Levin [Mon, 22 Aug 2011 12:58:17 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer out of virtio-9p

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer out of virtio-balloon
Sasha Levin [Mon, 22 Aug 2011 12:58:16 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer out of virtio-balloon

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer out of virtio-net
Sasha Levin [Mon, 22 Aug 2011 12:58:15 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer out of virtio-net

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer out of virtio-rng
Sasha Levin [Mon, 22 Aug 2011 12:58:14 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer out of virtio-rng

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate virtio-pci layer
Sasha Levin [Mon, 22 Aug 2011 12:58:13 +0000 (15:58 +0300)]
kvm tools: Separate virtio-pci layer

This patch builds a virtio-pci layer which can be used by virtio
devices as a layer to interact with virtio-pci. The purpose of the
patch is to separate the common virtio-pci layer from being replicated
in all virtio devices.

The new layer provides a callback interface to receive information about
virtio events.

This allows us to share the entire functionality of virtio-pci throughout all
virtio devices, for example - we don't need to implement MSI-X for each device
and can just do it once for virtio-pci.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix offset calculation for config space and MSI-X
Sasha Levin [Sun, 21 Aug 2011 10:16:35 +0000 (13:16 +0300)]
kvm tools: Fix offset calculation for config space and MSI-X

This patch makes offsets for virtio config space and MSI-X dynamic.

The change should fix the wrong usage of MSI-X space as virtio
config space.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add helper to retrieve the field used in virtio config space
Sasha Levin [Sun, 21 Aug 2011 10:16:34 +0000 (13:16 +0300)]
kvm tools: Add helper to retrieve the field used in virtio config space

This patch adds a helper used to retrieve the type of field used when guest
is writing or reading from virtio config space.

Since the config space is dynamic, it may change during runtime - so we must
calculate it before every read/write.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-balloon
Sasha Levin [Thu, 18 Aug 2011 12:18:37 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-balloon

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-console
Sasha Levin [Thu, 18 Aug 2011 12:18:36 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-console

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-net
Sasha Levin [Thu, 18 Aug 2011 12:18:35 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-net

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-9p
Sasha Levin [Thu, 18 Aug 2011 12:18:34 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-9p

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-blk
Sasha Levin [Thu, 18 Aug 2011 12:18:33 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-blk

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add guest compatability warning to virtio-rng
Sasha Levin [Thu, 18 Aug 2011 12:18:32 +0000 (15:18 +0300)]
kvm tools: Add guest compatability warning to virtio-rng

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Guest kernel compatability
Sasha Levin [Thu, 18 Aug 2011 12:18:31 +0000 (15:18 +0300)]
kvm tools: Guest kernel compatability

The problem of users running kernel which wasn't built for kvm tools is
somewhat common. Usualy the result is a panic during boot and a user whos'
stuck and doesn't know what to do next.

Compatability checks try to solve this issue by giving the user a meaningfull
error message which can explain whats going on and how he can fix it.

The idea is to register the device during device init and unregister the
device when the device has been 'used'. In case the kernel didn't access
the device before the guest is shut down, the host will notify the user that
something is wrong.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: change option type of RNG from increment to boolean
Liming Wang [Wed, 17 Aug 2011 09:44:54 +0000 (17:44 +0800)]
kvm tools: change option type of RNG from increment to boolean

Becasue virtio random generator is a single device, change its option
type to boolean.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: fix wrong virtio id for balloon
Liming Wang [Wed, 17 Aug 2011 09:44:53 +0000 (17:44 +0800)]
kvm tools: fix wrong virtio id for balloon

Replace the wrong rng virtio id with the correct balloon id.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: remove count in io emulation callbacks
Xiao Guangrong [Thu, 18 Aug 2011 03:07:25 +0000 (11:07 +0800)]
kvm tools: remove count in io emulation callbacks

'count' parameter in io emulation callbacks is useless, just remove it

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: fix repeated io emulation
Xiao Guangrong [Thu, 18 Aug 2011 03:06:54 +0000 (11:06 +0800)]
kvm tools: fix repeated io emulation

When kvm emulates repeation io read instruction, it can exit to user-space with
'count' > 1, we need to emulate io access for many times

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Use correct data type for pid
Sasha Levin [Mon, 15 Aug 2011 14:33:00 +0000 (17:33 +0300)]
kvm tools: Use correct data type for pid

This patch fixes an error where pids used u64 instead of pid_t, causing them
to never be negative.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add 'kvm stat' command
Sasha Levin [Mon, 15 Aug 2011 14:32:59 +0000 (17:32 +0300)]
kvm tools: Add 'kvm stat' command

This patch adds 'kvm stat' command that allows retrieving statistics out of
a running guest.

Currently the only supported statistics are memory statistics, available using the
'--memory' parameter.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix wrong kill() PID in commands
Sasha Levin [Sat, 13 Aug 2011 10:22:13 +0000 (13:22 +0300)]
kvm tools: Fix wrong kill() PID in commands

There was a mixup in the balloon usage string and some of the commands were
retrieving the instance name from the wrong place. This will cause the commands
to issue kill() with negative PIDs (which sends the signal to every process in
the system). Without this patch, 'kvm command instance' will do crazy things
like restart whole Gnome session.

Tested-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tool, sdl: Set window caption
Pekka Enberg [Sat, 13 Aug 2011 09:38:13 +0000 (12:38 +0300)]
kvm tool, sdl: Set window caption

Fix empty window caption for the tool. We should also display the guest name
but unfortunately the SDL code doesn't know about "struct kvm" so that requires
code reorganization.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoMerge branch 'kvm/bios' into kvm/core
Pekka Enberg [Fri, 12 Aug 2011 15:30:40 +0000 (18:30 +0300)]
Merge branch 'kvm/bios' into kvm/core

13 years agokvm tools: Improve 'kvm balloon' parameters
Sasha Levin [Fri, 12 Aug 2011 15:21:00 +0000 (18:21 +0300)]
kvm tools: Improve 'kvm balloon' parameters

kvm balloon now uses the git option parser to parse parameters.

Added option to balloon instance by PID.

Improved usage message.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: unify all serials' registers with the first serial
Liming Wang [Fri, 12 Aug 2011 14:59:29 +0000 (22:59 +0800)]
kvm tools: unify all serials' registers with the first serial

To make all serials work well, unify value of the last three
serials' registers with the first serial. Otherwise, using ttyS1,
ttyS2, ttyS3 as console will slow the output.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm debug' parameters
Sasha Levin [Fri, 12 Aug 2011 15:20:59 +0000 (18:20 +0300)]
kvm tools: Improve 'kvm debug' parameters

kvm debug now uses the git option parser to parse parameters.

Added option to debug instance by PID and debug all instances.

Improved usage message.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm pause' parameters
Sasha Levin [Fri, 12 Aug 2011 15:20:58 +0000 (18:20 +0300)]
kvm tools: Improve 'kvm pause' parameters

kvm pause now uses the git option parser to parse parameters.

Added option to pause instance by PID and pause all instances.

Improved usage message.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm resume' parameters
Sasha Levin [Fri, 12 Aug 2011 15:20:57 +0000 (18:20 +0300)]
kvm tools: Improve 'kvm resume' parameters

kvm resume now uses the git option parser to parse parameters.

Added option to resume instance by PID and resume all instances.

Improved usage message.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm stop' parameters
Sasha Levin [Fri, 12 Aug 2011 15:20:56 +0000 (18:20 +0300)]
kvm tools: Improve 'kvm stop' parameters

kvm stop now uses the git option parser to parse parameters.

Added option to stop instance by PID and stop all instances.

Improved usage message.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Connect existing command helpers to 'kvm help'
Sasha Levin [Fri, 12 Aug 2011 15:20:55 +0000 (18:20 +0300)]
kvm tools: Connect existing command helpers to 'kvm help'

This patch connects usage helpers to 'kvm help' callbacks, allowing
to see help about a command by doing 'kvm help [command]'.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Print version when running 'kvm --version'
Sasha Levin [Fri, 12 Aug 2011 15:20:54 +0000 (18:20 +0300)]
kvm tools: Print version when running 'kvm --version'

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Rename bios.S to entry.S
Pekka Enberg [Fri, 12 Aug 2011 11:23:06 +0000 (14:23 +0300)]
kvm tools, bios: Rename bios.S to entry.S

This patch renames bios.S to entry.S to make it more obvious what the file
contains. There's already too much source files with the word "bios" in their
names.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Set CF for non-supported services
Pekka Enberg [Fri, 12 Aug 2011 11:00:06 +0000 (14:00 +0300)]
kvm tools, bios: Set CF for non-supported services

Don't mislead callers into thinking that a non-implemented int15 service
succeeded.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Convert int15 code to C
Pekka Enberg [Fri, 12 Aug 2011 10:55:45 +0000 (13:55 +0300)]
kvm tools, bios: Convert int15 code to C

This patch convert the int15 interrupt handler code into C.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Move CF clearing to e820_query_map()
Pekka Enberg [Fri, 12 Aug 2011 10:51:16 +0000 (13:51 +0300)]
kvm tools, bios: Move CF clearing to e820_query_map()

In preparation for converting the int15 handler into C, move CF clearing to
e820_query_map().

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Use struct biosregs in E820 code
Pekka Enberg [Fri, 12 Aug 2011 10:45:28 +0000 (13:45 +0300)]
kvm tools, bios: Use struct biosregs in E820 code

This patch converts the E820 code to use 'struct biosregs' and
{SAVE,RESTORE}_BIOSREGS macros.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Add EIP and EFLAGS to 'struct biosregs'
Pekka Enberg [Fri, 12 Aug 2011 10:14:07 +0000 (13:14 +0300)]
kvm tools, bios: Add EIP and EFLAGS to 'struct biosregs'

This patch adds EIP and EFLAGS to 'struct biosregs' in preparation for
converting int15 handler into C code.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Add macros for BIOS registers
Pekka Enberg [Fri, 12 Aug 2011 10:09:37 +0000 (13:09 +0300)]
kvm tools, bios: Add macros for BIOS registers

This patch adds SAVE_BIOSREGS and RESTORE_BIOSREGS macros in preparation for
using struct biosregs in E820 code.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Rename struct int10_args to struct biosregs
Pekka Enberg [Fri, 12 Aug 2011 10:04:52 +0000 (13:04 +0300)]
kvm tools, bios: Rename struct int10_args to struct biosregs

This patch renames struct int10_args to struct biosregs in preparation for
unifying interrupt handler code.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Setup CF after returning from interrupt handler
Pekka Enberg [Fri, 12 Aug 2011 07:51:17 +0000 (10:51 +0300)]
kvm tools, bios: Setup CF after returning from interrupt handler

While reading the code, I noticed that we don't set CF in our interrupt handler
stubs. The guest kernel may think the interrupt handler succeeded depending on
whether or not it has set CF by itself (or whether BIOS code set it by chance).

While at it, fix INT 10h handler to clear CF to make sure the guest kernel
knows the interrupt handler succeeded.

Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Missing braces in BAR index calculation
Sasha Levin [Fri, 12 Aug 2011 07:37:23 +0000 (10:37 +0300)]
kvm tools: Missing braces in BAR index calculation

This patch adds missing braces which were forgotten in 42dfae5
("kvm tools: Use correct size for VESA memory bar").

Reported-by: David Evensky <evensky@dancer.ca.sandia.gov>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Use correct offset for virtio-net config space
Sasha Levin [Thu, 11 Aug 2011 20:41:51 +0000 (23:41 +0300)]
kvm tools: Use correct offset for virtio-net config space

This patch fixes the read action of virtio-net config by not
handling reads to the start of the space as MSI related
operations.

This fixes the MAC configuration of the device and makes uip network
work again.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Speed up PS/2 mouse detection
Sasha Levin [Thu, 11 Aug 2011 20:41:50 +0000 (23:41 +0300)]
kvm tools: Speed up PS/2 mouse detection

This patch speeds up PS/2 mouse detection by switching to the
fastest probing method compatible with kvm tools i8042 emulation.

The result is detection taking < 0.5 sec instead of >5 sec.

Tested-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Organize includes in builtin-run.c
Pekka Enberg [Thu, 11 Aug 2011 15:15:18 +0000 (18:15 +0300)]
kvm tools: Organize includes in builtin-run.c

This patch organizes the includes in builtin-run.c so that KVM tool local
headers are included first, then Linux kernel headers, and finally system
headers.

This helps in keeping headers dependencies in check so that they can be
included by themselves.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix IRQ mapping
Sasha Levin [Thu, 11 Aug 2011 09:04:07 +0000 (12:04 +0300)]
kvm tools: Fix IRQ mapping

This thread fixes two issues:
 - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong
to it to be ignored (breaking such things as the mouse).
 - Line 2 was being mapped, since it's the link between slave and master
IRQCHIPs it shouldn't be.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Make keyboard termination go through regular termination path
Sasha Levin [Thu, 11 Aug 2011 12:43:54 +0000 (15:43 +0300)]
kvm tools: Make keyboard termination go through regular termination path

Instead of exiting directly when a user enters 'ctrl x + a', go through
the regular termination path by stopping all VCPUs and letting the
main thread handle it.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add MSI-X support to virtio-net
Sasha Levin [Thu, 11 Aug 2011 12:43:56 +0000 (15:43 +0300)]
kvm tools: Add MSI-X support to virtio-net

The device uses the virtio preferred method of working with MSI-X by
creating one vector for configuration and one vector for each vq in the
device.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Add kvm__trigger_irq()
Sasha Levin [Thu, 11 Aug 2011 12:43:55 +0000 (15:43 +0300)]
kvm tools: Add kvm__trigger_irq()

Add a helper function to trigger an IRQ.

This function is usefull when an IRQ line has to be raised and lowered
such as when using MSI-X.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: check negative value of num_pages
Liming Wang [Thu, 11 Aug 2011 07:21:59 +0000 (15:21 +0800)]
kvm tools: check negative value of num_pages

If num_pages is negative, balloon will make kernel crash with
"out of memory". So we check this value to avoid it to be negative.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
[ penberg@kernel.org: cleanups ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Use correct size for VESA memory bar
Sasha Levin [Thu, 11 Aug 2011 11:56:51 +0000 (14:56 +0300)]
kvm tools: Use correct size for VESA memory bar

This patch makes BAR 1 16k, instead of BAR0 - which is the PIO bar.

This fixes wrong output on lspci command and ioremap warnings during boot.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: enable keyboard press repeat for sdl
Liming Wang [Thu, 11 Aug 2011 05:07:47 +0000 (13:07 +0800)]
kvm tools: enable keyboard press repeat for sdl

Set keyboard repeat rate to enable keyboard press repeat.

It means that don't repeat the key value every 50 milliseconds
until 200 milliseconds later when the key is pressed.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: ignore balloon signals by default to avoid balloon crash
Liming Wang [Thu, 11 Aug 2011 07:28:10 +0000 (15:28 +0800)]
kvm tools: ignore balloon signals by default to avoid balloon crash

If "kvm run" without balloon option, use "kvm balloon" may
crash kvm. So ignore balloon signals by default to avoid this.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Save and restore the iovec related values in read and write
Aneesh Kumar K.V [Tue, 9 Aug 2011 15:13:47 +0000 (20:43 +0530)]
kvm tools: Save and restore the iovec related values in read and write

The virtio_p9_set_reply_header function looks at the pdu buffer to find the cmd
so that it can find the reply command value. We actually found the issue when
Sasha reported that dd on his system in failing with unknown error 512 with
dotl. The reason being that, since we didn't update iovec in virtio_p9_write
virtio_p9_set_reply_header was looking at a wrong offset and the reply cmd got
set to RLERROR, and the client picked the bytes written as errno number.

We need to restore the value properly so that rest of readf and writef
work as expected.

Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Stop guest if SDL window is closed
Pekka Enberg [Wed, 10 Aug 2011 18:48:11 +0000 (21:48 +0300)]
kvm tools: Stop guest if SDL window is closed

Send SIGKVMSTOP signal to the process if the SDL window is closed. This fixes
an annoying problem where closing the window makes the guest seem like it froze
although it's really running in the background but the UI is unusable.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm version' output
Pekka Enberg [Wed, 10 Aug 2011 18:38:40 +0000 (21:38 +0300)]
kvm tools: Improve 'kvm version' output

This patch improves 'kvm version' output as follows as suggested by Ingo
Molnar:

  $ ./kvm version
  kvm tool 3.0.rc5.763.ga6c998

Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tool: Fix builtin command usage printouts
Pekka Enberg [Wed, 10 Aug 2011 18:32:58 +0000 (21:32 +0300)]
kvm tool: Fix builtin command usage printouts

This patch fixes builtin commands to use usage_with_options() instead of die().
The latter prefixes messages with "Fatal" which makes the usage text ugly.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Improve 'kvm list' output
Pekka Enberg [Wed, 10 Aug 2011 18:20:22 +0000 (21:20 +0300)]
kvm tools: Improve 'kvm list' output

This patch improves 'kvm list' output to look more like 'ps':

  $ ./kvm list
    PID GUEST
   2820 guest-2820

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoRevert "kvm tools: Enable kernel DHCP autoconf by default"
Pekka Enberg [Wed, 10 Aug 2011 04:59:11 +0000 (07:59 +0300)]
Revert "kvm tools: Enable kernel DHCP autoconf by default"

This reverts commit f0aec23a91368e916a53e6072f2173bb481b1544.

Asias He writes:

  'ip=dhcp' makes kernel try to use nfs as root fs which results in a long
  time 'wait and fail' and finally fallback to 9p as root fs.

  [    1.688000] Sending DHCP requests ., OK
  [    1.695000] IP-Config: Got DHCP answer from 192.168.33.1, my address
  is 192.168.33.15
  [    1.699000] IP-Config: Complete:
  [    1.700000]      device=eth0, addr=192.168.33.15, mask=255.255.255.0,
  gw=192.168.33.1,
  [    1.703000]      host=192.168.33.15, domain=stu.buaa.edu.cn,
  nis-domain=(none),
  [    1.706000]      bootserver=192.168.33.1, rootserver=192.168.33.1,
  rootpath=
  [   36.769000] VFS: Unable to mount root fs via NFS, trying floppy.
  [   36.771000] VFS: Mounted root (9p filesystem) on device 0:14.

13 years agokvm tools: handle failure of command
Liming Wang [Wed, 10 Aug 2011 02:44:09 +0000 (10:44 +0800)]
kvm tools: handle failure of command

handle failure of calling command function, especially, only handle
EPERM error now.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
[ penberg@kernel.org: fix minor coding style issue ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: convert callback to int and deal with the return value
Liming Wang [Wed, 10 Aug 2011 02:44:08 +0000 (10:44 +0800)]
kvm tools: convert callback to int and deal with the return value

callback function maybe fail, so we should deal with the return value.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Enable kernel DHCP autoconf by default
Pekka Enberg [Tue, 9 Aug 2011 17:46:08 +0000 (20:46 +0300)]
kvm tools: Enable kernel DHCP autoconf by default

As we boot to '/bin/sh' by default, enable kernel DHCP autoconfiguration too.
The guest kernel needs to be configured with the following configuration
options:

  CONFIG_IP_PNP=y
  CONFIG_IP_PNP_DHCP=y

Cc: Asias He <asias.hejun@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Boot to host /bin/sh via 9p by default
Pekka Enberg [Tue, 9 Aug 2011 15:25:57 +0000 (18:25 +0300)]
kvm tools: Boot to host /bin/sh via 9p by default

This patch updates 'kvm run' to boot to host filesystem via 9p '/bin/sh' by
default:

  $ ./kvm run
    # kvm run -k ../../arch/x86/boot/bzImage -m 320 -c 2 --name guest-3462
  [    0.000000] Linux version 3.1.0-rc1+ (penberg@tiger) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #7 SMP PREEMPT Tue Aug 9 16:39:20 EEST 2011
  [    0.000000] Command line: notsc noapic noacpi pci=conf1 reboot=k panic=1 console=ttyS0 earlyprintk=serial  init=/bin/sh  root=/dev/vda rw  root=/dev/root rootflags=rw,trans=virtio,version=9p2000.u rootfstype=9p

  [snip]

  [    1.803261] VFS: Mounted root (9p filesystem) on device 0:13.
  [    1.805153] devtmpfs: mounted
  [    1.808353] Freeing unused kernel memory: 924k freed
  [    1.810592] Write protecting the kernel read-only data: 12288k
  [    1.816268] Freeing unused kernel memory: 632k freed
  [    1.826030] Freeing unused kernel memory: 1448k freed
  sh: cannot set terminal process group (-1): Inappropriate ioctl for device
  sh: no job control in this shell
  sh-4.1#

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, 9p: handler should be called in case of not supported operation
Aneesh Kumar K.V [Tue, 9 Aug 2011 15:13:46 +0000 (20:43 +0530)]
kvm tools, 9p: handler should be called in case of not supported operation

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: remove unused options
Liming Wang [Tue, 9 Aug 2011 14:56:54 +0000 (22:56 +0800)]
kvm tools: remove unused options

kvm "--help" and "--version" are not implemented, so remove them to
avoid ambiguous.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Change method of retrieving process name
Sasha Levin [Tue, 9 Aug 2011 10:17:39 +0000 (13:17 +0300)]
kvm tools: Change method of retrieving process name

This patch changes './kvm list' to retrieve process name from
'/proc/<pid>/stat' instead of '/proc/<pid>/comm' as it appears the latter
does not exist by default on several systems.

Reported-by: Pradeep Kumar Surisetty <psuriset@linux.vnet.ibm.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>