This patch adds 'kvm sandbox' which is a wrapper on top of 'kvm run' which
allows the user to easily specify sandboxed command to run in a custom
rootfs guest.
Example usage:
kvm sandbox -d test_guest -k some_kernel -- do_something_in_guest
Suggested-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
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>
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>
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>
This patch seperates 'kvm pause' into 'kvm pause' and 'kvm resume',
'kvm pause' no longer acts as a switch between running and paused state but
instead just switches the instance into paused and reume is handled by
the new 'kvm resume'.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Rename kvm-[command] into builtin-[command] to prevent
clashes with non-command files such as kvm-cpu.h
Suggested-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Add a 'kvm version' command which prints the version of the kernel
used to build kvm tools.
Part of the code is based on and was loaned from perf.
Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Add a command to allow easily inflate/deflate the balloon driver in running
instances.
Usage:
kvm balloon [command] [instance name] [size]
command is either inflate or deflate, and size is represented in MB.
Target instance must be named (started with '--name').
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch adds a 'kvm debug' command that's currently an alias for
kill -USR2 `pidof kvm`
Which pauses a guest (freezes all VCPU threads) or resumes a paused
guest.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch adds a 'kvm debug' command that's currently an alias for
kill -3 `pidof kvm`
which prints out debugging diagnostics for guests.
Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch fixes code style issues pointed out by scripts/checkpatch. However,
some reported errors are false positives. In particular, the warning:
WARNING: line over 80 characters
is too strict for our code and thus needs to action to be taken.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
- kvm-cmd.h: Adds a new structure cmd_struct to create a table of commands
and callback function. The structure was copied from tools/perf
- kvm-cmd.c: implements two main functions for command processing.
kvm_get_command(): searches table for specific command.
handle_command(): invokes the callback function for a given command.
- kvm-help.[ch] Implements the kvm help command. The function
list_common_cmds_help() is a copy of similar function in tools/perf.
[ penberg@kernel.org: Add CREDITS-Git file for proper attributions. ]
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>