From patchwork Tue Mar 10 02:43:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 448322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 05EC71401AF for ; Tue, 10 Mar 2015 13:44:50 +1100 (AEDT) Received: from localhost ([::1]:46208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVAA1-0004Hc-NV for incoming@patchwork.ozlabs.org; Mon, 09 Mar 2015 22:44:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVA9e-0003pg-Ei for qemu-devel@nongnu.org; Mon, 09 Mar 2015 22:44:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVA9a-0003h6-D0 for qemu-devel@nongnu.org; Mon, 09 Mar 2015 22:44:22 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:34313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVA9Z-0003fY-6W for qemu-devel@nongnu.org; Mon, 09 Mar 2015 22:44:18 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Mar 2015 12:44:11 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 10 Mar 2015 12:44:10 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 6DCCD2CE8055 for ; Tue, 10 Mar 2015 13:44:08 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2A2hwuX42795036 for ; Tue, 10 Mar 2015 13:44:08 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2A2hW5b022146 for ; Tue, 10 Mar 2015 13:43:32 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t2A2hWfA021315; Tue, 10 Mar 2015 13:43:32 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.253.15]) by ozlabs.au.ibm.com (Postfix) with ESMTP id A08D1A00E9; Tue, 10 Mar 2015 13:43:09 +1100 (AEDT) Received: from ka1.ozlabs.ibm.com (ka1.ozlabs.ibm.com [10.61.145.11]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 564B016A9B5; Tue, 10 Mar 2015 13:43:09 +1100 (AEDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Tue, 10 Mar 2015 13:43:07 +1100 Message-Id: <1425955387-26318-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.0.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15031002-0009-0000-0000-000001082977 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.145 Cc: Alexey Kardashevskiy , Paolo Bonzini , Pavel Dovgalyuk Subject: [Qemu-devel] [PATCH] Revert "timer: replace time() with QEMU_CLOCK_HOST" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This reverts commit 2ed1ebcf65edf6757d8904000889ce52cc0a9d1b as it breaks compile when configured with --enable-profiler: /home/alexey/p/qemu/vl.c:710:15: error: 'qemu_time' redeclared as different kind of symbol static time_t qemu_time(void) ^ In file included from /home/alexey/p/qemu/include/block/aio.h:23:0, from /home/alexey/p/qemu/include/hw/hw.h:13, from /home/alexey/p/qemu/vl.c:62: /home/alexey/p/qemu/include/qemu/timer.h:1005:16: note: previous declaration of 'qemu_time' was here extern int64_t qemu_time, qemu_time_start; ^ Signed-off-by: Alexey Kardashevskiy --- I could rename qemu_time() but could not think of any nice and simple name instead so here is revert :) --- vl.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index b47e223..0e59688 100644 --- a/vl.c +++ b/vl.c @@ -707,17 +707,13 @@ void vm_start(void) /***********************************************************/ /* real time host monotonic timer */ -static time_t qemu_time(void) -{ - return qemu_clock_get_ms(QEMU_CLOCK_HOST) / 1000; -} - /***********************************************************/ /* host time/date access */ void qemu_get_timedate(struct tm *tm, int offset) { - time_t ti = qemu_time(); + time_t ti; + time(&ti); ti += offset; if (rtc_date_offset == -1) { if (rtc_utc) @@ -745,7 +741,7 @@ int qemu_timedate_diff(struct tm *tm) else seconds = mktimegm(tm) + rtc_date_offset; - return seconds - qemu_time(); + return seconds - time(NULL); } static void configure_rtc_date_offset(const char *startdate, int legacy) @@ -783,7 +779,7 @@ static void configure_rtc_date_offset(const char *startdate, int legacy) "'2006-06-17T16:01:21' or '2006-06-17'\n"); exit(1); } - rtc_date_offset = qemu_time() - rtc_start_date; + rtc_date_offset = time(NULL) - rtc_start_date; } }