From patchwork Thu May 4 08:42:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 758428 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 3wJTG274sJz9rxj for ; Thu, 4 May 2017 18:48:42 +1000 (AEST) Received: from localhost ([::1]:40474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CRE-00015t-Gg for incoming@patchwork.ozlabs.org; Thu, 04 May 2017 04:48:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CL8-0003vs-0T for qemu-devel@nongnu.org; Thu, 04 May 2017 04:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6CL4-0006na-Ue for qemu-devel@nongnu.org; Thu, 04 May 2017 04:42:22 -0400 Received: from mail.ispras.ru ([83.149.199.45]:42398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6CL4-0006mh-MN for qemu-devel@nongnu.org; Thu, 04 May 2017 04:42:18 -0400 Received: from [10.10.150.19] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id C8ACC540092; Thu, 4 May 2017 11:42:17 +0300 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 04 May 2017 11:42:22 +0300 Message-ID: <20170504084221.7488.13443.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 08/10] replay: make safe vmstop at record/replay 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" This patch disables bdrv flush/drain in record/replay mode. When block request is in the replay queue it cannot be processed with drain/flush until it is found in the log. Therefore vm should just stop leaving unfinished operations in the queue. Signed-off-by: Pavel Dovgalyuk --- cpus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpus.c b/cpus.c index 740b8dc3f8..f21e7f3166 100644 --- a/cpus.c +++ b/cpus.c @@ -932,9 +932,10 @@ static int do_vm_stop(RunState state) qapi_event_send_stop(&error_abort); } - bdrv_drain_all(); - replay_disable_events(); - ret = bdrv_flush_all(); + if (!replay_events_enabled()) { + bdrv_drain_all(); + ret = bdrv_flush_all(); + } return ret; }