static int qio_channel_tls_shutdown(QIOChannel *ioc, QIOChannelShutdown how, Error **errp) { QIOChannelTLS *tioc = QIO_CHANNEL_TLS(ioc); return qio_channel_shutdown(tioc->master, how, errp); }
static int qio_channel_websock_shutdown(QIOChannel *ioc, QIOChannelShutdown how, Error **errp) { QIOChannelWebsock *tioc = QIO_CHANNEL_WEBSOCK(ioc); return qio_channel_shutdown(tioc->master, how, errp); }
static void nbd_teardown_connection(BlockDriverState *bs) { NBDClientSession *client = nbd_get_client_session(bs); if (!client->ioc) { /* Already closed */ return; } /* finish any pending coroutines */ qio_channel_shutdown(client->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL); BDRV_POLL_WHILE(bs, client->read_reply_co); nbd_client_detach_aio_context(bs); object_unref(OBJECT(client->sioc)); client->sioc = NULL; object_unref(OBJECT(client->ioc)); client->ioc = NULL; }