From: Tejus GK Date: Fri, 24 Oct 2025 13:15:42 +0000 (+0000) Subject: io: add a "blocking" field to QIOChannelSocket X-Git-Tag: v10.2.0-rc1~24^2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e52d8227162ba1fa53011f19e99b2f57705bc567;p=thirdparty%2Fqemu.git 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 Reviewed-by: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé --- diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index a88cf8b3a9..26319fa98b 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -49,6 +49,7 @@ struct QIOChannelSocket { socklen_t remoteAddrLen; ssize_t zero_copy_queued; ssize_t zero_copy_sent; + bool blocking; }; diff --git a/io/channel-socket.c b/io/channel-socket.c index 712b793eaf..8b30d5b7f7 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -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;