From patchwork Tue Apr 2 21:45:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 233168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 86CF52C016D for ; Wed, 3 Apr 2013 09:03:22 +1100 (EST) Received: from localhost ([::1]:57178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9IW-0008O7-M3 for incoming@patchwork.ozlabs.org; Tue, 02 Apr 2013 18:03:20 -0400 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 Received: from mail-gh0-f180.google.com ([209.85.160.180]:55196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN97X-0000Qy-Ot; Tue, 02 Apr 2013 17:51:59 -0400 Received: by mail-gh0-f180.google.com with SMTP id f13so145314ghb.11 for ; Tue, 02 Apr 2013 14:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=VOi8kx0Nx0BN1CFztKqj4cc7lfwnx3LU1GKdVNtq0CU=; b=A/rTxNbpk0X+r/VUmCPSC6eOFD6XSHCBlz1T5GG7c0iDjcXI4pOgcZ5er5OKGQmeil sjmcuaFgv5cjyODIuwPlavWJB/3z2e+JLeCmv3YZThTheUM1DI32WBwo16PgS/6OIly3 /2+Sp9QsIgoeXglCc8klcq4gC7eP+bfcGvTpc8SnBw/UxdshX7YCatpT4J9/ULNaEehC 1e6Y8jaS3nYe1mjaaOg6hNl/uZL4cwO4d9O4fMlehe8jzHtu4pOJ5bp2WLZxhYb6o+Wc 3e/MPhfVFtnJhT4QYjwf+xiFqyN7z27ewXZh3PJb7GqqaedJOHoyUVENl2oBXy40OzBw /+ag== X-Received: by 10.236.160.233 with SMTP id u69mr16768355yhk.124.1364939519275; Tue, 02 Apr 2013 14:51:59 -0700 (PDT) Received: from localhost ([32.97.110.51]) by mx.google.com with ESMTPS id t9sm5845187yhh.0.2013.04.02.14.51.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Apr 2013 14:51:58 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 2 Apr 2013 16:45:30 -0500 Message-Id: <1364939142-30066-26-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.180 Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 25/37] pseries: Add cleanup hook for PAPR virtual LAN device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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)