aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-19 09:11:38 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-19 09:11:38 +0100
commit63cb55783c5e8f783b1dcebd3a2935941f872d44 (patch)
treecf4686e5d864b8a88584b10bbf915ed616b2124e /io
parent6887dc6700ccb7820d8a9d370f421ee361c748e8 (diff)
parent8f7168b34323ceec4d5faff797e7bcf1be57e6be (diff)
Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-07-18-1' into staging
Merge I/O 2017/07/18 v1 # gpg: Signature made Tue 18 Jul 2017 11:31:53 BST # gpg: using RSA key 0xBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/pull-qio-2017-07-18-1: io: simplify qio_channel_attach_aio_context Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'io')
-rw-r--r--io/channel.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/io/channel.c b/io/channel.c
index cdf74540c1..1cfb8b33a2 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -279,15 +279,9 @@ static void qio_channel_set_aio_fd_handlers(QIOChannel *ioc)
void qio_channel_attach_aio_context(QIOChannel *ioc,
AioContext *ctx)
{
- AioContext *old_ctx;
- if (ioc->ctx == ctx) {
- return;
- }
-
- old_ctx = ioc->ctx ? ioc->ctx : iohandler_get_aio_context();
- qio_channel_set_aio_fd_handler(ioc, old_ctx, NULL, NULL, NULL);
+ assert(!ioc->read_coroutine);
+ assert(!ioc->write_coroutine);
ioc->ctx = ctx;
- qio_channel_set_aio_fd_handlers(ioc);
}
void qio_channel_detach_aio_context(QIOChannel *ioc)