qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] rename get_clock_realtime
Date: Fri, 20 Jan 2012 12:26:06 +0100	[thread overview]
Message-ID: <4F194F4E.9060901@redhat.com> (raw)
In-Reply-To: <4F194D46.1050501@siemens.com>

On 01/20/2012 12:17 PM, Jan Kiszka wrote:
> On 2012-01-20 12:05, Paolo Bonzini wrote:
>> get_clock_realtime accesses the host_clock, not the rt_clock.
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>> ---
>>   qemu-timer.c |    2 +-
>>   qemu-timer.h |    4 ++--
>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/qemu-timer.c b/qemu-timer.c
>> index cd026c6..4a14a6d 100644
>> --- a/qemu-timer.c
>> +++ b/qemu-timer.c
>> @@ -436,7 +436,7 @@ int64_t qemu_get_clock_ns(QEMUClock *clock)
>>               return cpu_get_clock();
>>           }
>>       case QEMU_CLOCK_HOST:
>> -        now = get_clock_realtime();
>> +        now = get_clock_host();
>>           last = clock->last;
>>           clock->last = now;
>>           if (now<  last) {
>> diff --git a/qemu-timer.h b/qemu-timer.h
>> index de17f3b..b180fca 100644
>> --- a/qemu-timer.h
>> +++ b/qemu-timer.h
>> @@ -93,7 +93,7 @@ static inline int64_t get_ticks_per_sec(void)
>>   }
>>
>>   /* real time host monotonic timer */
>> -static inline int64_t get_clock_realtime(void)
>> +static inline int64_t get_clock_host(void)
>
> It accesses the host realtime clock, so get_clock_host_realtime would be
> optimal. In that light, the comment above should be fixed as well.

Yeah, however, realtime is quite confusing because CLOCK_MONOTONIC is 
part of the "real-time clock API".  The code is much clearer than the 
comment, I'll remove it completely.  v2 on the way.

Paolo

  reply	other threads:[~2012-01-20 11:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 11:05 [Qemu-devel] [PATCH] rename get_clock_realtime Paolo Bonzini
2012-01-20 11:17 ` Jan Kiszka
2012-01-20 11:26   ` Paolo Bonzini [this message]
2012-01-20 11:28     ` [Qemu-devel] [PATCH v2] " Paolo Bonzini
2012-01-20 11:29     ` [Qemu-devel] [PATCH] " Jan Kiszka
2012-01-20 11:39       ` 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=4F194F4E.9060901@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).