Re: [PATCH] use pr_warn_ratelimited() for vq_err()
From: Jason Wang <hidden>
Date: 2021-01-18 02:57:29
Also in:
kvm
On 2021/1/16 上午1:37, John Levon wrote:
vq_err() is used to report various failure states in vhost code, but by default uses pr_debug(), and as a result doesn't record anything unless enabled via dynamic debug. We'll change this so we get something recorded in the log in these failure cases. Guest VMs (and userspace) can trigger some of these messages, so we want to use the pr_warn_ratelimited() variant.
It looks to me KVM also use pr_warn_ratelimited(). So Acked-by: Jason Wang <redacted>
quoted hunk
Signed-off-by: John Levon <redacted> --- drivers/vhost/vhost.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index b063324c7669..cb4ef78c84ba 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h@@ -228,10 +228,10 @@ int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled); void vhost_iotlb_map_free(struct vhost_iotlb *iotlb, struct vhost_iotlb_map *map); -#define vq_err(vq, fmt, ...) do { \ - pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ - if ((vq)->error_ctx) \ - eventfd_signal((vq)->error_ctx, 1);\ +#define vq_err(vq, fmt, ...) do { \ + pr_warn_ratelimited(pr_fmt(fmt), ##__VA_ARGS__); \ + if ((vq)->error_ctx) \ + eventfd_signal((vq)->error_ctx, 1); \ } while (0) enum {
_______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization