From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60064 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3WWp-0003zO-N2 for qemu-devel@nongnu.org; Wed, 06 Oct 2010 12:07:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3WWd-00046F-LW for qemu-devel@nongnu.org; Wed, 06 Oct 2010 12:07:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3WWd-00045m-FA for qemu-devel@nongnu.org; Wed, 06 Oct 2010 12:07:27 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o96G7Qa9005493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Oct 2010 12:07:26 -0400 Date: Wed, 6 Oct 2010 18:01:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20101006160122.GA12276@redhat.com> References: <20101004161329.GA5925@redhat.com> <1286380086.3020.4.camel@x201> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1286380086.3020.4.camel@x201> Subject: [Qemu-devel] Re: [PATCHv3] net: delay freeing peer host device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org On Wed, Oct 06, 2010 at 09:48:06AM -0600, Alex Williamson wrote: > > +void qemu_del_vlan_client(VLANClientState *vc) > > +{ > > + /* If there is a peer NIC, delete and cleanup client, but do not free. */ > > + if (!vc->vlan && vc->peer && vc->peer->info->type == NET_CLIENT_TYPE_NIC) { > > + NICState *nic = DO_UPCAST(NICState, nc, vc->peer); > > + if (nic->peer_deleted) { > > + return; > > + } > > + nic->peer_deleted = true; > > + /* Let NIC know peer is gone. */ > > + vc->peer->link_down = true; > > + if (vc->peer->info->link_status_changed) { > > + vc->peer->info->link_status_changed(vc->peer); > > + } > > + if (vc->info->cleanup) { > > + vc->info->cleanup(vc); > > + } > > This is now the only case that calls cleanup, is that intentional? > Seems like we won't end up calling nic cleanup routines. > > Alex Good catch. I'll fix it up, thanks!