From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAdnt-0005V3-UM for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:09:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAdnn-0002Lo-VR for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:09:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAdnn-0002LV-OO for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:08:59 -0500 Message-ID: <54B3B94D.4000001@redhat.com> Date: Mon, 12 Jan 2015 13:08:45 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150112115944.3504.66763.stgit@PASHA-ISP> <20150112120100.3504.6785.stgit@PASHA-ISP> In-Reply-To: <20150112120100.3504.6785.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v7 13/21] replay: recording and replaying different timers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, afaerber@suse.de, fred.konrad@greensocs.com On 12/01/2015 13:01, Pavel Dovgalyuk wrote: > + if (replay_mode == REPLAY_MODE_RECORD) { > + qemu_get_timedate_no_warning(&tm, 0); > + replay_save_tm(&tm); > + } else if (replay_mode == REPLAY_MODE_PLAY) { > + replay_read_tm(&tm); > + } else { > + qemu_get_timedate_no_warning(&tm, 0); > + } > Can this be encapsulated in a simple function replay_get_timedate? I think the fewest replay_mode checks you have outside replay/, the better. Paolo