From patchwork Wed Jun 15 16:48:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 882692 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 p5FGp6Tt031065 for ; Wed, 15 Jun 2011 16:51:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751799Ab1FOQvE (ORCPT ); Wed, 15 Jun 2011 12:51:04 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:61786 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740Ab1FOQvB (ORCPT ); Wed, 15 Jun 2011 12:51:01 -0400 Received: by mail-pz0-f46.google.com with SMTP id 9so395991pzk.19 for ; Wed, 15 Jun 2011 09:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=yN4sXmX0Gq9/zLbUsG6MNPEo8/Ivg2eBEJ7pW+XZBeU=; b=ohmEDzSws4Qr18o7KMR8pOtGJCPluI33HcSEylx6yF4IFIZT7v4VsPQ8vhwkQVBo9R or+gT2it8qpQbKl9RoPD+ZrIznTvIBQzDnO3AGDU+PFX9t5Gg7owti1YZ0Q2g+F50G4m vsXQFPCOuvbutQHs1fXf4OV/HSx8BHkhaiVHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=VAkC4cSIGdEGJb1Gy2zeXS9bNLm8B0mwD7UHVjLKA/vCQqU/Yl/xnmaZXDe+81Pg3D xbR5te/dCnFr+vsPo5I397j2TRJivr91dsAYOBMpED4hYimVIzohYlK7P5IDYUWxUxsL nyWhdFid3WSnI28mrEn8s0W/ue22pYNDNB/X8= Received: by 10.142.242.18 with SMTP id p18mr189505wfh.68.1308156661114; Wed, 15 Jun 2011 09:51:01 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id k4sm363957pbl.11.2011.06.15.09.50.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 09:51:00 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, Asias He Subject: [PATCH 5/6] kvm tools: Block SIGALRM for vcpu thread using sig_block() helper Date: Thu, 16 Jun 2011 00:48:10 +0800 Message-Id: <1308156491-18488-5-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> References: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> 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]); Wed, 15 Jun 2011 16:51:06 +0000 (UTC) Signed-off-by: Asias He --- tools/kvm/kvm-cpu.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c index 1fb1c74..782a3b2 100644 --- a/tools/kvm/kvm-cpu.c +++ b/tools/kvm/kvm-cpu.c @@ -420,12 +420,8 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu) int kvm_cpu__start(struct kvm_cpu *cpu) { - sigset_t sigset; - sigemptyset(&sigset); - sigaddset(&sigset, SIGALRM); - - pthread_sigmask(SIG_BLOCK, &sigset, NULL); + sig_block(SIGALRM); signal(SIGKVMEXIT, kvm_cpu_signal_handler); signal(SIGKVMPAUSE, kvm_cpu_signal_handler); @@ -485,6 +481,7 @@ int kvm_cpu__start(struct kvm_cpu *cpu) default: goto panic_kvm; } + kvm_cpu__handle_coalesced_mmio(cpu); }