From patchwork Thu Jul 31 12:55:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 375265 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 7DF0B140132 for ; Thu, 31 Jul 2014 23:03:43 +1000 (EST) Received: from localhost ([::1]:56391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCq1F-0003jq-Ku for incoming@patchwork.ozlabs.org; Thu, 31 Jul 2014 09:03:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCpt3-0006Sg-1T for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCpsw-0005eF-UO for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:12 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCpsw-0005cT-HR for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:06 -0400 Received: from PASHA-ISP.novsu.ac.ru (unknown [80.250.189.177]) by mail.ispras.ru (Postfix) with ESMTPSA id A5489540157; Thu, 31 Jul 2014 16:55:05 +0400 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 31 Jul 2014 16:55:09 +0400 Message-ID: <20140731125509.1600.53110.stgit@PASHA-ISP.novsu.ac.ru> In-Reply-To: <20140731125321.1600.46604.stgit@PASHA-ISP.novsu.ac.ru> References: <20140731125321.1600.46604.stgit@PASHA-ISP.novsu.ac.ru> User-Agent: StGit/0.16 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.45 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [RFC PATCH v3 18/49] replay: global variables and function stubs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds global variables, defines, functions declarations, and function stubs for deterministic VM replay used by external modules. Signed-off-by: Pavel Dovgalyuk --- Makefile.target | 1 + qapi-schema.json | 32 ++++++++++++++++++++++++++++++++ replay/Makefile.objs | 1 + replay/replay.c | 25 +++++++++++++++++++++++++ replay/replay.h | 23 +++++++++++++++++++++++ stubs/Makefile.objs | 1 + stubs/replay.c | 8 ++++++++ 7 files changed, 91 insertions(+), 0 deletions(-) create mode 100755 replay/Makefile.objs create mode 100755 replay/replay.c create mode 100755 replay/replay.h create mode 100755 stubs/replay.c diff --git a/Makefile.target b/Makefile.target index 137d0b0..9830313 100644 --- a/Makefile.target +++ b/Makefile.target @@ -76,6 +76,7 @@ all: $(PROGS) stap ######################################################### # cpu emulator library obj-y = exec.o translate-all.o cpu-exec.o +obj-y += replay/ obj-y += tcg/tcg.o tcg/optimize.o obj-$(CONFIG_TCG_INTERPRETER) += tci.o obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o diff --git a/qapi-schema.json b/qapi-schema.json index b11aad2..2de14c4 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3480,3 +3480,35 @@ # Since: 2.1 ## { 'command': 'rtc-reset-reinjection' } + +## +# ReplayMode: +# +# Mode of the replay subsystem. +# +# @none: normal execution mode. Replay or record are not enabled. +# +# @record: record mode. All non-deterministic data is written into the +# replay log. +# +# @play: replay mode. Non-deterministic data required for system execution +# is read from the log. +# +# Since: 2.2 +## +{ 'enum': 'ReplayMode', + 'data': [ 'none', 'record', 'play' ] } + +## +# ReplaySubmode: +# +# Submode of the replay subsystem. +# +# @unknown: used for modes different from play. +# +# @normal: normal replay mode. +# +# Since: 2.2 +## +{ 'enum': 'ReplaySubmode', + 'data': [ 'unknown', 'normal' ] } diff --git a/replay/Makefile.objs b/replay/Makefile.objs new file mode 100755 index 0000000..7ea860f --- /dev/null +++ b/replay/Makefile.objs @@ -0,0 +1 @@ +obj-y += replay.o diff --git a/replay/replay.c b/replay/replay.c new file mode 100755 index 0000000..ac976b2 --- /dev/null +++ b/replay/replay.c @@ -0,0 +1,25 @@ +/* + * replay.c + * + * Copyright (c) 2010-2014 Institute for System Programming + * of the Russian Academy of Sciences. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "replay.h" + +ReplayMode replay_mode = REPLAY_MODE_NONE; +/*! Stores current submode for PLAY mode */ +ReplaySubmode play_submode = REPLAY_SUBMODE_UNKNOWN; + +/* Suffix for the disk images filenames */ +char *replay_image_suffix; + + +ReplaySubmode replay_get_play_submode(void) +{ + return play_submode; +} diff --git a/replay/replay.h b/replay/replay.h new file mode 100755 index 0000000..51a18fe --- /dev/null +++ b/replay/replay.h @@ -0,0 +1,23 @@ +#ifndef REPLAY_H +#define REPLAY_H + +/* + * replay.h + * + * Copyright (c) 2010-2014 Institute for System Programming + * of the Russian Academy of Sciences. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qapi-types.h" + +extern ReplayMode replay_mode; +extern char *replay_image_suffix; + +/*! Returns replay play submode */ +ReplaySubmode replay_get_play_submode(void); + +#endif diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 528e161..b90c60a 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -26,6 +26,7 @@ stub-obj-y += notify-event.o stub-obj-y += pci-drive-hot-add.o stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o stub-obj-y += qtest.o +stub-obj-y += replay.o stub-obj-y += reset.o stub-obj-y += runstate-check.o stub-obj-y += set-fd-handler.o diff --git a/stubs/replay.c b/stubs/replay.c new file mode 100755 index 0000000..b146d55 --- /dev/null +++ b/stubs/replay.c @@ -0,0 +1,8 @@ +#include "replay/replay.h" + +ReplayMode replay_mode; + +ReplaySubmode replay_get_play_submode(void) +{ + return 0; +}