From: Marcelo Tosatti Subject: [patch 13/23] QEMU/KVM: add net_client_uninit Date: Tue, 04 Mar 2008 15:34:32 -0300 Message-ID: <20080304183903.504431412@localhost.localdomain> References: <20080304183419.187172133@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Avi Kivity , Glauber Costa To: kvm-devel@lists.sourceforge.net Return-path: Content-Disposition: inline; filename=net-dev-removal List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Signed-off-by: Marcelo Tosatti Index: kvm-userspace.hotplug/qemu/net.h =================================================================== --- kvm-userspace.hotplug.orig/qemu/net.h +++ kvm-userspace.hotplug/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.hotplug/qemu/vl.c =================================================================== --- kvm-userspace.hotplug.orig/qemu/vl.c +++ kvm-userspace.hotplug/qemu/vl.c @@ -4900,6 +4900,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; -- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/