mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-04 12:41:37 +00:00
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 <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
+11
-2
@@ -5,9 +5,18 @@
|
||||
#include <kvm/util.h>
|
||||
#include <kvm/kvm-cmd.h>
|
||||
#include <kvm/kvm-pause.h>
|
||||
#include <kvm/kvm.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user