Received: from eggs.gnu.org ([140.186.70.92]:48120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9ahs-0002hP-Ur for qemu-devel@nongnu.org; Fri, 30 Sep 2011 06:52:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9ahr-0002jm-Tt for qemu-devel@nongnu.org; Fri, 30 Sep 2011 06:52:40 -0400 Received: from gw.ac.upc.edu ([147.83.30.3]:33346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9ahr-0002ge-Mf for qemu-devel@nongnu.org; Fri, 30 Sep 2011 06:52:39 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1317141111-27701-1-git-send-email-pbonzini@redhat.com> <1317141111-27701-4-git-send-email-pbonzini@redhat.com> Date: Fri, 30 Sep 2011 12:52:34 +0200 In-Reply-To: <1317141111-27701-4-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Tue, 27 Sep 2011 18:31:42 +0200") Message-ID: <87ipoa5mkt.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 03/12] qemu-timer: more clock functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini writes: > These will be used when moving icount accounting to cpus.c. I have something related to this kind of refactoring. While trying to understand all the timing facilities in QEMU, I wrote some (unfinished) patches that try to disentangle much of the code in qemu-timer into two new files: - qemu-htime: Provides routines related to time in the host. - qemu-vtime: Provides routines related to time in the guest. These patches also try to sanitize some routine names by making their domain and units explicit (e.g., get_clock becomes qemu_htime_nsec and cpu_get_ticks becomes qemu_vtime_tsc). The patches also make the frequency explicit (adds qemu_htime_freq and qemu_vtime_freq). The result should provide code that makes it very clear on which time domain and frequency the code is operating on. The routines in qemu-timer should be already moved into the corresponding qemu-*time files (I no longer remember on which state I left it), but the routine name sanitizing is not finished, mostly because I still had to clear out some details about how the current deadline calculation works. Does this kind of refactoring sound interesting? Thanks, Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth