On 01.10.2014 19:01, Stefan Hajnoczi wrote:
The backup block job must run in the BlockDriverState AioContext so that
it works with dataplane.
The basics of acquiring the AioContext are easy in blockdev.c.
The completion code in block/backup.c must call bdrv_unref() from the
main loop. Use block_job_defer_to_main_loop() to achieve that.
Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
---
block/backup.c | 21 +++++++++++++++++++--
blockdev.c | 23 ++++++++++++++++-------
2 files changed, 35 insertions(+), 9 deletions(-)
Hm, so, if I run a backup blockjob from one thread (which is not the
main loop and not the BDS's AIO context) and try to cancel it or set its
speed from another thread (e.g. the main loop), won't the blockjob hold
the BDS's AIO context lock as long as it runs and making it impossible
to interfere?
Max