From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN97Z-0000Vh-AX for qemu-devel@nongnu.org; Tue, 02 Apr 2013 17:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN97X-0000R5-Sa for qemu-devel@nongnu.org; Tue, 02 Apr 2013 17:52:01 -0400 Sender: fluxion From: Michael Roth Date: Tue, 2 Apr 2013 16:45:30 -0500 Message-Id: <1364939142-30066-26-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1364939142-30066-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1364939142-30066-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 25/37] pseries: Add cleanup hook for PAPR virtual LAN device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org 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 (cherry picked from commit 156dfaded87d718a9ea798083e1c3e5ea7526713) Signed-off-by: Michael Roth --- hw/spapr_llan.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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.7.9.5