From patchwork Fri Apr 29 06:36:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 740391 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 p3T6cGum006423 for ; Fri, 29 Apr 2011 06:38:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754839Ab1D2GiN (ORCPT ); Fri, 29 Apr 2011 02:38:13 -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 S1752094Ab1D2GiM (ORCPT ); Fri, 29 Apr 2011 02:38:12 -0400 Received: by mail-pw0-f46.google.com with SMTP id 15so1653420pwi.19 for ; Thu, 28 Apr 2011 23:38:12 -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=5co0+yMgXThKjBsHdzsBcelnjxaSofQq+25oW90KaLw=; b=CiTcjXqShioNwCvW15+12uAm7Xfzs2kicDVjPYxltNGkYihgdTCri5f1QmkMcfquwK c4V9dkvo3ozKQGS6BRHbuEe79Xu3SUJPtylj1VGvR0Ptf37qP71FOk+wCFxMCWGhc+t/ /c1deh/a2TWZkQF9e24K6Pr1+IW0vmUSNk4e4= 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=nF8YK4ny8cI65TbGwUrWO5OUgjCgHjLQ2WFKOcn4BoC4uCIxYma/QnaGZuLkODP2/u PsLat7Ft0hCaFNO1AZDNUxHdXaadtLiPuGtV1NkFSL5CEbU8U96Y3005QwB5ru0FI5Ia pnnMcO1fZcOB6kuBC2IRUu8y7fchNxNqOVz1k= Received: by 10.68.1.4 with SMTP id 4mr4625218pbi.397.1304059092001; Thu, 28 Apr 2011 23:38:12 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id p17sm1713060pbt.83.2011.04.28.23.38.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 23:38:11 -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 3/3] kvm tools: Make virtio-blk kvm__irq_line thread safe Date: Fri, 29 Apr 2011 14:36:25 +0800 Message-Id: <1304058985-13833-3-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:16 +0000 (UTC) Signed-off-by: Asias He --- tools/kvm/virtio-blk.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio-blk.c b/tools/kvm/virtio-blk.c index 3feabd0..ade6335 100644 --- a/tools/kvm/virtio-blk.c +++ b/tools/kvm/virtio-blk.c @@ -159,7 +159,9 @@ static void virtio_blk_do_io(struct kvm *kvm, void *param) while (virt_queue__available(vq)) virtio_blk_do_io_request(kvm, vq); + mutex_lock(&blk_device.mutex); kvm__irq_line(kvm, VIRTIO_BLK_IRQ, 1); + mutex_unlock(&blk_device.mutex); } static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)