From patchwork Wed Jun 15 16:48:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 882662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FGos1p030945 for ; Wed, 15 Jun 2011 16:50:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423Ab1FOQuu (ORCPT ); Wed, 15 Jun 2011 12:50:50 -0400 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) 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=4pUsOGUXSvNcSNQaUhbmT2tF3OjQcRdaQQnkWiUWwbU=; b=jBKF7M/3BwV2JQTdbF6bd4VxTZqHlr61PHL27Kpx+mumWturONRIc5P1xRMjK3ayE3 WcsmVwcAkhSwVR8RlCv5srv0ExaUNTaSRzXlv0k30gqp1RYynYbwfBoAGlwQF5HNNNQI lblunuix2w28lEgJ7vL/l9IukRdxxxCyQrEuU= 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=oLfIN8FlKzW1kn4y2c76s22O0nih/Ysq++E6YjrrbBD2ySB/OzofI4Pirt2tdlkZza wk7QHgaadE/keaOiFECKaFN3XgP6LseV0t+K9zghFlnEHFS5p88f2sy9IHmfjPyWkcT3 BFnI8n86ql2euPgaTp1Fgu9yCkIrMfQw2Q3ig= Received: by 10.68.14.69 with SMTP id n5mr482783pbc.315.1308156650018; Wed, 15 Jun 2011 09:50:50 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id k4sm363957pbl.11.2011.06.15.09.50.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 09:50:49 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, 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> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> References: <1308156491-18488-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]); Wed, 15 Jun 2011 16:50:55 +0000 (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 --- 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];