From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KODc1-0001kP-7V for qemu-devel@nongnu.org; Wed, 30 Jul 2008 11:29:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KODbz-0001jO-DP for qemu-devel@nongnu.org; Wed, 30 Jul 2008 11:29:12 -0400 Received: from [199.232.76.173] (port=56348 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KODbz-0001jL-7m for qemu-devel@nongnu.org; Wed, 30 Jul 2008 11:29:11 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:9880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KODby-0001sI-Sw for qemu-devel@nongnu.org; Wed, 30 Jul 2008 11:29:11 -0400 Message-ID: <48908906.3000508@eu.citrix.com> Date: Wed, 30 Jul 2008 16:30:14 +0100 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] replacing gettimeofday with clock_gettime in hw/serial References: <489040FF.1070601@eu.citrix.com> <200807301428.30863.paul@codesourcery.com> <48907772.5000801@codemonkey.ws> In-Reply-To: <48907772.5000801@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > Paul Brook wrote: >> On Wednesday 30 July 2008, Stefano Stabellini wrote: >> >>> This patch substitutes gettimeofday with clock_gettime in hw/serial.c. >>> >>> gettimeofday is unsafe because can lead to incorrect behaviors if the >>> user >>> changes the system's date. >>> >> >> This code is just plain wrong to start with. Devices should not >> depend on host time. >> > > Because host time continues even when the guest is stopped. It should > instead be based on the vm_clock. > > I don't think it works either. I still have gotten messages in the > guest about too many interrupts on the serial port. > I am sorry, I did a mistake: I have just realized that the serial emulation code in qemu and ioemu under xen are so different that this patch doesn't even apply to qemu. I am so used to send the same patch twice that I haven't realize that until now. I'll try to merge them, if it makes sense.