From patchwork Fri Apr 29 06:36:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 740381 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3T6cAnC006381 for ; Fri, 29 Apr 2011 06:38:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754599Ab1D2GiH (ORCPT ); Fri, 29 Apr 2011 02:38:07 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:37407 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094Ab1D2GiG (ORCPT ); Fri, 29 Apr 2011 02:38:06 -0400 Received: by pwi15 with SMTP id 15so1653420pwi.19 for ; Thu, 28 Apr 2011 23:38:05 -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=O2dNnEvjML2wVA6qBxST6gxU95+OsnqRTYDuL/LoP2o=; b=ITKoeTfjVIyuUnscfQK151zH6oDQVkeNaq1tMEQM3GJPWIVFi44ICdHfwqMzXUi5AH x4sR5GFdDT/P+ZDd7AbbPEGyuMQps6qZBZk00b8QSlepa+xMFyQE+FSl41DV7tKC2gQk L6kH+hETV02oAtu1aC5kghlEE23lFD81ChJU0= 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=NDq8jwaeaPtExWrJD2zOZ/d4c17uoMfsc9AN6hJjvpwnXYqAKNNN9J66UlnBwnB7S1 bL93eogV91w12DhJUCoFlt+ZKY1l2ReyN6p53ElxVFGCKxHX1UA9mDbCmo/ycnYknV9f xbLJB3nUhf4Oo8St9xZaIFyWNMkVnUOmofoEU= Received: by 10.68.24.40 with SMTP id r8mr43772pbf.161.1304059085297; Thu, 28 Apr 2011 23:38:05 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id p17sm1713060pbt.83.2011.04.28.23.37.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 23:38:03 -0700 (PDT) From: Asias He To: Pekka Enberg , Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi Cc: kvm@vger.kernel.org, Asias He Subject: [PATCH 2/3] kvm tools: Make virtio-console kvm__irq_line thread safe Date: Fri, 29 Apr 2011 14:36:24 +0800 Message-Id: <1304058985-13833-2-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304058985-13833-1-git-send-email-asias.hejun@gmail.com> References: <1304058985-13833-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]); Fri, 29 Apr 2011 06:38:10 +0000 (UTC) Signed-off-by: Asias He --- tools/kvm/virtio-console.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio-console.c b/tools/kvm/virtio-console.c index e66d198..492c859 100644 --- a/tools/kvm/virtio-console.c +++ b/tools/kvm/virtio-console.c @@ -162,7 +162,9 @@ static void virtio_console_handle_callback(struct kvm *self, void *param) virt_queue__set_used_elem(vq, head, len); } + mutex_lock(&console_device.mutex); kvm__irq_line(self, VIRTIO_CONSOLE_IRQ, 1); + mutex_unlock(&console_device.mutex); } static bool virtio_console_pci_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)