From patchwork Thu Aug 11 05:07:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: walimis X-Patchwork-Id: 1055842 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7B5OG0U003362 for ; Thu, 11 Aug 2011 05:24:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752122Ab1HKFYB (ORCPT ); Thu, 11 Aug 2011 01:24:01 -0400 Received: from mail.windriver.com ([147.11.1.11]:53875 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345Ab1HKFYA (ORCPT ); Thu, 11 Aug 2011 01:24:00 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id p7B5Nm2W027521 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 10 Aug 2011 22:23:48 -0700 (PDT) Received: from localhost.localdomain (128.224.162.211) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Wed, 10 Aug 2011 22:23:48 -0700 From: Liming Wang To: Pekka Enberg CC: Sasha Levin , Ingo Molnar , Asias He , Subject: [PATCH 1/3] kvm tools: add signal placeholder to avoid balloon crash Date: Thu, 11 Aug 2011 13:07:45 +0800 Message-ID: <1313039267-25951-1-git-send-email-walimisdev@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Aug 2011 05:24:16 +0000 (UTC) If "kvm run" without balloon option, use "kvm balloon" may crash kvm. Add signal placeholder to avoid this. Signed-off-by: Liming Wang --- 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);