netconsole: Attach cmdline target to dynamic target
authorBreno Leitao <leitao@debian.org>
Thu, 12 Oct 2023 11:14:00 +0000 (04:14 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Oct 2023 00:26:38 +0000 (17:26 -0700)
commit5fbd6cdbe304b4154f63e3f8abf7c9c644ccb62c
treef06cdf9269a2c6362c1131bc67735ba8fb8348d5
parent131eeb45b96107b19f9f231d6e81348b471b2ed0
netconsole: Attach cmdline target to dynamic target

Enable the attachment of a dynamic target to the target created during
boot time. The boot-time targets are named as "cmdline\d", where "\d" is
a number starting at 0.

If the user creates a dynamic target named "cmdline0", it will attach to
the first target created at boot time (as defined in the
`netconsole=...` command line argument). `cmdline1` will attach to the
second target and so forth.

If there is no netconsole target created at boot time, then, the target
name could be reused.

Relevant design discussion:
https://lore.kernel.org/all/ZRWRal5bW93px4km@gmail.com/

Suggested-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20231012111401.333798-4-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c