From: Dr. David Alan Gilbert Date: Wed, 2 May 2018 10:55:52 +0000 (+0100) Subject: vhost-user+postcopy: Use qemu_set_nonblock X-Git-Tag: qemu-xen-4.12.0-rc1~215^2~13 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9952e807fd016c95f50372536f1ac65a601be6e4;p=qemu-xen.git vhost-user+postcopy: Use qemu_set_nonblock Use qemu_set_nonblock rather than a simple fcntl; cleaner and I have no reason to change other flags. Reported-by: Peter Maydell Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 85d8fd270b..41cbd8a455 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -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;