From: Si-Wei Liu <si-wei.liu@oracle.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com,
eli@mellanox.com, si-wei.liu@oracle.com, sgarzare@redhat.com
Subject: [PATCH v2 4/5] vhost-net: fix improper cleanup in vhost_net_start
Date: Wed, 27 Apr 2022 01:30:15 -0700 [thread overview]
Message-ID: <1651048216-3365-5-git-send-email-si-wei.liu@oracle.com> (raw)
In-Reply-To: <1651048216-3365-1-git-send-email-si-wei.liu@oracle.com>
vhost_net_start() missed a corresponding stop_one() upon error from
vhost_set_vring_enable(). While at it, make the error handling for
err_start more robust. No real issue was found due to this though.
Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
hw/net/vhost_net.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 30379d2..d6d7c51 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -381,6 +381,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
r = vhost_set_vring_enable(peer, peer->vring_enable);
if (r < 0) {
+ vhost_net_stop_one(get_vhost_net(peer), dev);
goto err_start;
}
}
@@ -390,7 +391,8 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
err_start:
while (--i >= 0) {
- peer = qemu_get_peer(ncs , i);
+ peer = qemu_get_peer(ncs, i < data_queue_pairs ?
+ i : n->max_queue_pairs);
vhost_net_stop_one(get_vhost_net(peer), dev);
}
e = k->set_guest_notifiers(qbus->parent, total_notifiers, false);
--
1.8.3.1
next prev parent reply other threads:[~2022-04-27 8:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 8:30 [PATCH v2 0/5] vhost-vdpa multiqueue fixes Si-Wei Liu
2022-04-27 8:30 ` [PATCH v2 1/5] virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated Si-Wei Liu
2022-04-29 2:14 ` Jason Wang
2022-04-27 8:30 ` [PATCH v2 2/5] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa Si-Wei Liu
2022-04-29 2:23 ` Jason Wang
2022-04-29 2:24 ` Jason Wang
2022-04-30 1:13 ` Si-Wei Liu
2022-04-30 1:12 ` Si-Wei Liu
2022-05-05 8:25 ` Jason Wang
2022-04-27 8:30 ` [PATCH v2 3/5] vhost-vdpa: fix improper cleanup in net_init_vhost_vdpa Si-Wei Liu
2022-04-27 8:30 ` Si-Wei Liu [this message]
2022-04-27 8:30 ` [PATCH v2 5/5] vhost-vdpa: backend feature should set only once Si-Wei Liu
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=1651048216-3365-5-git-send-email-si-wei.liu@oracle.com \
--to=si-wei.liu@oracle.com \
--cc=eli@mellanox.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).