From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE3aR-0000A4-97 for qemu-devel@nongnu.org; Fri, 08 Mar 2013 15:08:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UE3a7-0000ZL-75 for qemu-devel@nongnu.org; Fri, 08 Mar 2013 15:08:15 -0500 From: Alexander Graf Date: Fri, 8 Mar 2013 21:06:03 +0100 Message-Id: <1362773228-1747-2-git-send-email-agraf@suse.de> In-Reply-To: <1362773228-1747-1-git-send-email-agraf@suse.de> References: <1362773228-1747-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 01/66] pseries: Add cleanup hook for PAPR virtual LAN device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: Blue Swirl , "qemu-ppc@nongnu.org list:PowerPC" , =?utf-8?q?Aur=C3=A9lien=20Jarno?= , David Gibson From: David Gibson Currently the spapr-vlan device does not supply a cleanup call for its NetClientInfo structure. With current qemu versions, that leads to a SEGV on exit, when net_cleanup() attempts to call the cleanup handlers on all net clients. Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- hw/spapr_llan.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index 6ef2936..0ace2eb 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -175,11 +175,19 @@ static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf, return size; } +static void spapr_vlan_cleanup(NetClientState *nc) +{ + VIOsPAPRVLANDevice *dev = qemu_get_nic_opaque(nc); + + dev->nic = NULL; +} + static NetClientInfo net_spapr_vlan_info = { .type = NET_CLIENT_OPTIONS_KIND_NIC, .size = sizeof(NICState), .can_receive = spapr_vlan_can_receive, .receive = spapr_vlan_receive, + .cleanup = spapr_vlan_cleanup, }; static void spapr_vlan_reset(VIOsPAPRDevice *sdev) -- 1.6.0.2