Incus chardev:console injection

incus start injects certain prefixes to QEMU before passing the user’s arguments. One of those prefixes is: -serial chardev:console

This means that the first console that the kernel writes to is expected to be chardev:console. This makes sense because it makes incus console and incus start --console (and any related logging capturing) work.

Could I (or any user) request a flag - be it through an environment variable or an API call or commandline argument (or all 3!) that disables this prefix from being injected? I’m happy to explain the usecase but in short, on OpenWRT you literally have 2 serial terminals and because there’s currently no incus agent for OpenWRT, automation requires as many working sockets in the guest as possible.

I’m currently undoing this injection by writing a custom scriplet that looks for -serial chardev:console and removes it but I then have to assume that incus will always, forever, use -serial chardev:console and I don’t see this guarantee, so my custom scriplet could break in the future after an incus update.
The reason why I’m undoing this injection is because I assume incus will do -chardev updates to console and having me mess around with chardev:console isn’t going to make anyone happy.

Another approach could be to make the name of this chardev configurable, or even have an API call that provides this value on request - either of which gives incus complete freedom in the future to change it as needed, allows the user to know what to expect, so they can remove it if they wish

Which of these approaches would make the most sense for power users?

I’d expect the QMP API would let you retrieve the list of chardev and their names (query-chardev).

1 Like