qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/9] main-loop: introduce a main_loop_quit() fun


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/9] main-loop: introduce a main_loop_quit() function
Date: Wed, 20 Feb 2013 10:13:23 -0600
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Paolo Bonzini <address@hidden> writes:

> Il 20/02/2013 16:32, Anthony Liguori ha scritto:
>> diff --git a/main-loop.c b/main-loop.c
>> index 6f52ac3..d433c45 100644
>> --- a/main-loop.c
>> +++ b/main-loop.c
>> @@ -392,6 +392,19 @@ static int os_host_main_loop_wait(uint32_t timeout)
>>  }
>>  #endif
>>  
>> +static bool do_main_loop_quit;
>> +
>> +bool main_loop_should_quit(void)
>> +{
>> +    return do_main_loop_quit;
>> +}
>> +
>> +void main_loop_quit(void)
>> +{
>> +    do_main_loop_quit = true;
>> +    qemu_notify_event();
>> +}
>> +
>>  int main_loop_wait(int nonblocking)
>>  {
>>      int ret;
>
> Why not keep this as main_loop_should_exit() in vl.c?
>
> qemu-nbd.c for example has its own logic to exit the loop.

We should standardize on main_loop_quit() as the mechanism to exit the
main loop.

This is in line with glib and pretty much every other main loop
implementation out there.

Regards,

Anthony Liguori

>
> Paolo




reply via email to

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