[PULL 33/33] vhost: fix vhost_inflight_buffer_pre_load

Michael S. Tsirkin posted 33 patches 1 month, 2 weeks ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, Jason Wang <jasowang@redhat.com>, Yi Liu <yi.l.liu@intel.com>, "Clément Mathieu--Drif" <clement.mathieu--drif@eviden.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Zhao Liu <zhao1.liu@intel.com>
[PULL 33/33] vhost: fix vhost_inflight_buffer_pre_load
Posted by Michael S. Tsirkin 1 month, 2 weeks ago
From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>

While I was rebasing my series about inflight migration, I missed a
small issue in vhost_inflight_buffer_preload:

* fix wrong return type in function
* fix error check

Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Fixes: tag pls?
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260220094800.276489-1-dtalexundeer@yandex-team.ru>
---
 hw/virtio/vhost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 52801c1796..f83bdcaf8b 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1926,8 +1926,8 @@ static bool vhost_inflight_buffer_pre_load(void *opaque, Error **errp)
     void *addr = qemu_memfd_alloc("vhost-inflight", inflight->size,
                                   F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL,
                                   &fd, errp);
-    if (*errp) {
-        return -ENOMEM;
+    if (!addr) {
+        return false;
     }
 
     inflight->offset = 0;
-- 
MST
Re: [PULL 33/33] vhost: fix vhost_inflight_buffer_pre_load
Posted by Michael Tokarev 1 month, 2 weeks ago
On 22.02.2026 17:29, Michael S. Tsirkin wrote:
> From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> 
> While I was rebasing my series about inflight migration, I missed a
> small issue in vhost_inflight_buffer_preload:
> 
> * fix wrong return type in function
> * fix error check
> 
> Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> Fixes: tag pls?

Is this intentional? :)

/mjt
Re: [PULL 33/33] vhost: fix vhost_inflight_buffer_pre_load
Posted by Michael S. Tsirkin 1 month, 2 weeks ago
On Mon, Feb 23, 2026 at 12:16:46AM +0300, Michael Tokarev wrote:
> On 22.02.2026 17:29, Michael S. Tsirkin wrote:
> > From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> > 
> > While I was rebasing my series about inflight migration, I missed a
> > small issue in vhost_inflight_buffer_preload:
> > 
> > * fix wrong return type in function
> > * fix error check
> > 
> > Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> > Fixes: tag pls?
> 
> Is this intentional? :)
> 
> /mjt

Ouch (