From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hqyp4-0000Tt-5b for qemu-devel@nongnu.org; Wed, 23 May 2007 17:56:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hqyp2-0000TZ-OP for qemu-devel@nongnu.org; Wed, 23 May 2007 17:56:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqyp2-0000TT-AG for qemu-devel@nongnu.org; Wed, 23 May 2007 17:56:44 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hqyp1-00083z-Mo for qemu-devel@nongnu.org; Wed, 23 May 2007 17:56:44 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Timers Date: Wed, 23 May 2007 22:56:39 +0100 References: <200705230107.00962.paul@codesourcery.com> <200705232048.16793.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705232256.40404.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl > > Code looks reasonable to me. The FIXME means you're changing the timer > > parameters after starting the timer. I didn't check whether this does > > anything sensible (this may depend on the device), hence the message. > > It probably needs some attention when reload == 1 && s->enabled. > > > > Note that save/restore is not implemented. You may wish to implement > > this > > I was thinking that it should be possible to save/restore all vm_clock > based timers in qemu at QEMUTimer level so that hardware emulation > doesn't have to bother restoring this. (the "ptimer" would still need > to save its internal fields). The problem is that the timer itself doesn't know which device it is attached to. There's no way to ensure that the state is loaded into the correct timers. Remember that qemu can be restarted (and all timers reallocated) in between the save and the load. There are already qemu_put_timer and qemu_get_timer routines. I notice that the existing slavio_timer_{save,load} don't use these, so are probably already broken. Paul