qemu-devel
[Top][All Lists]
Advanced

[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: Thu, 10 Sep 2009 18:44:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

malc <address@hidden> wrote:
> On Thu, 10 Sep 2009, Juan Quintela wrote:
>
>> malc <address@hidden> wrote:
>> > On Thu, 10 Sep 2009, Juan Quintela wrote:
>> >
>> > Point being?
>> >
>> > [..snip..]
>> 
>> See next patch.  We need to put the variable in one struct, we don't
>> want to change everything to read the variable from the struct.
>
> So put the in the _pre vmstate callback (or whatever it's called).
>
>> 
>> And at some point code, timer code have to move to qemu-timer.c code,
>> not in vl.c.
>
> So?

What is the problem with this approach?

ticks_per_sec is not a variable that can _modify_ anybody, it can only
be read by anybody.

I need to move where it lives now, and probably will be moved again in
the near future.

What is your problem with exporting a function that gives us exactly
what we want?

init_timers() <- it initializes it, right to assign to it.
save/load vmstate code <- it needs to set it, obviously.

Everybody else only uses it as a read only value.  What is your problem
with giving the value with _one_ function, one value that you can't
modify in case that you have one error?

I can't see what is your big problem with this patch.  I agree that I
can achieve the movement to one struct with pre_save/post_load, but I
think that this patch is good _independently_ of that.

My goal is having less global variables/state not more.  And your point
to have it as it is today?

Later, Juan.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]