| commit | 29c59c44c8f1e45f2a63f23fc0afa3b5c29891bd | [log] [tgz] |
|---|---|---|
| author | Andrew Jeffery <andrew@aj.id.au> | Wed May 03 19:33:07 2023 +0930 |
| committer | Andrew Jeffery <andrew@aj.id.au> | Fri May 05 09:41:02 2023 +0930 |
| tree | bc0bddebaeb5966f3c5e758e44c860a8f340b568 | |
| parent | 4ee702a86592edcd1a1dd2c2ab94a50e0a49ee0d [diff] |
console-server: Consistently use cleanup labels on error We've already allocated the `struct console` object here, and some error paths before and after jump to the `out_*` labels, but others just `return EXIT_FAILURE`. Pick a consistent strategy, and also one that aligns with useful leak analysis results. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I2e9be530823fb117bf2d013757c99d8d43e680d7
To build this project, run the following shell commands:
meson setup build meson compile -C build
To test:
meson test -C build
Running the server requires a serial port (e.g. /dev/ttyS0):
touch obmc-console.conf ./obmc-console-server --config obmc-console.conf ttyS0
To connect to the server, simply run the client:
./obmc-console-client
To disconnect the client, use the standard ~. combination.
This shows how the host UART connection is abstracted within the BMC as a Unix domain socket.
+--------------------------------------------------------------------------------------------+
| |
| obmc-console-client unix domain socket obmc-console-server |
| |
| +---------------------+ +------------------------+ |
| | client.2200.conf | +---------------------+ | server.ttyVUART0.conf | |
+---+--+ +---------------------+ | | +------------------------+ +--------+-------+
Network | 2200 +--> +->+ @obmc-console.host0 +<-+ <--+ /dev/ttyVUART0 | UARTs
+---+--+ | socket-id = "host0" | | | | socket-id = "host0" | +--------+-------+
| | | +---------------------+ | | |
| +---------------------+ +------------------------+ |
| |
| |
| |
+--------------------------------------------------------------------------------------------+
This supports multiple independent consoles. The socket-id is a unique portion for the unix domain socket created by the obmc-console-server instance. The server needs to know this because it needs to know what to name the pipe; the client needs to know it as it needs to form the abstract socket name to which to connect.