mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
io: add a "blocking" field to QIOChannelSocket
Add a 'blocking' boolean field to QIOChannelSocket to track whether the underlying socket is in blocking or non-blocking mode. Signed-off-by: Tejus GK <tejus.gk@nutanix.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
committed by
Daniel P. Berrangé
parent
989221c0c7
commit
e52d822716
@@ -49,6 +49,7 @@ struct QIOChannelSocket {
|
||||
socklen_t remoteAddrLen;
|
||||
ssize_t zero_copy_queued;
|
||||
ssize_t zero_copy_sent;
|
||||
bool blocking;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ qio_channel_socket_new(void)
|
||||
sioc->fd = -1;
|
||||
sioc->zero_copy_queued = 0;
|
||||
sioc->zero_copy_sent = 0;
|
||||
sioc->blocking = false;
|
||||
|
||||
ioc = QIO_CHANNEL(sioc);
|
||||
qio_channel_set_feature(ioc, QIO_CHANNEL_FEATURE_SHUTDOWN);
|
||||
@@ -859,6 +860,7 @@ qio_channel_socket_set_blocking(QIOChannel *ioc,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
|
||||
sioc->blocking = enabled;
|
||||
|
||||
if (!qemu_set_blocking(sioc->fd, enabled, errp)) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user