vhost: prefix logs with context
authorDavid Marchand <david.marchand@redhat.com>
Fri, 1 Jul 2022 13:20:56 +0000 (15:20 +0200)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 1 Jul 2022 13:49:49 +0000 (15:49 +0200)
commit36c525a03578089950f90d9392bae0a9508733ce
tree23c6f266511443ec7b8a3afb6a17c9665a2a5339
parent481a2c7ef225301c34d60ff8c18c5d3e8c4bf0a3
vhost: prefix logs with context

We recently improved the log messages in the vhost library, adding some
context that helps filtering for a given vhost-user device.
However, some parts of the code were missed, and some later code changes
broke this new convention (fixes were sent previous to this patch).

Change the VHOST_LOG_CONFIG/DATA helpers and always ask for a string
used as context. This should help limit regressions on this topic.

Most of the time, the context is the vhost-user device socket path.
For the rest when a vhost-user device can not be related, generic
names were chosen:
- "dma", for vhost-user async DMA operations,
- "device", for vhost-user device creation and lookup,
- "thread", for threads management,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/vhost/iotlb.c
lib/vhost/socket.c
lib/vhost/vdpa.c
lib/vhost/vhost.c
lib/vhost/vhost.h
lib/vhost/vhost_user.c
lib/vhost/virtio_net.c