Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1ChStR-0002BW-15 for qemu-devel@nongnu.org; Thu, 23 Dec 2004 08:20:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1ChStO-0002AA-8T for qemu-devel@nongnu.org; Thu, 23 Dec 2004 08:20:35 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ChStN-00029w-Nt for qemu-devel@nongnu.org; Thu, 23 Dec 2004 08:20:34 -0500 Received: from [192.25.206.10] (helo=gluck.debian.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ChSiX-0006el-TI for qemu-devel@nongnu.org; Thu, 23 Dec 2004 08:09:22 -0500 Date: Thu, 23 Dec 2004 14:09:30 +0100 From: Guillem Jover Message-ID: <20041223130930.GB776@zulo.hadrons.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline Sender: Guillem Jover Subject: [Qemu-devel] [patch] Do not print RTC frequency warning if it's already ok 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 --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, This is a patch for a bug reported in Debian. It now only prints the RTC frequency warning when the current value is different than the one wanted. Patch attached. regards, guillem --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-0.6.1_not_print_rtc_freq_if_ok.patch" Package: qemu Version: 0.6.1 Author: Guillem Jover Status: not-applied Description: Do not print warning if the current RTC frequency is ok. diff -Naur qemu-0.6.1.orig/vl.c qemu-0.6.1/vl.c --- qemu-0.6.1.orig/vl.c 2004-11-14 21:51:33.000000000 +0100 +++ qemu-0.6.1/vl.c 2004-11-27 19:03:44.000000000 +0100 @@ -852,10 +852,14 @@ static int start_rtc_timer(void) { + unsigned long current_rtc_freq = 0; + rtc_fd = open("/dev/rtc", O_RDONLY); if (rtc_fd < 0) return -1; - if (ioctl(rtc_fd, RTC_IRQP_SET, RTC_FREQ) < 0) { + ioctl(rtc_fd, RTC_IRQP_READ, ¤t_rtc_freq); + if (current_rtc_freq != RTC_FREQ && + ioctl(rtc_fd, RTC_IRQP_SET, RTC_FREQ) < 0) { fprintf(stderr, "Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a fatal\n" "error, but for better emulation accuracy either use a 2.6 host Linux kernel or\n" "type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.\n"); --8P1HSweYDcXXzwPJ--