]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
pseries: Add cleanup hook for PAPR virtual LAN device
authorDavid Gibson <david@gibson.dropbear.id.au>
Sun, 10 Feb 2013 18:59:02 +0000 (18:59 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Apr 2013 16:51:39 +0000 (11:51 -0500)
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>
hw/spapr_llan.c

index 6ef29362f5b2d44e25d60ad6a6e3cb186403c6e9..0ace2eb1f3c3ff7877822433203d016248894e48 100644 (file)
@@ -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)