[PATCH v2] vhost: fix vhost_inflight_buffer_pre_load

Alexandr Moshkov posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260220094800.276489-1-dtalexundeer@yandex-team.ru
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>
hw/virtio/vhost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v2] vhost: fix vhost_inflight_buffer_pre_load
Posted by Alexandr Moshkov 1 month, 2 weeks ago
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>
---
 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;
-- 
2.34.1
Re: [PATCH v2] vhost: fix vhost_inflight_buffer_pre_load
Posted by Michael S. Tsirkin 1 month, 2 weeks ago
On Fri, Feb 20, 2026 at 02:48:01PM +0500, Alexandr Moshkov wrote:
> 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?

> ---
>  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;
> -- 
> 2.34.1
Re: [PATCH v2] vhost: fix vhost_inflight_buffer_pre_load
Posted by Vladimir Sementsov-Ogievskiy 1 month, 2 weeks ago
On 20.02.26 12:48, Alexandr Moshkov wrote:
> 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>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

-- 
Best regards,
Vladimir