iothread: check iothread->ctx before aio_context_unref to avoid assertion
commiteb7b5c35117bfb90dcfa881a0e3b23368c73fba6
authorLin Ma <lma@suse.com>
Mon, 26 Sep 2016 05:29:58 +0000 (26 13:29 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 28 Sep 2016 10:21:46 +0000 (28 11:21 +0100)
tree6fccee369c1796dc7f564cc292a5e5974ed930b0
parent6b9424689a32bb76942ec39f6d5c60b72eb002e0
iothread: check iothread->ctx before aio_context_unref to avoid assertion

if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
g_source_unref: assertion 'source != NULL' failed.
The patch fixes it.

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20160926052958.10716-1-lma@suse.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
iothread.c