From patchwork Tue Apr 12 16:14:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 701221 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 p3CGG9op019497 for ; Tue, 12 Apr 2011 16:16:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932202Ab1DLQPs (ORCPT ); Tue, 12 Apr 2011 12:15:48 -0400 Received: from mail-px0-f179.google.com ([209.85.212.179]:55250 "EHLO mail-px0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196Ab1DLQPq (ORCPT ); Tue, 12 Apr 2011 12:15:46 -0400 Received: by mail-px0-f179.google.com with SMTP id 2so3604595pxi.10 for ; Tue, 12 Apr 2011 09:15:46 -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=V5eOLGoPJsmGxdmeBA2/zw6CZXPAka+3h+T6LJfSGvo=; b=DhcQUcf/b4KkECpQdr0CEDQz/DoyLFICAkN2Pi8rshRkeCTWg5b2SWInoju6LrwS+v jQOkrFtwajUR3ed6xCyuaIpjMFijVpFAlyQoC5nj/ZEPZAPCb/P2IT4/Wh8toXLahvor Z0gAohTTFHidYN3pmyNimMe7F8KLvkYNmnsDI= 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=g18QokgwfYLBWk0vRi1hX4wuaKOyb00Lmv5sY9rx52QLFz8CqZITjL0JqTrSQlxjX/ pc/WGNrSfUd1BvLBQ4L7tTRwlGs8TKT9Q9e676NrMkDwqVuVGUbGMS2tnpB92HbibmXs wOoBrRa/ialn6RbHSAlQFJoKcihZe2JJq7RsI= Received: by 10.142.60.5 with SMTP id i5mr6899143wfa.135.1302624945796; Tue, 12 Apr 2011 09:15:45 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id z10sm9875137wfj.3.2011.04.12.09.15.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 09:15:44 -0700 (PDT) From: Asias He To: Pekka Enberg , Cyrill Gorcunov , Ingo Molnar Cc: kvm@vger.kernel.org, Asias He Subject: [PATCH 2/4] kvm tools: Do not forget to take the lock in virtio_console_pci_io_out Date: Wed, 13 Apr 2011 00:14:14 +0800 Message-Id: <1302624856-884-2-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1302624856-884-1-git-send-email-asias.hejun@gmail.com> References: <1302624856-884-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]); Tue, 12 Apr 2011 16:16:12 +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 9675090..aa9b1bd 100644 --- a/tools/kvm/virtio-console.c +++ b/tools/kvm/virtio-console.c @@ -163,6 +163,8 @@ static bool virtio_console_pci_io_out(struct kvm *self, uint16_t port, void *dat unsigned long offset = port - IOPORT_VIRTIO_CONSOLE; bool ret = true; + mutex_lock(&console_device.mutex); + switch (offset) { case VIRTIO_PCI_GUEST_FEATURES: console_device.guest_features = ioport__read32(data);