All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: jasowangio@gmail.com, mst@redhat.com, Nikolay N Zorin <zorin@swemel.ru>
Subject: [PATCH 1/1] virtio-net: Fix crash in reporting of virtio_net_get_vhost() failure
Date: Fri, 27 Nov 2026 16:23:54 +0100	[thread overview]
Message-ID: <20261127152354.626137-2-armbru@redhat.com> (raw)
In-Reply-To: <20261127152354.626137-1-armbru@redhat.com>

vhost_user_net_save_state() and vhost_user_net_load_state() pass
@local_error to error_reportf_err() when virtio_net_get_vhost()
failed.  @local_error is null then.  Use error_report() instead.

While there, tidy up extra space in a nearby error message.

Fixes: 60f543ad917f ("virtio-net: vhost-user: Implement internal migration")
Reported-by: Nikolay N Zorin <zorin@swemel.ru>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/net/virtio-net.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 36edb768b17..6ebc5b1d2fc 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3587,9 +3587,8 @@ static int vhost_user_net_save_state(QEMUFile *f, void *pv, size_t size,
 
     vhdev = virtio_net_get_vhost(vdev);
     if (vhdev == NULL) {
-        error_reportf_err(local_error,
-                          "Error getting vhost back-end of %s device %s: ",
-                          vdev->name, vdev->parent_obj.canonical_path);
+        error_report("Error getting vhost back-end of %s device %s",
+                     vdev->name, vdev->parent_obj.canonical_path);
         return -1;
     }
 
@@ -3615,16 +3614,15 @@ static int vhost_user_net_load_state(QEMUFile *f, void *pv, size_t size,
 
     vhdev = virtio_net_get_vhost(vdev);
     if (vhdev == NULL) {
-        error_reportf_err(local_error,
-                          "Error getting vhost back-end of %s device %s: ",
-                          vdev->name, vdev->parent_obj.canonical_path);
+        error_report("Error getting vhost back-end of %s device %s",
+                     vdev->name, vdev->parent_obj.canonical_path);
         return -1;
     }
 
     ret = vhost_load_backend_state(vhdev, f, &local_error);
     if (ret < 0) {
         error_reportf_err(local_error,
-                          "Error loading  back-end state of %s device %s: ",
+                          "Error loading back-end state of %s device %s: ",
                           vdev->name, vdev->parent_obj.canonical_path);
         return ret;
     }
-- 
2.55.0



  reply	other threads:[~2026-11-27 15:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:23 [PATCH 0/1] virtio-net: Fix crash in reporting of virtio_net_get_vhost() failure Markus Armbruster
2026-11-27 15:23 ` Markus Armbruster [this message]
2026-11-27 15:40   ` [PATCH 1/1] " Daniel P. Berrangé
2026-11-27 16:11   ` Philippe Mathieu-Daudé
2026-11-27 17:30     ` Markus Armbruster

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=20261127152354.626137-2-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zorin@swemel.ru \
    /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.