[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create g
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function |
Date: |
Fri, 11 Sep 2009 12:15:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Jan Kiszka <address@hidden> wrote:
> Juan Quintela wrote:
>> Jan Kiszka <address@hidden> wrote:
>>> Juan Quintela wrote:
>>>> Signed-off-by: Juan Quintela <address@hidden>
>>> [...]
>>>
>>>> diff --git a/vl.c b/vl.c
>>>> index 448ec6c..33abef2 100644
>>>> --- a/vl.c
>>>> +++ b/vl.c
>>>> @@ -186,7 +186,7 @@ enum vga_retrace_method vga_retrace_method =
>>>> VGA_RETRACE_DUMB;
>>>> static DisplayState *display_state;
>>>> DisplayType display_type = DT_DEFAULT;
>>>> const char* keyboard_layout = NULL;
>>>> -int64_t ticks_per_sec;
>>>> +static int64_t ticks_per_sec;
>>>> ram_addr_t ram_size;
>>>> int nb_nics;
>>>> NICInfo nd_table[MAX_NICS];
>>>> @@ -1032,6 +1032,11 @@ int64_t qemu_get_clock(QEMUClock *clock)
>>>> }
>>>> }
>>>>
>>>> +int64_t get_ticks_per_sec(void)
>>>> +{
>>>> + return ticks_per_sec;
>>>> +}
>>>> +
>>> This refactoring would be even more useful if that one became
>>>
>>> static inline int64_t get_ticks_per_sec(void)
>>> {
>>> return QEMU_CLOCK_BASE;
>>> }
>>>
>>> Right now we don't have a use for the ticks_per_sec /variable/, it's
>>> always constant. Your interface does not prevent changing this in the
>>> future, though, which is just like it should be.
>>
>> I liked this one on top.
>
> Why?
Because that is how we use it. Mine is refactoring, yours is changing
behavior. With my patch, it is still possible to change ticks_per_sec
(not that this is a good idea, but that is how the code is today). With
yours, you remove that feature. I fully agree with your change.
In my book that are _two_ patches.
Later, Juan.
[Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function, Jan Kiszka, 2009/09/11
[Qemu-devel] [PATCH 07/26] timers: move them to VMState, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 08/26] vmstate: add sensible arguments to vmstate_unregister(), Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 09/26] vmstate: rename run_after_load() -> post_load(), Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 10/26] vmstate: Add pre_load() hook, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 11/26] vmstate: Add pre/post_save() hooks, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 12/26] vmstate: port cpu_comon, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 14/26] vmstate: port i8259 device, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 13/26] vmstate: port fw_cfg device, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 15/26] vmstate: add support for uint8_t equal, Juan Quintela, 2009/09/09