Skip to contentSkip to conversation

vhost-user: delete net client if necessary

PATCH In review linzhecheng 2 participants 2 messages Jun 12, 2018 – Jun 15, 2018 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 vhost-user: delete net client if necessary

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.

net/vhost-user.c +3 -0
index 608b837175..a39f9c9974 100644
@@ -345,6 +345,9 @@ err:
             s->vhost_user = NULL;
         }
     }
+    if (nc0) {
+        qemu_del_net_client(nc0);
+    }
 
     return -1;
 }
Signature · 1 line
2.12.2.windows.2
#1 lore raw
Quoted 11 lines · 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.

net/vhost-user.c +0 -0
index 608b837175..a39f9c9974 100644

net/vhost-user.c err: · line 353

Quoted 9 lines
net/vhost-user.c +3 -0
@@ -345,6 +345,9 @@ err:
              s->vhost_user = NULL;
          }
      }
+    if (nc0) {
+        qemu_del_net_client(nc0);
+    }
 
      return -1;
  }

Applied and queued for -stable.

Please cc stable next time.

Btw, do we have similar issues for tap?

Thanks