Skip to contentSkip to conversation

vhost-user+postcopy: Use qemu_set_nonblock

PATCH In review Dr. David Alan Gilbert (git) 3 participants 3 messages May 2, 2018 – May 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-user+postcopy: Use qemu_set_nonblock

From: "Dr. David Alan Gilbert" <[email protected]>

Use qemu_set_nonblock rather than a simple fcntl; cleaner and I have no reason to change other flags.

---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-user.c +1 -1
index 38da8692bb..c2bbb622d6 100644
@@ -1076,7 +1076,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;
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Use qemu_set_nonblock rather than a simple fcntl; cleaner and I have no reason to change other flags.

---
  hw/virtio/vhost-user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

(wonder if checkpatch.pl can be taught to easily recognize this one)

Quoted 15 lines
hw/virtio/vhost-user.c +1 -1
index 38da8692bb..c2bbb622d6 100644
@@ -1076,7 +1076,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;
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 10 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Use qemu_set_nonblock rather than a simple fcntl; cleaner and I have no reason to change other flags.

---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)