From: David Gibson Date: Sun, 10 Feb 2013 18:59:02 +0000 (+0000) Subject: pseries: Add cleanup hook for PAPR virtual LAN device X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~2329^2~5^2~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=156dfaded87d718a9ea798083e1c3e5ea7526713;p=sdk%2Femulator%2Fqemu.git pseries: Add cleanup hook for PAPR virtual LAN device 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 --- 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)