From nobody Wed Dec 17 21:43:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553845186084259.77110058383687; Fri, 29 Mar 2019 00:39:46 -0700 (PDT) Received: from localhost ([127.0.0.1]:47983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9m76-0007Pt-Ry for importer@patchew.org; Fri, 29 Mar 2019 03:39:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9m2s-0003z7-E7 for qemu-devel@nongnu.org; Fri, 29 Mar 2019 03:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9m2r-0002mS-DS for qemu-devel@nongnu.org; Fri, 29 Mar 2019 03:35:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36054) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9m2r-0002mD-6V for qemu-devel@nongnu.org; Fri, 29 Mar 2019 03:35:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7EEBE308338F; Fri, 29 Mar 2019 07:35:20 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-125.pek2.redhat.com [10.72.12.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB1B361090; Fri, 29 Mar 2019 07:35:18 +0000 (UTC) From: Jason Wang To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Fri, 29 Mar 2019 15:35:04 +0800 Message-Id: <1553844904-29959-5-git-send-email-jasowang@redhat.com> In-Reply-To: <1553844904-29959-1-git-send-email-jasowang@redhat.com> References: <1553844904-29959-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 29 Mar 2019 07:35:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] net: tap: use qemu_set_nonblock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Li Qiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Li Qiang The fcntl will change the flags directly, use qemu_set_nonblock() instead. Reviewed-by: Daniel P. Berrang=C3=A9 Acked-by: Michael S. Tsirkin Signed-off-by: Li Qiang Signed-off-by: Jason Wang --- net/tap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/tap.c b/net/tap.c index cc8525f..e8aadd8 100644 --- a/net/tap.c +++ b/net/tap.c @@ -592,7 +592,7 @@ int net_init_bridge(const Netdev *netdev, const char *n= ame, return -1; } =20 - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); vnet_hdr =3D tap_probe_vnet_hdr(fd); s =3D net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr); =20 @@ -707,7 +707,7 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, } return; } - fcntl(vhostfd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(vhostfd); } options.opaque =3D (void *)(uintptr_t)vhostfd; =20 @@ -791,7 +791,7 @@ int net_init_tap(const Netdev *netdev, const char *name, return -1; } =20 - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); =20 vnet_hdr =3D tap_probe_vnet_hdr(fd); =20 @@ -839,7 +839,7 @@ int net_init_tap(const Netdev *netdev, const char *name, goto free_fail; } =20 - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); =20 if (i =3D=3D 0) { vnet_hdr =3D tap_probe_vnet_hdr(fd); @@ -887,7 +887,7 @@ free_fail: return -1; } =20 - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); vnet_hdr =3D tap_probe_vnet_hdr(fd); =20 net_init_tap_one(tap, peer, "bridge", name, ifname, --=20 2.5.0