qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Subject: [Qemu-devel] [PATCH] Revert "timer: replace time() with QEMU_CLOCK_HOST"
Date: Tue, 10 Mar 2015 13:43:07 +1100	[thread overview]
Message-ID: <1425955387-26318-1-git-send-email-aik@ozlabs.ru> (raw)

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 <aik@ozlabs.ru>
---


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;
     }
 }
 
-- 
2.0.0

             reply	other threads:[~2015-03-10  2:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  2:43 Alexey Kardashevskiy [this message]
2015-03-10 11:05 ` [Qemu-devel] [PATCH] Revert "timer: replace time() with QEMU_CLOCK_HOST" Paolo Bonzini
2015-03-10 11:49   ` Alexey Kardashevskiy
2015-03-10 11:54     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425955387-26318-1-git-send-email-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).