public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: Liming Wang <walimisdev@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Asias He <asias.hejun@gmail.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash
Date: Thu, 11 Aug 2011 10:29:05 +0300	[thread overview]
Message-ID: <1313047745.3456.4.camel@lappy> (raw)
In-Reply-To: <1313039267-25951-1-git-send-email-walimisdev@gmail.com>

On Thu, 2011-08-11 at 13:07 +0800, Liming Wang wrote:
> 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);

You can just do this:
	signal(SIGKVMADDMEM, SIG_IGN);

For both, and avoid the empty handler.

> +	signal(SIGKVMDELMEM, handle_empty);
>  
>  	nr_online_cpus = sysconf(_SC_NPROCESSORS_ONLN);
>  

-- 

Sasha.


  parent reply	other threads:[~2011-08-11  7:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Sasha Levin [this message]
2011-08-11  7:21   ` [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash walimis
2011-08-11  7:28   ` [PATCH 1/3] kvm tools: ignore balloon signals by default " Liming Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1313047745.3456.4.camel@lappy \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=walimisdev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox