ssh: use BlockDriverState's AioContext
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 8 May 2014 14:34:53 +0000 (16:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 4 Jun 2014 07:56:12 +0000 (09:56 +0200)
commit2af0b2005669ee3572a19499c51a499114a8ec50
tree42681adb081620b5c068b2247edd986abe464e6e
parent84390bed59f5a8ead499c4501f54c9b8a747c9d4
ssh: use BlockDriverState's AioContext

Drop the assumption that we're using the main AioContext.  Use
bdrv_get_aio_context() to register fd handlers in the right AioContext
for this BlockDriverState.

The .bdrv_detach_aio_context() and .bdrv_attach_aio_context() interfaces
are not needed since no fd handlers, timers, or BHs stay registered when
requests have been drained.

For now this doesn't make much difference but will allow ssh to work in
IOThread instances in the future.

Acked-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/ssh.c