qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 10/14] monitor/hmp: Explicit we ignore a QEMUChrEvent in IOEventHandler
Date: Tue, 17 Dec 2019 18:46:07 +0100	[thread overview]
Message-ID: <b167f6ce-c39b-370b-5016-abd2f859390b@redhat.com> (raw)
In-Reply-To: <20191217173722.GD2780@work-vm>

On 12/17/19 6:37 PM, Dr. David Alan Gilbert wrote:
> * Philippe Mathieu-Daudé (philmd@redhat.com) wrote:
>> The Chardev events are listed in the QEMUChrEvent enum. To be
>> able to use this enum in the IOEventHandler typedef, we need to
>> explicit when frontends ignore some events, to silent GCC the
>> following warnings:
>>
>>      CC      monitor/hmp.o
>>    monitor/hmp.c: In function ‘monitor_event’:
>>    monitor/hmp.c:1330:5: error: enumeration value ‘CHR_EVENT_BREAK’ not handled in switch [-Werror=switch]
>>     1330 |     switch (event) {
>>          |     ^~~~~~
>>    cc1: all warnings being treated as errors
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
> 
> 
> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>    for HMP
> 
> Note that the use of 'default' will make life more unpredictable
> if you ever come to add a new event type.

You are right, this patch not good as it dumbly ignore the warning...
I will add all the missing cases:

-- >8 --
@@ -1371,6 +1371,10 @@ static void monitor_event(void *opaque, int event)
          mon_refcount--;
          monitor_fdsets_cleanup();
          break;
+
+    case CHR_EVENT_BREAK:
+        /* Ignored */
+        break;
      }
  }

---

And keep your Acked-by. Thanks!

>> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>> ---
>>   monitor/hmp.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/monitor/hmp.c b/monitor/hmp.c
>> index 8942e28933..d84238c120 100644
>> --- a/monitor/hmp.c
>> +++ b/monitor/hmp.c
>> @@ -1371,6 +1371,10 @@ static void monitor_event(void *opaque, int event)
>>           mon_refcount--;
>>           monitor_fdsets_cleanup();
>>           break;
>> +
>> +    default:
>> +        /* Ignore */
>> +        break;
>>       }
>>   }
>>   
>> -- 
>> 2.21.0
>>
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> 



  reply	other threads:[~2019-12-17 17:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 16:37 [PATCH 00/14] chardev: Use QEMUChrEvent enum in IOEventHandler typedef Philippe Mathieu-Daudé
2019-12-17 16:37 ` [PATCH 01/14] hw/ipmi: Remove unnecessary declarations Philippe Mathieu-Daudé
2019-12-17 16:37 ` [RFC PATCH 02/14] chardev/char: Explicit we ignore some QEMUChrEvent in IOEventHandler Philippe Mathieu-Daudé
2019-12-17 16:37 ` [RFC PATCH 03/14] vhost-user: " Philippe Mathieu-Daudé
2019-12-17 16:37 ` [RFC PATCH 04/14] virtio-console: " Philippe Mathieu-Daudé
2019-12-17 16:37 ` [RFC PATCH 05/14] hw/ipmi: " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 06/14] hw/usb/dev-serial: Explicit we ignore few " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 07/14] ccid-card-passthru: Explicit we ignore " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 08/14] hw/usb/redirect: Explicit we ignore few " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 09/14] monitor/qmp: " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 10/14] monitor/hmp: Explicit we ignore a " Philippe Mathieu-Daudé
2019-12-17 17:37   ` Dr. David Alan Gilbert
2019-12-17 17:46     ` Philippe Mathieu-Daudé [this message]
2019-12-17 17:51       ` Dr. David Alan Gilbert
2019-12-17 16:38 ` [RFC PATCH 11/14] net/vhost-user: Explicit we ignore few " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 12/14] vhost-user-blk: " Philippe Mathieu-Daudé
2019-12-17 16:38 ` [RFC PATCH 13/14] hw/char/terminal3270: Explicit ignored " Philippe Mathieu-Daudé
2019-12-19  6:52   ` Markus Armbruster
2019-12-19 13:09     ` Philippe Mathieu-Daudé
2019-12-17 16:38 ` [PATCH 14/14] chardev: Use QEMUChrEvent enum in IOEventHandler typedef Philippe Mathieu-Daudé
2019-12-17 16:50 ` [PATCH 00/14] " Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b167f6ce-c39b-370b-5016-abd2f859390b@redhat.com \
    --to=philmd@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).