From: Marcelo Tosatti Subject: [patch 12/24] QEMU/KVM: add net_client_uninit Date: Tue, 11 Mar 2008 17:12:03 -0300 Message-ID: <20080311201418.163559444@localhost.localdomain> References: <20080311201151.959635433@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti To: qemu-devel@nongnu.org, 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.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; -- ------------------------------------------------------------------------- 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/