Add support to 'lkvm debug' to inject arbitrary sysrqs using a new
'-s <sysrq>' argument.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Remove struct debug_cmd and use kvm_ipc__send_msg().
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Use stack variable.
Remove unneeded branch.
Close opened file.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Commands' usage : Change the binary name from *kvm* to *lkvm*,
since commit ad3efb18 has done it.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This allows triggering NMI on guests using 'kvm debug -m [cpu]'.
Please note that the default behaviour of 'kvm debug' dumping guest's cpu
state has been modified to require a '-d'/--dump.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch makes debug output go to a 'debug_fd' instead of stdout.
Doing so allows us to send the output to a different console when
required.
This patch also changes the behaviour of 'kvm debug' to show the debug
output in the console that executed the debug command instead of in the
console of the guest.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch changes the IPC method to use UNIX sockets instead of
signals.
This allows for more flexibility in moving data between processes, for example
it would allow avoid printing output in the terminal of the guest.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
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>
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>
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>
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>
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>
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>