summaryrefslogtreecommitdiff
path: root/block/win32-aio.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2014-05-08 16:34:49 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-04 09:56:12 +0200
commit99cc598924d9686e497fa9ddd7889d6be27f3084 (patch)
tree1e27fdc915dcf7c0a5a769abaa22fbffe1f439a8 /block/win32-aio.c
parentabd269b7cf1f084a067731acb8f3272c193cb5f0 (diff)
downloadqemu-99cc598924d9686e497fa9ddd7889d6be27f3084.tar.gz
block/raw-win32: create one QEMUWin32AIOState per BDRVRawState
Each QEMUWin32AIOState event notifier is associated with an AioContext. Since BlockDriverState instances can use different AioContexts we cannot continue to use a global QEMUWin32AIOState. Let each BDRVRawState have its own QEMUWin32AIOState and free it when BDRVRawState is closed. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/win32-aio.c')
-rw-r--r--block/win32-aio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/win32-aio.c b/block/win32-aio.c
index 5d1d199b61..b43b1667ee 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -204,3 +204,11 @@ out_free_state:
g_free(s);
return NULL;
}
+
+void win32_aio_cleanup(QEMUWin32AIOState *aio)
+{
+ qemu_aio_set_event_notifier(&aio->e, NULL);
+ CloseHandle(aio->hIOCP);
+ event_notifier_cleanup(&aio->e);
+ g_free(aio);
+}