From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: [PATCH 4/5] kvm tools: Fix ndev mutex and condition variable initialization Date: Mon, 31 Oct 2011 22:39:41 +0800 Message-ID: <1320071982-21560-4-git-send-email-asias.hejun@gmail.com> References: <1320071982-21560-1-git-send-email-asias.hejun@gmail.com> Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , kvm@vger.kernel.org, Asias He To: Pekka Enberg Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:61867 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932466Ab1JaOlB (ORCPT ); Mon, 31 Oct 2011 10:41:01 -0400 Received: by mail-iy0-f174.google.com with SMTP id y12so7240414iab.19 for ; Mon, 31 Oct 2011 07:41:01 -0700 (PDT) In-Reply-To: <1320071982-21560-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This patch fixes the initialization of the following variables: ndev->io_tx_lock ndev->io_rx_lock ndev->io_tx_cond ndev->io_rx_cond Signed-off-by: Asias He --- tools/kvm/virtio/net.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 1b59972..7cd6794 100644 --- a/tools/kvm/virtio/net.c +++ b/tools/kvm/virtio/net.c @@ -248,14 +248,14 @@ fail: static void virtio_net__io_thread_init(struct kvm *kvm, struct net_dev *ndev) { + pthread_mutex_init(&ndev->io_tx_lock, NULL); pthread_mutex_init(&ndev->io_rx_lock, NULL); - pthread_cond_init(&ndev->io_tx_cond, NULL); - pthread_mutex_init(&ndev->io_rx_lock, NULL); pthread_cond_init(&ndev->io_tx_cond, NULL); + pthread_cond_init(&ndev->io_rx_cond, NULL); - pthread_create(&ndev->io_rx_thread, NULL, virtio_net_rx_thread, ndev); pthread_create(&ndev->io_tx_thread, NULL, virtio_net_tx_thread, ndev); + pthread_create(&ndev->io_rx_thread, NULL, virtio_net_rx_thread, ndev); } static inline int tap_ops_tx(struct iovec *iov, u16 out, struct net_dev *ndev) -- 1.7.7.1