[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 2/7] adb.c: include ADBDevice parent state in KBDState
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCH 2/7] adb.c: include ADBDevice parent state in KBDState and MouseState |
Date: |
Tue, 23 Dec 2014 00:36:16 +0000 |
The parent ADBDevice contains the device id on the ADB bus. Make sure that
this state is included in both its subclasses since some clients (such as
OpenBIOS) reprogram each device id after enumeration.
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/input/adb.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/hw/input/adb.c b/hw/input/adb.c
index 34c8058..a5f813f 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -118,6 +118,17 @@ static const TypeInfo adb_bus_type_info = {
.instance_size = sizeof(ADBBusState),
};
+static const VMStateDescription vmstate_adb_device = {
+ .name = "adb_device",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT32(devaddr, ADBDevice),
+ VMSTATE_INT32(handler, ADBDevice),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void adb_device_realizefn(DeviceState *dev, Error **errp)
{
ADBDevice *d = ADB_DEVICE(dev);
@@ -301,9 +312,10 @@ static int adb_kbd_request(ADBDevice *d, uint8_t *obuf,
static const VMStateDescription vmstate_adb_kbd = {
.name = "adb_kbd",
- .version_id = 1,
- .minimum_version_id = 1,
+ .version_id = 2,
+ .minimum_version_id = 2,
.fields = (VMStateField[]) {
+ VMSTATE_STRUCT(parent_obj, KBDState, 0, vmstate_adb_device, ADBDevice),
VMSTATE_BUFFER(data, KBDState),
VMSTATE_INT32(rptr, KBDState),
VMSTATE_INT32(wptr, KBDState),
@@ -515,9 +527,10 @@ static void adb_mouse_reset(DeviceState *dev)
static const VMStateDescription vmstate_adb_mouse = {
.name = "adb_mouse",
- .version_id = 1,
- .minimum_version_id = 1,
+ .version_id = 2,
+ .minimum_version_id = 2,
.fields = (VMStateField[]) {
+ VMSTATE_STRUCT(parent_obj, MouseState, 0, vmstate_adb_device,
ADBDevice),
VMSTATE_INT32(buttons_state, MouseState),
VMSTATE_INT32(last_buttons_state, MouseState),
VMSTATE_INT32(dx, MouseState),
--
1.7.10.4
- [Qemu-ppc] [PATCH 0/7] ppc: loadvm/savevm fixups for -M g3beige and -M mac99, Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 6/7] openpic: fix segfault on -M mac99 savevm, Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 1/7] macio.c: include parent PCIDevice state in VMStateDescription, Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 2/7] adb.c: include ADBDevice parent state in KBDState and MouseState,
Mark Cave-Ayland <=
- [Qemu-ppc] [PATCH 4/7] ppc: move sdr1 value change detection logic to helper_store_sdr1(), Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 5/7] ppc: force update of all msr bits in cpu_post_load, Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 7/7] openpic: fix up loadvm under -M mac99, Mark Cave-Ayland, 2014/12/22
- [Qemu-ppc] [PATCH 3/7] cuda.c: include adb_poll_timer in VMStateDescription, Mark Cave-Ayland, 2014/12/22