[Lguest] is the code in function async_hcall correct?

Rusty Russell rusty at rustcorp.com.au
Thu Sep 6 02:11:22 EST 2007


On Wed, 2007-09-05 at 10:49 +0300, Morosan Catalin wrote:
> 
> Hi. This is my first ever post on any kernel mailing list so be
> gentle :)
> 
> In lguest.c in the function async_hcall the local variable next_call
> is always 0 and in consequence we always access
> lguest_data.hcall_status[0] and lguest_data.hcalls[0]. 

You missed the word "static" in the declaration: its value is persistent
across calls.

> This code would be correct only if somehow the value of local variable
> next_call is remembered across function calls. If this is the case,
> could you please explain? 

Exactly.  That's what the "static" keyword does to a local variable.

Thanks for the question!
Rusty.




More information about the Lguest mailing list