From 789f255667a413a71c761f1e50ec956d14033d81 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sat, 2 Jul 2011 19:52:06 -0400 Subject: [PATCH] kvm tools: Provide instance name when running 'kvm debug' Instead of sending a signal to the first instance found, send it to a specific instance. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- tools/kvm/kvm-debug.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/kvm/kvm-debug.c b/tools/kvm/kvm-debug.c index 58782ddb6d6f..432ae84c51db 100644 --- a/tools/kvm/kvm-debug.c +++ b/tools/kvm/kvm-debug.c @@ -1,11 +1,22 @@ -#include -#include - #include #include #include +#include + +#include +#include +#include int kvm_cmd_debug(int argc, const char **argv, const char *prefix) { - return system("kill -3 $(pidof kvm)"); + int pid; + + if (argc != 1) + die("Usage: kvm debug [instance name]\n"); + + pid = kvm__get_pid_by_instance(argv[0]); + if (pid < 0) + die("Failed locating instance name"); + + return kill(pid, SIGQUIT); } -- 2.39.5