diff options
author | Marc-André Lureau | 2016-10-22 12:09:39 +0200 |
---|---|---|
committer | Paolo Bonzini | 2016-10-24 15:46:10 +0200 |
commit | 8c260cb13c2d9a889b660e829c3f5769ae030ec4 (patch) | |
tree | a34661da22cc3cc8569ebaeb50e9d7c86dabfbf5 /include/sysemu/char.h | |
parent | char: remove unused CHR_EVENT_FOCUS (diff) | |
download | qemu-8c260cb13c2d9a889b660e829c3f5769ae030ec4.tar.gz qemu-8c260cb13c2d9a889b660e829c3f5769ae030ec4.tar.xz qemu-8c260cb13c2d9a889b660e829c3f5769ae030ec4.zip |
char: use an enum for CHR_EVENT
This may help to catch unhandled cases, and avoid having to maintain
numbering.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20161022100951.19562-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu/char.h')
-rw-r--r-- | include/sysemu/char.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 43da4ac89d..de0d99b3c2 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -13,11 +13,13 @@ /* character device */ -#define CHR_EVENT_BREAK 0 /* serial break char */ -#define CHR_EVENT_OPENED 2 /* new connection established */ -#define CHR_EVENT_MUX_IN 3 /* mux-focus was set to this terminal */ -#define CHR_EVENT_MUX_OUT 4 /* mux-focus will move on */ -#define CHR_EVENT_CLOSED 5 /* connection closed */ +typedef enum { + CHR_EVENT_BREAK, /* serial break char */ + CHR_EVENT_OPENED, /* new connection established */ + CHR_EVENT_MUX_IN, /* mux-focus was set to this terminal */ + CHR_EVENT_MUX_OUT, /* mux-focus will move on */ + CHR_EVENT_CLOSED /* connection closed */ +} QEMUChrEvent; #define CHR_IOCTL_SERIAL_SET_PARAMS 1 |