qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 09/11] block: let mirror blockjob run in BDS Aio


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 09/11] block: let mirror blockjob run in BDS AioContext
Date: Sat, 04 Oct 2014 23:07:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

On 01.10.2014 19:01, Stefan Hajnoczi wrote:
The mirror block job must run in the BlockDriverState AioContext so that
it works with dataplane.

Acquire the AioContext in blockdev.c so starting the block job is safe.

Note that to_replace is treated separately from other BlockDriverStates
in that it does not need to be in the same AioContext.  Explicitly
acquire/release to_replace's AioContext when accessing it.

The completion code in block/mirror.c must perform BDS graph
manipulation and bdrv_reopen() from the main loop.  Use
block_job_defer_to_main_loop() to achieve that.

The bdrv_drain_all() call is not allowed outside the main loop since it
could lead to lock ordering problems.  Use bdrv_drain(bs) instead
because we have acquired the AioContext so nothing else can sneak in
I/O.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
  block.c        | 13 +++++++--
  block/mirror.c | 85 ++++++++++++++++++++++++++++++++++++++++------------------
  blockdev.c     | 38 ++++++++++++++++++--------
  3 files changed, 97 insertions(+), 39 deletions(-)

Reviewed-by: Max Reitz <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]