All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: andrey.drobyshev@virtuozzo.com
Cc: svt-core@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-8.1] vhost-blk: reorder stopping sequence
Date: Wed, 18 Nov 2026 17:50:12 +0300	[thread overview]
Message-ID: <20261118145012.216512-1-andrey.zhadchenko@virtuozzo.com> (raw)

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


             reply	other threads:[~2026-11-18 14:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 14:50 Andrey Zhadchenko [this message]
2026-11-18 15:00 ` no-reply
2026-11-18 15:20 ` Andrey Drobyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118145012.216512-1-andrey.zhadchenko@virtuozzo.com \
    --to=andrey.zhadchenko@virtuozzo.com \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=svt-core@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.