vmd(8): disambiguate log messages per vm and device.
authordv <dv@openbsd.org>
Tue, 26 Sep 2023 01:53:54 +0000 (01:53 +0000)
committerdv <dv@openbsd.org>
Tue, 26 Sep 2023 01:53:54 +0000 (01:53 +0000)
commit08d0da61ad3ca376416319ae810abe5d5ad26604
tree1ab7bb73b6a012f432066fd04e0f2ee48cb141d1
parent71ab85de86c9965af0a2d6132e10736e2dd4e37f
vmd(8): disambiguate log messages per vm and device.

The logging output from vmd(8) often specifies the function performing
the logging, but leaves which vm or vm device to guesswork and
reading tea leaves.

Change the logging formatting to prefix with information about the
specific vm and potentially the device subprocess. Most of this
logging is behind the "verbose" mode, but for warnings this will
clarify which vm or device logged the warning.

The format of vm/<name>/<device><index> is chosen to be concise and
less ugly than other approaches. This adjusts the process naming
for devices to match, dropping the use of brackets.

In the process of this change, updating log settings dynamically
via vmctl(8) is fixed by properly broadcasting that information to
the device subprocesses. The "vmm" process also now updates its own
state properly, so settings survive vm reboots.

ok mlarkin@
usr.sbin/vmd/log.c
usr.sbin/vmd/proc.c
usr.sbin/vmd/proc.h
usr.sbin/vmd/vioblk.c
usr.sbin/vmd/vionet.c
usr.sbin/vmd/virtio.c
usr.sbin/vmd/virtio.h
usr.sbin/vmd/vm.c
usr.sbin/vmd/vmd.c
usr.sbin/vmd/vmm.c