From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDC3V-00019J-AX for qemu-devel@nongnu.org; Thu, 18 Oct 2018 13:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDC3S-0007Av-4a for qemu-devel@nongnu.org; Thu, 18 Oct 2018 13:25:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55946) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDC3R-0007AF-Rv for qemu-devel@nongnu.org; Thu, 18 Oct 2018 13:25:50 -0400 References: From: Paolo Bonzini Message-ID: Date: Thu, 18 Oct 2018 19:25:45 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] Optimize record/replay checkpointing for all clocks it applies to List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artem Pisarenko Cc: Pavel Dovgalyuk , qemu-devel@nongnu.org On 18/10/2018 19:10, Artem Pisarenko wrote: > >> No, you're right. The if should remain in the caller, or >> need_replay_checkpoint must be initialized with replay_mode. > > If initialize 'need_replay_checkpoint', then it should also account for > clock != QEMU_CLOCK_REALTIME. Or you just get a unlock/lock pair for QEMU_CLOCK_REALTIME (which should really never happen if e.g. you have no UI). > And here we come to what if+switch block > actually (mostly) does in my version. Finally, you will get duplication > of this whole condition usage between source function and extracted > function, which isn't nice. > Why do you want to split up such tightly coupled code? Because it's *too* coupled and not very readable. Paolo