diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2013-02-10 18:59:02 +0000 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2013-04-02 11:51:39 -0500 |
commit | 611c7f2c3aba7885fd94a4b267e419f351d37a0f (patch) | |
tree | 1908bd40a328018004a76448f565d594f95f13b3 | |
parent | 4e4566ce78e8d0668a0b66c90b4bc01b5c88d050 (diff) |
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 <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 156dfaded87d718a9ea798083e1c3e5ea7526713)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | 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 6ef29362f5..0ace2eb1f3 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) |