From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afLRv-0000mQ-Lf for qemu-devel@nongnu.org; Mon, 14 Mar 2016 01:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afLRs-0004ij-Eb for qemu-devel@nongnu.org; Mon, 14 Mar 2016 01:53:51 -0400 Received: from mail.ispras.ru ([83.149.199.45]:47794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afLRs-0004if-6n for qemu-devel@nongnu.org; Mon, 14 Mar 2016 01:53:48 -0400 From: "Pavel Dovgalyuk" References: <20160310115551.4812.55431.stgit@PASHA-ISP> <20160310115620.4812.87175.stgit@PASHA-ISP> <20160311135959.GB26287@stefanha-x1.localdomain> In-Reply-To: <20160311135959.GB26287@stefanha-x1.localdomain> Date: Mon, 14 Mar 2016 08:53:47 +0300 Message-ID: <002801d17db5$e0324b00$a096e100$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH v4 5/5] replay: introduce block devices record/replay List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Stefan Hajnoczi' , 'Pavel Dovgalyuk' Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, igor.rubinov@gmail.com, mark.burton@greensocs.com, real@ispras.ru, hines@cert.org, qemu-devel@nongnu.org, maria.klimushenkova@ispras.ru, kwolf@redhat.com, pbonzini@redhat.com, batuzovk@ispras.ru, alex.bennee@linaro.org, fred.konrad@greensocs.com > From: Stefan Hajnoczi [mailto:stefanha@redhat.com] > On Thu, Mar 10, 2016 at 02:56:20PM +0300, Pavel Dovgalyuk wrote: > > +static void block_request_create(uint64_t reqid, BlockDriverState *bs, > > + Coroutine *co) > > +{ > > + Request *req = g_new(Request, 1); > > + *req = (Request) { > > + .co = co, > > + .bh = aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req), > > + }; > > + replay_block_event(req->bh, reqid); > > Regarding thread safety: is replay_block_event() thread-safe? It is. Replay module has its own mutex for file and data structures protection. > > If QEMU runs with IOThreads then this might not be called under the QEMU > global mutex. Pavel Dovgalyuk