From: Asias He Subject: [PATCH 2/6] kvm tools: Block SIGALRM for both rx and tx thread for virtio net Date: Thu, 16 Jun 2011 00:48:07 +0800 Message-ID: <1308156491-18488-2-git-send-email-asias.hejun@gmail.com> References: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, Asias He To: Pekka Enberg Return-path: Received: from mail-pz0-f46.google.com ([209.85.210.46]:61786 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305Ab1FOQuu (ORCPT ); Wed, 15 Jun 2011 12:50:50 -0400 Received: by mail-pz0-f46.google.com with SMTP id 9so395991pzk.19 for ; Wed, 15 Jun 2011 09:50:50 -0700 (PDT) In-Reply-To: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- tools/kvm/virtio/net.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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]; -- 1.7.5.4