Message ID | 20250218083208.78465-1-hanht2@chinatelecom.cn (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | vhost: Don't set vring call if guest notifier is disabled | expand |
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 6aa72fd434..d17e7cc6fe 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1342,8 +1342,8 @@ int vhost_virtqueue_start(struct vhost_dev *dev, } if (k->query_guest_notifiers && - k->query_guest_notifiers(qbus->parent) && - virtio_queue_vector(vdev, idx) == VIRTIO_NO_VECTOR) { + (!k->query_guest_notifiers(qbus->parent) || + virtio_queue_vector(vdev, idx) == VIRTIO_NO_VECTOR)) { file.fd = -1; r = dev->vhost_ops->vhost_set_vring_call(dev, &file); if (r) {