All of lore.kernel.org
 help / color / mirror / Atom feed
From: Asias He <asias.hejun@gmail.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Sasha Levin <levinsasha928@gmail.com>,
	kvm@vger.kernel.org, Asias He <asias.hejun@gmail.com>
Subject: [PATCH 4/5] kvm tools: Fix ndev mutex and condition variable initialization
Date: Mon, 31 Oct 2011 22:39:41 +0800	[thread overview]
Message-ID: <1320071982-21560-4-git-send-email-asias.hejun@gmail.com> (raw)
In-Reply-To: <1320071982-21560-1-git-send-email-asias.hejun@gmail.com>

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 <asias.hejun@gmail.com>
---
 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


  parent reply	other threads:[~2011-10-31 14:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 14:39 [PATCH 1/5] kvm tools: Drop unused variable in struct uip_buf Asias He
2011-10-31 14:39 ` [PATCH 2/5] kvm tools: Use macro in uip_tx_do_ipv4() Asias He
2011-10-31 14:39 ` [PATCH 3/5] kvm tools: Fix a vertical indentation for net/uip/udp.c Asias He
2011-10-31 14:39 ` Asias He [this message]
2011-10-31 14:39 ` [PATCH 5/5] kvm tools: Remove dead code virt_queue__trigger_irq() Asias He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320071982-21560-4-git-send-email-asias.hejun@gmail.com \
    --to=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.