diff options
author | Li Qiang <liq3ea@gmail.com> | 2018-11-21 03:21:59 -0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2019-03-29 15:22:18 +0800 |
commit | ab79237a15e8f8c23310291b672d83374cf17935 (patch) | |
tree | e92979cebb89d0ad562a4ccada688a7921d7f8cd /net/tap.c | |
parent | c6bf50ff72c2eefbb041c71a0944426df685a9df (diff) | |
download | qemu-ab79237a15e8f8c23310291b672d83374cf17935.zip qemu-ab79237a15e8f8c23310291b672d83374cf17935.tar.gz qemu-ab79237a15e8f8c23310291b672d83374cf17935.tar.bz2 |
net: tap: use qemu_set_nonblock
The fcntl will change the flags directly, use qemu_set_nonblock()
instead.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r-- | net/tap.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -592,7 +592,7 @@ int net_init_bridge(const Netdev *netdev, const char *name, return -1; } - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); vnet_hdr = tap_probe_vnet_hdr(fd); s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr); @@ -707,7 +707,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, } return; } - fcntl(vhostfd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(vhostfd); } options.opaque = (void *)(uintptr_t)vhostfd; @@ -791,7 +791,7 @@ int net_init_tap(const Netdev *netdev, const char *name, return -1; } - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); vnet_hdr = tap_probe_vnet_hdr(fd); @@ -839,7 +839,7 @@ int net_init_tap(const Netdev *netdev, const char *name, goto free_fail; } - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); if (i == 0) { vnet_hdr = tap_probe_vnet_hdr(fd); @@ -887,7 +887,7 @@ free_fail: return -1; } - fcntl(fd, F_SETFL, O_NONBLOCK); + qemu_set_nonblock(fd); vnet_hdr = tap_probe_vnet_hdr(fd); net_init_tap_one(tap, peer, "bridge", name, ifname, |