vhost-user+postcopy: Use qemu_set_nonblock
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 2 May 2018 10:55:52 +0000 (11:55 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 23 May 2018 14:02:02 +0000 (17:02 +0300)
Use qemu_set_nonblock rather than a simple fcntl; cleaner
and I have no reason to change other flags.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-user.c

index 85d8fd270b596a9cc03ff21d4f58476a17890876..41cbd8a455ba91f03c4facdb2ebf5ee6dba808ee 100644 (file)
@@ -1115,7 +1115,7 @@ static int vhost_user_postcopy_advise(struct vhost_dev *dev, Error **errp)
         error_setg(errp, "%s: Failed to get ufd", __func__);
         return -1;
     }
-    fcntl(ufd, F_SETFL, O_NONBLOCK);
+    qemu_set_nonblock(ufd);
 
     /* register ufd with userfault thread */
     u->postcopy_fd.fd = ufd;