qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] vhost-user: delete net client if necessary
@ 2018-06-12  2:24 linzhecheng
  2018-06-15  2:35 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: linzhecheng @ 2018-06-12  2:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, jasowang, wangxinxin.wang, liujunjie23, linzhecheng

As qemu_new_net_client create new ncs but error happens later,
ncs will be left in global net_clients list and we can't use them any
more, so we need to cleanup them.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 608b837175..a39f9c9974 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -345,6 +345,9 @@ err:
             s->vhost_user = NULL;
         }
     }
+    if (nc0) {
+        qemu_del_net_client(nc0);
+    }
 
     return -1;
 }
-- 
2.12.2.windows.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-15  2:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-12  2:24 [Qemu-devel] [PATCH v2] vhost-user: delete net client if necessary linzhecheng
2018-06-15  2:35 ` Jason Wang

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).