error_setg_file_open(errp, errno, vih->evdev);
return;
}
- qemu_set_nonblock(vih->fd);
+ if (!g_unix_set_fd_nonblocking(vih->fd, true, NULL)) {
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ goto err_close;
+ }
rc = ioctl(vih->fd, EVIOCGVERSION, &ver);
if (rc < 0) {
return;
}
- ret = qemu_try_set_nonblock(vhostfd);
- if (ret < 0) {
- error_setg_errno(errp, -ret,
+ if (!g_unix_set_fd_nonblocking(vhostfd, true, NULL)) {
+ error_setg_errno(errp, errno,
"vhost-vsock: unable to set non-blocking mode");
return;
}
return;
}
- qemu_set_nonblock(vhostfd);
+ if (!g_unix_set_fd_nonblocking(vhostfd, true, NULL)) {
+ error_setg_errno(errp, errno,
+ "Failed to set FD nonblocking");
+ return;
+ }
}
vhost_vsock_common_realize(vdev, "vhost-vsock");