From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlxeY-0005Bl-NT for qemu-devel@nongnu.org; Tue, 13 Oct 2015 07:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlxeX-0004eR-Sd for qemu-devel@nongnu.org; Tue, 13 Oct 2015 07:21:58 -0400 Date: Tue, 13 Oct 2015 13:21:47 +0200 From: Kevin Wolf Message-ID: <20151013112147.GI4906@noname.str.redhat.com> References: <1444731375-14716-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444731375-14716-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: pbonzini@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Am 13.10.2015 um 12:16 hat Fam Zheng geschrieben: > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > block_job_cb is called by block_job_completed, which is always called in > a main loop bottom half in existing block jobs. So we don't need to > worry about thread-safety here. > > Signed-off-by: Fam Zheng > --- > blockdev.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/blockdev.c b/blockdev.c > index 32b04b4..130b7fb 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2248,11 +2248,6 @@ out: > > static void block_job_cb(void *opaque, int ret) > { > - /* Note that this function may be executed from another AioContext besides > - * the QEMU main loop. If you need to access anything that assumes the > - * QEMU global mutex, use a BH or introduce a mutex. > - */ > - > BlockDriverState *bs = opaque; > const char *msg = NULL; Should we instead add a comment that tells you that you _have_ to use that bottom half because block jobs can be running in an I/O thread? Kevin