public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash
@ 2011-08-11  5:07 Liming Wang
  2011-08-11  5:07 ` [PATCH 2/3] kvm tools: check negative value of num_pages Liming Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Liming Wang @ 2011-08-11  5:07 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Sasha Levin, Ingo Molnar, Asias He, kvm

If "kvm run" without balloon option, use "kvm balloon" may
crash kvm. Add signal placeholder to avoid this.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
---
 tools/kvm/builtin-run.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index fa5de27..d725834 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -280,6 +280,10 @@ static void handle_sigstop(int sig)
 	kvm_cpu__reboot();
 }
 
+static void handle_empty(int sig)
+{
+}
+
 static void *kvm_cpu_thread(void *arg)
 {
 	current_kvm_cpu		= arg;
@@ -469,6 +473,9 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 	signal(SIGUSR2, handle_sigusr2);
 	signal(SIGKVMSTOP, handle_sigstop);
 	signal(SIGKVMRESUME, handle_sigusr2);
+	/* signal placeholder if not enable balloon */
+	signal(SIGKVMADDMEM, handle_empty);
+	signal(SIGKVMDELMEM, handle_empty);
 
 	nr_online_cpus = sysconf(_SC_NPROCESSORS_ONLN);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-11 13:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11  5:07 [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash Liming Wang
2011-08-11  5:07 ` [PATCH 2/3] kvm tools: check negative value of num_pages Liming Wang
2011-08-11  5:37   ` Sasha Levin
2011-08-11  5:40     ` walimis
2011-08-11  7:22       ` Sasha Levin
2011-08-11  7:21         ` Liming Wang
2011-08-11 13:36           ` Pekka Enberg
2011-08-11 13:37             ` walimis
2011-08-11  5:07 ` [PATCH 3/3] kvm tools: enable keyboard press repeat for sdl Liming Wang
2011-08-11  7:29 ` [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash Sasha Levin
2011-08-11  7:21   ` walimis
2011-08-11  7:28   ` [PATCH 1/3] kvm tools: ignore balloon signals by default " Liming Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox