aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-06-15 19:09:05 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-08-24 16:57:32 -0500
commit40ed5cdf724598f42907dd5a6b33f4f93dce398a (patch)
tree600486f8655125792028f2eb770587bcda22d569 /block
parent21827917342bac938e462513afee6c7d39f28adc (diff)
downloadqemu-40ed5cdf724598f42907dd5a6b33f4f93dce398a.zip
qemu-40ed5cdf724598f42907dd5a6b33f4f93dce398a.tar.gz
qemu-40ed5cdf724598f42907dd5a6b33f4f93dce398a.tar.bz2
nbd: fix NBD over TLS
When attaching the NBD QIOChannel to an AioContext, the TLS channel should be used, not the underlying socket channel. This is because, trivially, the TLS channel will be the one that we read/write to and thus the one that will get the qio_channel_yield() call. Fixes: ff82911cd3f69f028f2537825c9720ff78bc3f19 Cc: qemu-stable@nongnu.org Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 96d06835dc40007673cdfab6322e9042c4077113) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/nbd-client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/nbd-client.c b/block/nbd-client.c
index 1e2952f..56eb0e2 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -352,14 +352,14 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int count)
void nbd_client_detach_aio_context(BlockDriverState *bs)
{
NBDClientSession *client = nbd_get_client_session(bs);
- qio_channel_detach_aio_context(QIO_CHANNEL(client->sioc));
+ qio_channel_detach_aio_context(QIO_CHANNEL(client->ioc));
}
void nbd_client_attach_aio_context(BlockDriverState *bs,
AioContext *new_context)
{
NBDClientSession *client = nbd_get_client_session(bs);
- qio_channel_attach_aio_context(QIO_CHANNEL(client->sioc), new_context);
+ qio_channel_attach_aio_context(QIO_CHANNEL(client->ioc), new_context);
aio_co_schedule(new_context, client->read_reply_co);
}