From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6hnH-0006wn-Qz for qemu-devel@nongnu.org; Tue, 06 Aug 2013 09:59:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6hn9-0002qO-9C for qemu-devel@nongnu.org; Tue, 06 Aug 2013 09:59:23 -0400 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]:45467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6hn9-0002pB-3g for qemu-devel@nongnu.org; Tue, 06 Aug 2013 09:59:15 -0400 Received: by mail-we0-f172.google.com with SMTP id t61so407714wes.3 for ; Tue, 06 Aug 2013 06:59:14 -0700 (PDT) Date: Tue, 6 Aug 2013 15:59:11 +0200 From: Stefan Hajnoczi Message-ID: <20130806135911.GA4373@stefanha-thinkpad.redhat.com> References: <1375639805-1943-1-git-send-email-alex@alex.org.uk> <1375780592-22842-1-git-send-email-alex@alex.org.uk> <1375780592-22842-2-git-send-email-alex@alex.org.uk> <20130806120218.GB30812@stefanha-thinkpad.redhat.com> <5670B9E860CD8E64631E0BE3@nimrod.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5670B9E860CD8E64631E0BE3@nimrod.local> Subject: Re: [Qemu-devel] [RFC] [PATCHv6 01/16] aio / timers: add qemu-timer.c utility functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , qemu-devel@nongnu.org, liu ping fan , Stefan Hajnoczi , Paolo Bonzini , MORITA Kazutaka , rth@twiddle.net On Tue, Aug 06, 2013 at 01:30:18PM +0100, Alex Bligh wrote: > --On 6 August 2013 14:02:18 +0200 Stefan Hajnoczi > wrote: > My preference would be to move these to qemu_clock_deadline_ns (without > the INT32_MAX check) and delete the old qemu_clock_deadline routine > entirely, but I don't really understand the full set of circumstances > in which the qtest routines are meant to work. Okay, that's excellent. It would be great to move to a single function. The way qtest works is that it executes QEMU in a mode that does not run guest code. Instead of running guest code it listens for commands over a socket. The wire protocol can peek/poke memory, notify of interrupts, and warp the clock. There are test cases that use qtest to test emulated devices. When qtest either steps the clock or sets it to a completely new value using qtest_clock_warp() it runs all vm_clock timers that should expire before the new time. Does this help? > >Please include > >an explanation of why qemu_timeout_ns_to_ms() will be needed in the > >future (there are no callers in this patch). > > You mean in the commit text as well as the following? > > +/* Transition function to convert a nanosecond timeout to ms > + * This is used where a system does not support ppoll > + */ Usually a doc comment is enough since it explains what the function does. If it's a low-level function is may be necessary to give more context in the commit description. Stefan