diff options
author | David Gibson | 2012-04-12 04:44:15 +0200 |
---|---|---|
committer | Andreas Färber | 2012-04-15 20:07:58 +0200 |
commit | c17491b63e198ac48d533f8a9d301d11c5880a36 (patch) | |
tree | c7e4f64561c55900f2ab5892cb73f817bb7313a5 /hw/spapr_llan.c | |
parent | pseries: Reset vscsi properly (diff) | |
download | qemu-c17491b63e198ac48d533f8a9d301d11c5880a36.tar.gz qemu-c17491b63e198ac48d533f8a9d301d11c5880a36.tar.xz qemu-c17491b63e198ac48d533f8a9d301d11c5880a36.zip |
pseries: Fix reset of VIO network device
Currently, the PAPR VIO network device does not have a reset handler. This
means that after a hard reset, H_REGISTER_LOGICAL_LAN will return an error
when the new guest boot attempts to initialize the device.
This patch corrects this, adding a suitable reset hook.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/spapr_llan.c')
-rw-r--r-- | hw/spapr_llan.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index 32dce17872..e18d2eb901 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -182,6 +182,15 @@ static NetClientInfo net_spapr_vlan_info = { .receive = spapr_vlan_receive, }; +static void spapr_vlan_reset(VIOsPAPRDevice *sdev) +{ + VIOsPAPRVLANDevice *dev = DO_UPCAST(VIOsPAPRVLANDevice, sdev, sdev); + + dev->buf_list = 0; + dev->rx_bufs = 0; + dev->isopen = 0; +} + static int spapr_vlan_init(VIOsPAPRDevice *sdev) { VIOsPAPRVLANDevice *dev = (VIOsPAPRVLANDevice *)sdev; @@ -335,9 +344,7 @@ static target_ulong h_free_logical_lan(CPUPPCState *env, sPAPREnvironment *spapr return H_RESOURCE; } - dev->buf_list = 0; - dev->rx_bufs = 0; - dev->isopen = 0; + spapr_vlan_reset(sdev); return H_SUCCESS; } @@ -484,6 +491,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass); k->init = spapr_vlan_init; + k->reset = spapr_vlan_reset; k->devnode = spapr_vlan_devnode; k->dt_name = "l-lan"; k->dt_type = "network"; |