Received: from eggs.gnu.org ([2001:4830:134:3::10]:55478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9kyD-0006R2-Nr for qemu-devel@nongnu.org; Fri, 09 Jan 2015 20:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9kyA-0002h3-ID for qemu-devel@nongnu.org; Fri, 09 Jan 2015 20:36:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9kyA-0002gs-Bv for qemu-devel@nongnu.org; Fri, 09 Jan 2015 20:36:02 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0A1a0wo002408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 9 Jan 2015 20:36:00 -0500 Date: Sat, 10 Jan 2015 09:35:57 +0800 From: Fam Zheng Message-ID: <20150110013557.GD8570@fam-t430.nay.redhat.com> References: <1420711408-15766-1-git-send-email-pbonzini@redhat.com> <20150109021046.GA6087@fam-t430.nay.redhat.com> <54AF9A34.9090207@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54AF9A34.9090207@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/4] qemu-timer: introduce usable pointer-free API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Fri, 01/09 10:07, Paolo Bonzini wrote: > > > On 09/01/2015 03:10, Fam Zheng wrote: > > On Thu, 01/08 11:03, Paolo Bonzini wrote: > >> The current pointer free API for timers is very low level. Introduce > >> a new API that matches timer_new_ns/us/ms and also a new API timer_deinit > >> that can be used instead of timer_free. > >> > >> Finally, mechanically change timer macro names in vmstate, to make it > >> clear that they accept a pointer. > >> > >> This prepares for conversion of timers from QEMUTimer * to QEMUTimer. > > > > Novice question: what's the advantage, please? > > No need to free them, so no memory leaks. From a quick look I found two > (hw/net/pcnet.c and hw/char/serial.c). > > Also it matches more recent device model APIs like memory regions or > throttling. Get it! Thanks. Fam