net: del hub port when peer is deleted
authorJason Wang <jasowang@redhat.com>
Mon, 2 Feb 2015 07:06:37 +0000 (15:06 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 6 Feb 2015 14:06:44 +0000 (14:06 +0000)
We should del hub port when peer is deleted since it will not be reused
and will only be freed during exit.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-id: 1422860798-17495-3-git-send-email-jasowang@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net/net.c

index 7acc162b4400648158a08320573586a17a52f391..74e651e17fef660eabb56f8805e3a6daed8452b3 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -996,6 +996,8 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict)
         error_report("invalid host network device '%s'", device);
         return;
     }
+
+    qemu_del_net_client(nc->peer);
     qemu_del_net_client(nc);
 }