From: Asias He Subject: [PATCH 1/2] kvm tools: Fix 'lkvm stop' when guest is pasued. Date: Wed, 21 Dec 2011 21:47:10 +0800 Message-ID: <1324475231-7307-1-git-send-email-asias.hejun@gmail.com> Cc: Sasha Levin , Cyrill Gorcunov , Ingo Molnar , kvm@vger.kernel.org, Asias He To: Pekka Enberg Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:39135 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584Ab1LUNtA (ORCPT ); Wed, 21 Dec 2011 08:49:00 -0500 Received: by iaeh11 with SMTP id h11so11921030iae.19 for ; Wed, 21 Dec 2011 05:49:00 -0800 (PST) Sender: kvm-owner@vger.kernel.org List-ID: Currently, 'lkvm stop' can not stop a pasued guest becasue guest is blocked on the pause_lock. This patch fixes it by un-pausing the guest before stops it. The pthread_kill() call is not needed. Signed-off-by: Asias He --- tools/kvm/kvm-cpu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c index 52db84a..bdefa09 100644 --- a/tools/kvm/kvm-cpu.c +++ b/tools/kvm/kvm-cpu.c @@ -39,7 +39,7 @@ static void kvm_cpu_signal_handler(int signum) if (signum == SIGKVMEXIT) { if (current_kvm_cpu && current_kvm_cpu->is_running) { current_kvm_cpu->is_running = false; - pthread_kill(pthread_self(), SIGKVMEXIT); + kvm__continue(); } } else if (signum == SIGKVMPAUSE) { current_kvm_cpu->paused = 1; -- 1.7.7.3