[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 5/5] pseries: Fix reset of VIO network device
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 5/5] pseries: Fix reset of VIO network device |
Date: |
Thu, 12 Apr 2012 12:44:15 +1000 |
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 <address@hidden>
---
hw/spapr_llan.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index a0020e9..d3b6b47 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;
@@ -191,7 +200,7 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev)
dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf,
object_get_typename(OBJECT(sdev)), sdev->qdev.id,
dev);
qemu_format_nic_info_str(&dev->nic->nc, dev->nicconf.macaddr.a);
-
+
return 0;
}
@@ -316,7 +325,6 @@ static target_ulong h_register_logical_lan(CPUPPCState *env,
return H_SUCCESS;
}
-
static target_ulong h_free_logical_lan(CPUPPCState *env, sPAPREnvironment
*spapr,
target_ulong opcode, target_ulong *args)
{
@@ -334,9 +342,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;
}
@@ -483,6 +489,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";
--
1.7.9.5
- [Qemu-ppc] [PATCH 0/5] pseries: cleanups and reset fixes, David Gibson, 2012/04/11
- [Qemu-ppc] [PATCH 1/5] pseries: Remove old debug leftovers from spapr_vscsi, David Gibson, 2012/04/11
- [Qemu-ppc] [PATCH 5/5] pseries: Fix reset of VIO network device,
David Gibson <=
- [Qemu-ppc] [PATCH 2/5] pseries: Remove old hcalls hook stub, David Gibson, 2012/04/11
- [Qemu-ppc] [PATCH 3/5] pseries: Correctly use the device model reset hooks, David Gibson, 2012/04/11
- [Qemu-ppc] [PATCH 4/5] pseries: Reset vscsi properly, David Gibson, 2012/04/11
- Re: [Qemu-ppc] [PATCH 0/5] pseries: cleanups and reset fixes, Andreas Färber, 2012/04/15