diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-04-20 15:52:49 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-04-26 13:58:29 +0100 |
commit | b8846a4d6352b2a1d2012f8b3b9115640524aeda (patch) | |
tree | d9cdc0080393509f1b1ba693504ede9ad7cf5536 /include/sysemu/sysemu.h | |
parent | 6af2692e86f9fdfb3d3d291c2708e81c3125d8e5 (diff) |
vl.c: new function serial_max_hds()
Create a new function serial_max_hds() which returns the number of
serial ports defined by the user. This is needed only by spapr.
This allows us to remove the MAX_SERIAL_PORTS define.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180420145249.32435-14-peter.maydell@linaro.org
Diffstat (limited to 'include/sysemu/sysemu.h')
-rw-r--r-- | include/sysemu/sysemu.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 989cbc2b7b..544ab77a2b 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -159,10 +159,12 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict); /* serial ports */ -#define MAX_SERIAL_PORTS 4 - /* Return the Chardev for serial port i, or NULL if none */ Chardev *serial_hd(int i); +/* return the number of serial ports defined by the user. serial_hd(i) + * will always return NULL for any i which is greater than or equal to this. + */ +int serial_max_hds(void); /* parallel ports */ |