All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-8.1] vhost-blk: reorder stopping sequence
@ 2026-11-18 14:50 Andrey Zhadchenko
  2026-11-18 15:00 ` no-reply
  2026-11-18 15:20 ` Andrey Drobyshev
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Zhadchenko @ 2026-11-18 14:50 UTC (permalink / raw)
  To: andrey.drobyshev; +Cc: svt-core, den

Setting backend to -1 drains all in-flight requests. But if we
remove the notifiers beforehand, the requests are never signaled
as completed and guest is not notified after qemu CPR. Any IO
completion on the device unstucks the queue because used ring
is correct but the irqs are lost.
Remove the notifiers after device stop just like vhost-user-blk
or vhost-scsi.

https://virtuozzo.atlassian.net/browse/VSTOR-155598
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
---
 hw/block/vhost-blk.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c
index abddff02c6d..4cebc91d33e 100644
--- a/hw/block/vhost-blk.c
+++ b/hw/block/vhost-blk.c
@@ -138,12 +138,6 @@ static void vhost_blk_stop(VirtIODevice *vdev)
         return;
     }
 
-    ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false);
-    if (ret < 0) {
-        error_report("vhost-blk: unable to unbind guest notifiers");
-    }
-    vhost_dev_disable_notifiers(&s->dev, vdev);
-
     /*
      * Detach the backend before vhost_dev_stop() samples the vring base,
      * to stop the kernel worker from further fetching.
@@ -158,6 +152,12 @@ static void vhost_blk_stop(VirtIODevice *vdev)
 
     vhost_dev_stop(&s->dev, vdev, false);
 
+    ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false);
+    if (ret < 0) {
+        error_report("vhost-blk: unable to unbind guest notifiers");
+    }
+    vhost_dev_disable_notifiers(&s->dev, vdev);
+
     s->vhost_started = false;
 }
 
-- 
2.43.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-18 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 14:50 [PATCH hci-8.1] vhost-blk: reorder stopping sequence Andrey Zhadchenko
2026-11-18 15:00 ` no-reply
2026-11-18 15:20 ` Andrey Drobyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.