From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJZeV-0002Q1-AV for qemu-devel@nongnu.org; Mon, 28 Jan 2008 14:28:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJZeT-0002PV-Ed for qemu-devel@nongnu.org; Mon, 28 Jan 2008 14:28:18 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJZeT-0002PR-96 for qemu-devel@nongnu.org; Mon, 28 Jan 2008 14:28:17 -0500 Received: from hall.aurel32.net ([88.191.38.19]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JJZeS-0004l2-WB for qemu-devel@nongnu.org; Mon, 28 Jan 2008 14:28:17 -0500 Received: from volta.aurel32.net ([2002:52e8:2fb:1:216:d3ff:fe17:fd00]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JJZeR-0001KY-Hw for qemu-devel@nongnu.org; Mon, 28 Jan 2008 20:28:15 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.68) (envelope-from ) id 1JJZeZ-0004z1-7K for qemu-devel@nongnu.org; Mon, 28 Jan 2008 20:28:23 +0100 Date: Mon, 28 Jan 2008 20:28:23 +0100 From: Aurelien Jarno Message-ID: <20080128192823.GA19137@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Do not set RTC frequency if already set 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 Do not set RTC frequency to 1024 or warn about this if it has already been set to the correct value. --- vl.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/vl.c b/vl.c index 8c63ad9..2d494c5 100644 --- a/vl.c +++ b/vl.c @@ -1307,11 +1307,14 @@ static void hpet_stop_timer(struct qemu_alarm_timer *t) static int rtc_start_timer(struct qemu_alarm_timer *t) { int rtc_fd; + unsigned long current_rtc_freq = 0; TFR(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"); -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net