diff mbox

[2/6] kvm tools: Block SIGALRM for both rx and tx thread for virtio net

Message ID 1308156491-18488-2-git-send-email-asias.hejun@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Asias He June 15, 2011, 4:48 p.m. UTC
In the user mode network development process, SIGALRM makes getaddrinfo()
fails in virtio net thread. Blocking SIGALRM solves this problem.

SIGALRM is used by the console code to inject interrupt periodically.

Signed-off-by: Asias He <asias.hejun@gmail.com>
---
 tools/kvm/virtio/net.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index 6916af6..ad5fa3f 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -91,6 +91,8 @@  static void *virtio_net_rx_thread(void *p)
 	u16 head;
 	int len;
 
+	sig_block(SIGALRM);
+
 	kvm	= p;
 	vq	= &ndev.vqs[VIRTIO_NET_RX_QUEUE];
 
@@ -125,6 +127,8 @@  static void *virtio_net_tx_thread(void *p)
 	u16 head;
 	int len;
 
+	sig_block(SIGALRM);
+
 	kvm	= p;
 	vq	= &ndev.vqs[VIRTIO_NET_TX_QUEUE];