Received: from eggs.gnu.org ([2001:4830:134:3::10]:45338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIC1x-0007R2-2q for qemu-devel@nongnu.org; Wed, 29 Jun 2016 05:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIC1t-0004Ls-LH for qemu-devel@nongnu.org; Wed, 29 Jun 2016 05:43:36 -0400 Received: from mail.ispras.ru ([83.149.199.45]:40542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIC1t-0004I3-Dj for qemu-devel@nongnu.org; Wed, 29 Jun 2016 05:43:33 -0400 From: "Pavel Dovgalyuk" References: <20160608051352.1688.7877.stgit@PASHA-ISP> <20160608051404.1688.65453.stgit@PASHA-ISP> <257976361.20784345.1465381879882.JavaMail.zimbra@redhat.com> <001201d1cabc$b1b003e0$15100ba0$@ru> In-Reply-To: <001201d1cabc$b1b003e0$15100ba0$@ru> Date: Wed, 29 Jun 2016 12:43:21 +0300 Message-ID: <001701d1d1ea$ad252460$076f6d20$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH 2/3] replay: allow replay stopping and restarting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Pavel Dovgalyuk' , 'Paolo Bonzini' Cc: qemu-devel@nongnu.org, jasowang@redhat.com, agraf@suse.de, david@gibson.dropbear.id.au Ping? Pavel Dovgalyuk > -----Original Message----- > From: Pavel Dovgalyuk [mailto:dovgaluk@ispras.ru] > Sent: Monday, June 20, 2016 9:27 AM > To: 'Paolo Bonzini'; 'Pavel Dovgalyuk' > Cc: qemu-devel@nongnu.org; jasowang@redhat.com; agraf@suse.de; david@gibson.dropbear.id.au > Subject: RE: [PATCH 2/3] replay: allow replay stopping and restarting > > > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > > > From: "Pavel Dovgalyuk" > > > This patch fixes bug with stopping and restarting replay > > > through monitor. > > > > > > Signed-off-by: Pavel Dovgalyuk > > > --- > > > block/blkreplay.c | 18 +++++++++++++----- > > > cpus.c | 1 + > > > include/sysemu/replay.h | 2 ++ > > > replay/replay-internal.h | 2 -- > > > vl.c | 1 + > > > 5 files changed, 17 insertions(+), 7 deletions(-) > > > > > > diff --git a/block/blkreplay.c b/block/blkreplay.c > > > index 42f1813..438170c 100644 > > > --- a/block/blkreplay.c > > > +++ b/block/blkreplay.c > > > @@ -70,6 +70,14 @@ static void blkreplay_bh_cb(void *opaque) > > > g_free(req); > > > } > > > > > > +static uint64_t blkreplay_next_id(void) > > > +{ > > > + if (replay_events_enabled()) { > > > + return request_id++; > > > + } > > > + return 0; > > > +} > > > > What happens if 0 is returned? > > It could be any value. When replay events are disables, > it means that either replay is disabled or execution is stopped. > In first case we won't pass this requests through the replay queue > and therefore id is useless. > In stopped mode we have to keep request_id unchanged to make > record/replay deterministic. > > > I think that you want to call > > replay_disable_events... > > > > > bdrv_drain_all(); > > > > ... after this bdrv_drain_all. > > Why? We disable replay events to avoid adding new block requests > to the queue. How this is related to drain all? > > > > > I was going to suggest using qemu_add_vm_change_state_handler > > in replay_start (which could have replaced the existing call > > to replay_enable_events), but that's not possible if you have > > to do your calls after bdrv_drain_all. > > Pavel Dovgalyuk