Skip to contentSkip to conversation

vhost: correct misleading printing information

PATCH In review Xianting Tian 1 participant 2 messages Mar 11, 2024 – Mar 15, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: correct misleading printing information

Guest moved avail idx not used idx when we need to print log if '(vq->avail_idx - last_avail_idx) > vq->num', so fix it.

---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
index 045f666b4f12..1f3604c79394 100644
@@ -2515,7 +2515,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
 		vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
 
 		if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) {
-			vq_err(vq, "Guest moved used index from %u to %u",
+			vq_err(vq, "Guest moved avail index from %u to %u",
 				last_avail_idx, vq->avail_idx);
 			return -EFAULT;
 		}
Signature · 1 line
2.17.1
#1 lore raw

it is a very minor fix, I think it can be applied

Quoted 21 lines · Xianting Tian

Guest moved avail idx not used idx when we need to print log if '(vq->avail_idx - last_avail_idx) > vq->num', so fix it.

---
  drivers/vhost/vhost.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
index 045f666b4f12..1f3604c79394 100644
@@ -2515,7 +2515,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
  		vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
 
  		if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) {
-			vq_err(vq, "Guest moved used index from %u to %u",
+			vq_err(vq, "Guest moved avail index from %u to %u",
  				last_avail_idx, vq->avail_idx);
  			return -EFAULT;
  		}