From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZAti-0007b0-OE for qemu-devel@nongnu.org; Tue, 11 Mar 2008 16:16:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZAth-0007ZH-4i for qemu-devel@nongnu.org; Tue, 11 Mar 2008 16:16:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZAtg-0007Z9-U4 for qemu-devel@nongnu.org; Tue, 11 Mar 2008 16:16:28 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JZAtg-00046X-Gu for qemu-devel@nongnu.org; Tue, 11 Mar 2008 16:16:28 -0400 Message-Id: <20080311201418.163559444@localhost.localdomain> References: <20080311201151.959635433@localhost.localdomain> Date: Tue, 11 Mar 2008 17:12:03 -0300 From: Marcelo Tosatti Content-Disposition: inline; filename=net-dev-removal Subject: [Qemu-devel] [patch 12/24] QEMU/KVM: add net_client_uninit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kvm-devel@lists.sourceforge.net Cc: aliguori@us.ibm.com, Marcelo Tosatti Signed-off-by: Marcelo Tosatti Index: kvm-userspace.hotplug2/qemu/net.h =================================================================== --- kvm-userspace.hotplug2.orig/qemu/net.h +++ kvm-userspace.hotplug2/qemu/net.h @@ -38,6 +38,7 @@ void do_info_network(void); int hack_around_tap(void *opaque); int net_client_init(const char *str); +void net_client_uninit(NICInfo *nd); /* NIC info */ Index: kvm-userspace.hotplug2/qemu/vl.c =================================================================== --- kvm-userspace.hotplug2.orig/qemu/vl.c +++ kvm-userspace.hotplug2/qemu/vl.c @@ -4937,6 +4937,14 @@ int net_client_init(const char *str) return ret; } +void net_client_uninit(NICInfo *nd) +{ + nd->vlan->nb_guest_devs--; /* XXX: free vlan on last reference */ + nb_nics--; + nd->used = 0; + free(nd->model); +} + void do_info_network(void) { VLANState *vlan; --