Fam Zheng 2e5b887cfc block: Forbid bdrv_set_aio_context outside BQL
Even if the caller has both the old and the new AioContext's, there can
be a deadlock, due to the leading bdrv_drain_all.

Suppose there are four io threads (A, B, A0, B0) with A and B owning a
BDS for each (bs_a, bs_b); Now A wants to move bs_a to iothread A0, and
B wants to move bs_b to B0, at the same time:

  iothread A                           iothread B
--------------------------------------------------------------------------
  aio_context_acquire(A0) /* OK */     aio_context_acquire(B0) /* OK */
  bdrv_set_aio_context(bs_a, A0)       bdrv_set_aio_context(bs_b, B0)
  -> bdrv_drain_all()                  -> bdrv_drain_all()
     -> acquire A /* OK */               -> acquire A /* blocked */
     -> acquire B /* blocked */          -> acquire B
     ...                                 ...

Deadlock happens because A is waiting for B, and B is waiting for A.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1423969591-23646-2-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 14:43:45 +01:00
2015-02-16 17:30:19 +01:00
2015-02-06 16:11:38 +00:00
2015-02-19 09:33:03 +01:00
2015-02-19 09:33:03 +01:00
2015-02-13 11:44:50 +00:00
2015-02-12 21:21:38 -08:00
2015-02-23 10:56:09 -05:00
2015-02-24 13:58:18 +00:00
2015-02-16 17:30:19 +01:00
2015-02-16 17:31:55 +01:00
2015-02-06 14:35:52 +00:00
2015-02-05 17:16:14 +01:00
2015-02-16 14:36:03 +00:00
2015-01-22 17:41:59 +00:00
2015-02-16 15:07:19 +00:00
2015-02-12 21:21:38 -08:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
Readme 531 MiB
Languages
C 82.5%
C++ 7%
Python 3.3%
Dylan 2.8%
Shell 1.5%
Other 2.6%