From patchwork Thu May 4 08:41:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 758423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wJT916pPjz9ryZ for ; Thu, 4 May 2017 18:44:21 +1000 (AEST) Received: from localhost ([::1]:40444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CN1-0005FF-9a for incoming@patchwork.ozlabs.org; Thu, 04 May 2017 04:44:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CKl-0003Td-Jx for qemu-devel@nongnu.org; Thu, 04 May 2017 04:42:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6CKi-0006OX-HN for qemu-devel@nongnu.org; Thu, 04 May 2017 04:41:59 -0400 Received: from mail.ispras.ru ([83.149.199.45]:42306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CKi-0006OB-9O for qemu-devel@nongnu.org; Thu, 04 May 2017 04:41:56 -0400 Received: from [10.10.150.19] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 6FC1C540072; Thu, 4 May 2017 11:41:55 +0300 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 04 May 2017 11:41:59 +0300 Message-ID: <20170504084159.7488.97487.stgit@PASHA-ISP> In-Reply-To: <20170504084135.7488.24715.stgit@PASHA-ISP> References: <20170504084135.7488.24715.stgit@PASHA-ISP> User-Agent: StGit/0.16 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH v9 04/10] replay: fix processing async events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, quintela@redhat.com, jasowang@redhat.com, mst@redhat.com, dovgaluk@ispras.ru, kraxel@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk Asynchronous events saved at checkpoints may invoke callbacks when processed. These callbacks may also generate/read new events (e.g. clock reads). Therefore event processing flag must be reset before callback invocation. Signed-off-by: Pavel Dovgalyuk --- replay/replay-events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replay/replay-events.c b/replay/replay-events.c index 94a6dcccfc..768b505f3d 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -295,13 +295,13 @@ void replay_read_events(int checkpoint) if (!event) { break; } + replay_finish_event(); + read_event_kind = -1; replay_mutex_unlock(); replay_run_event(event); replay_mutex_lock(); g_free(event); - replay_finish_event(); - read_event_kind = -1; } }