From: Sasha Levin Date: Sat, 2 Jul 2011 23:52:07 +0000 (-0400) Subject: kvm tools: Provide instance name when running 'kvm pause' X-Git-Tag: next-20110824~3^2~149 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=da243c4105fc0632fc0e861625d5748c702f91a8;p=karo-tx-linux.git kvm tools: Provide instance name when running 'kvm pause' 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 --- diff --git a/tools/kvm/kvm-pause.c b/tools/kvm/kvm-pause.c index fdf871408386..0cb6f2908c91 100644 --- a/tools/kvm/kvm-pause.c +++ b/tools/kvm/kvm-pause.c @@ -5,9 +5,18 @@ #include #include #include +#include int kvm_cmd_pause(int argc, const char **argv, const char *prefix) { - signal(SIGUSR2, SIG_IGN); - return system("kill -USR2 $(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, SIGUSR2); }