qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
@ 2014-10-26  9:32 Jan Kiszka
  2014-10-26  9:42 ` Gonglei
  2014-10-27 14:18 ` Peter Maydell
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2014-10-26  9:32 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, Stefan Hajnoczi, Gonglei

[-- Attachment #1: Type: text/plain, Size: 794 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks
debuggability of qemu.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Feel free to apply this before or after "Make qemu_shutdown_requested
signal-safe".

 main-loop.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/main-loop.c b/main-loop.c
index d2e64f1..53393a4 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -84,9 +84,6 @@ static int qemu_signal_init(void)
     sigaddset(&set, SIGIO);
     sigaddset(&set, SIGALRM);
     sigaddset(&set, SIGBUS);
-    sigaddset(&set, SIGINT);
-    sigaddset(&set, SIGHUP);
-    sigaddset(&set, SIGTERM);
     pthread_sigmask(SIG_BLOCK, &set, NULL);
 
     sigdelset(&set, SIG_IPI);
-- 
1.8.4.5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
  2014-10-26  9:32 [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously" Jan Kiszka
@ 2014-10-26  9:42 ` Gonglei
  2014-10-27 14:18 ` Peter Maydell
  1 sibling, 0 replies; 6+ messages in thread
From: Gonglei @ 2014-10-26  9:42 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Peter Maydell, qemu-devel, Stefan Hajnoczi, Paolo Bonzini,
	Alex Bennée, Gonglei

On 2014/10/26 17:32, Jan Kiszka wrote:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks
> debuggability of qemu.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 

Thanks, please add my 'Reported-by' tag and

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

> Feel free to apply this before or after "Make qemu_shutdown_requested
> signal-safe".
> 
>  main-loop.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/main-loop.c b/main-loop.c
> index d2e64f1..53393a4 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -84,9 +84,6 @@ static int qemu_signal_init(void)
>      sigaddset(&set, SIGIO);
>      sigaddset(&set, SIGALRM);
>      sigaddset(&set, SIGBUS);
> -    sigaddset(&set, SIGINT);
> -    sigaddset(&set, SIGHUP);
> -    sigaddset(&set, SIGTERM);
>      pthread_sigmask(SIG_BLOCK, &set, NULL);
>  
>      sigdelset(&set, SIG_IPI);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
  2014-10-26  9:32 [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously" Jan Kiszka
  2014-10-26  9:42 ` Gonglei
@ 2014-10-27 14:18 ` Peter Maydell
  2014-10-27 14:39   ` Paolo Bonzini
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2014-10-27 14:18 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Paolo Bonzini, Alex Bennée, qemu-devel, Stefan Hajnoczi,
	Gonglei

On 26 October 2014 09:32, Jan Kiszka <jan.kiszka@web.de> wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks
> debuggability of qemu.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Feel free to apply this before or after "Make qemu_shutdown_requested
> signal-safe".
>
>  main-loop.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/main-loop.c b/main-loop.c
> index d2e64f1..53393a4 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -84,9 +84,6 @@ static int qemu_signal_init(void)
>      sigaddset(&set, SIGIO);
>      sigaddset(&set, SIGALRM);
>      sigaddset(&set, SIGBUS);
> -    sigaddset(&set, SIGINT);
> -    sigaddset(&set, SIGHUP);
> -    sigaddset(&set, SIGTERM);

I'm planning to apply this patch but with the following
comment added here:
    /* Note that the SIGINT, SIGTERM and SIGHUP signals are not handled
     * via signalfd, and so their handlers will still be invoked
     * asynchronously. This is done so that ^C can be used to interrupt
     * QEMU when it is being run under gdb.
     */

(which does make the commit not a pure revert).

>      pthread_sigmask(SIG_BLOCK, &set, NULL);
>
>      sigdelset(&set, SIG_IPI);
> --
> 1.8.4.5

thanks
-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
  2014-10-27 14:18 ` Peter Maydell
@ 2014-10-27 14:39   ` Paolo Bonzini
  2014-10-27 15:05     ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2014-10-27 14:39 UTC (permalink / raw)
  To: Peter Maydell, Jan Kiszka
  Cc: Alex Bennée, qemu-devel, Stefan Hajnoczi, Gonglei



On 10/27/2014 03:18 PM, Peter Maydell wrote:
> On 26 October 2014 09:32, Jan Kiszka <jan.kiszka@web.de> wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks
>> debuggability of qemu.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>
>> Feel free to apply this before or after "Make qemu_shutdown_requested
>> signal-safe".
>>
>>  main-loop.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/main-loop.c b/main-loop.c
>> index d2e64f1..53393a4 100644
>> --- a/main-loop.c
>> +++ b/main-loop.c
>> @@ -84,9 +84,6 @@ static int qemu_signal_init(void)
>>      sigaddset(&set, SIGIO);
>>      sigaddset(&set, SIGALRM);
>>      sigaddset(&set, SIGBUS);
>> -    sigaddset(&set, SIGINT);
>> -    sigaddset(&set, SIGHUP);
>> -    sigaddset(&set, SIGTERM);
> 
> I'm planning to apply this patch but with the following
> comment added here:
>     /* Note that the SIGINT, SIGTERM and SIGHUP signals are not handled
>      * via signalfd, and so their handlers will still be invoked
>      * asynchronously. This is done so that ^C can be used to interrupt
>      * QEMU when it is being run under gdb.
>      */

What about:

    /* SIGINT cannot be handled via signalfd, so that ^C can be used
     * to interrupt QEMU when it is being run under gdb.  SIGHUP and
     * SIGTERM are also handled asynchronously, even though it is not
     * strictly necessary, because they use the same handler as SIGINT.
     */

> (which does make the commit not a pure revert).
> 
>>      pthread_sigmask(SIG_BLOCK, &set, NULL);
>>
>>      sigdelset(&set, SIG_IPI);
>> --
>> 1.8.4.5
> 
> thanks
> -- PMM
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
  2014-10-27 14:39   ` Paolo Bonzini
@ 2014-10-27 15:05     ` Peter Maydell
  2014-10-27 16:39       ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2014-10-27 15:05 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Alex Bennée, Jan Kiszka, qemu-devel, Stefan Hajnoczi,
	Gonglei

On 27 October 2014 14:39, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 10/27/2014 03:18 PM, Peter Maydell wrote:
>> On 26 October 2014 09:32, Jan Kiszka <jan.kiszka@web.de> wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks
>>> debuggability of qemu.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>
>>> Feel free to apply this before or after "Make qemu_shutdown_requested
>>> signal-safe".
>>>
>>>  main-loop.c | 3 ---
>>>  1 file changed, 3 deletions(-)
>>>
>>> diff --git a/main-loop.c b/main-loop.c
>>> index d2e64f1..53393a4 100644
>>> --- a/main-loop.c
>>> +++ b/main-loop.c
>>> @@ -84,9 +84,6 @@ static int qemu_signal_init(void)
>>>      sigaddset(&set, SIGIO);
>>>      sigaddset(&set, SIGALRM);
>>>      sigaddset(&set, SIGBUS);
>>> -    sigaddset(&set, SIGINT);
>>> -    sigaddset(&set, SIGHUP);
>>> -    sigaddset(&set, SIGTERM);
>>
>> I'm planning to apply this patch but with the following
>> comment added here:
>>     /* Note that the SIGINT, SIGTERM and SIGHUP signals are not handled
>>      * via signalfd, and so their handlers will still be invoked
>>      * asynchronously. This is done so that ^C can be used to interrupt
>>      * QEMU when it is being run under gdb.
>>      */
>
> What about:
>
>     /* SIGINT cannot be handled via signalfd, so that ^C can be used
>      * to interrupt QEMU when it is being run under gdb.  SIGHUP and
>      * SIGTERM are also handled asynchronously, even though it is not
>      * strictly necessary, because they use the same handler as SIGINT.
>      */

Looks good to me, I'll use that wording.

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"
  2014-10-27 15:05     ` Peter Maydell
@ 2014-10-27 16:39       ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-10-27 16:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Alex Bennée, Jan Kiszka, qemu-devel, Stefan Hajnoczi,
	Gonglei

On 27 October 2014 15:05, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 27 October 2014 14:39, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> What about:
>>
>>     /* SIGINT cannot be handled via signalfd, so that ^C can be used
>>      * to interrupt QEMU when it is being run under gdb.  SIGHUP and
>>      * SIGTERM are also handled asynchronously, even though it is not
>>      * strictly necessary, because they use the same handler as SIGINT.
>>      */
>
> Looks good to me, I'll use that wording.

Applied this and the other patch to master, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-27 16:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-26  9:32 [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously" Jan Kiszka
2014-10-26  9:42 ` Gonglei
2014-10-27 14:18 ` Peter Maydell
2014-10-27 14:39   ` Paolo Bonzini
2014-10-27 15:05     ` Peter Maydell
2014-10-27 16:39       ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).