Commit e58f08ccbb for qemu.org
commit e58f08ccbbe59a90faf5557354a0c96b222831de
Author: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Date: Mon Aug 3 12:28:50 2026 +0500
vhost-user: use skip_drain with GET_VRING_BASE_SKIP_DRAIN message
Wire up the skip_drain parameter introduced in the previous commit to
the new GET_VRING_BASE_SKIP_DRAIN message. When skip_drain is set,
send GET_VRING_BASE_SKIP_DRAIN instead of GET_VRING_BASE, instructing
the back-end to suspend in-flight I/O immediately.
Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260803072853.2920007-4-dtalexundeer@yandex-team.ru>
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7294d3c42a..68a8e40481 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1521,7 +1521,11 @@ static int do_vhost_virtqueue_stop(struct vhost_dev *dev,
}
if (!force) {
- r = dev->vhost_ops->vhost_get_vring_base(dev, &state);
+ if (!skip_drain) {
+ r = dev->vhost_ops->vhost_get_vring_base(dev, &state);
+ } else {
+ r = dev->vhost_ops->vhost_get_vring_base_skip_drain(dev, &state);
+ }
if (r < 0) {
VHOST_OPS_DEBUG(r, "vhost VQ %u ring restore failed: %d", idx, r);
}