From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZPjh-00059U-Qx for qemu-devel@nongnu.org; Wed, 01 Oct 2014 15:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZPjZ-0005SD-H8 for qemu-devel@nongnu.org; Wed, 01 Oct 2014 15:38:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZPjZ-0005S8-9p for qemu-devel@nongnu.org; Wed, 01 Oct 2014 15:38:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s91JchbM031056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 1 Oct 2014 15:38:43 -0400 Message-ID: <542C583F.9010502@redhat.com> Date: Wed, 01 Oct 2014 21:38:39 +0200 From: Max Reitz MIME-Version: 1.0 References: <1412182919-9550-1-git-send-email-stefanha@redhat.com> <1412182919-9550-8-git-send-email-stefanha@redhat.com> In-Reply-To: <1412182919-9550-8-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/11] block: let backup blockjob run in BDS AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Fam Zheng 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 > --- > 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