[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount.
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount. |
Date: |
Thu, 18 Jul 2013 18:26:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
Il 18/07/2013 18:23, Frederic Konrad ha scritto:
> On 18/07/2013 17:36, Paolo Bonzini wrote:
>> Il 18/07/2013 17:02, address@hidden ha scritto:
>>> From: KONRAD Frederic <address@hidden>
>>>
>>> This bases rt_clock on icount, as vm_clock.
>>> So vm_clock = rt_clock.
>>>
>>> Signed-off-by: KONRAD Frederic <address@hidden>
>>> ---
>>> qemu-timer.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/qemu-timer.c b/qemu-timer.c
>>> index b2d95e2..6c607e5 100644
>>> --- a/qemu-timer.c
>>> +++ b/qemu-timer.c
>>> @@ -401,7 +401,11 @@ int64_t qemu_get_clock_ns(QEMUClock *clock)
>>> switch(clock->type) {
>>> case QEMU_CLOCK_REALTIME:
>>> - return get_clock();
>>> + if (use_icount) {
>>> + return cpu_get_icount();
>>> + } else {
>>> + return get_clock();
>>> + }
>>> default:
>>> case QEMU_CLOCK_VIRTUAL:
>>> if (use_icount) {
>>>
>> rt_clock is very little used in general. You should use "-rtc clock=vm"
>> if you want to base the RTC on vm_clock.
>>
>> Paolo
>
> True but it seems used in some place:
>
> For example: ui/console.c:
> ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds);
>
> Maybe it can cause trouble no?
In theory it is only used in places where it shouldn't cause trouble
(those that do should use the similarly named rtc_clock variable).
Paolo