[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 22/38] adb.c: include ADBDevice parent state in KBDStat
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 22/38] adb.c: include ADBDevice parent state in KBDState and MouseState |
Date: |
Sun, 8 Mar 2015 09:44:41 +0100 |
From: Mark Cave-Ayland <address@hidden>
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>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/input/adb.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/hw/input/adb.c b/hw/input/adb.c
index 34c8058..a18eea2 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,11 @@ 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.8.1.4
- [Qemu-ppc] [PULL 10/38] pseries: Add spapr_rtc_read() helper function, (continued)
- [Qemu-ppc] [PULL 10/38] pseries: Add spapr_rtc_read() helper function, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 35/38] PPC: Introduce the Virtual Time Base (VTB) SPR register, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 11/38] pseries: Make RTAS time of day functions respect -rtc options, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 19/38] Openpic: check that cpu id is within the number of cpus, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 12/38] pseries: Make the PAPR RTC a qdev device, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 13/38] pseries: Move rtc_offset into RTC device's state structure, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 21/38] macio.c: include parent PCIDevice state in VMStateDescription, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 32/38] ppc64-softmmu: Remove unsupported FDC from config, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 08/38] pseries: Move sPAPR RTC code into its own file, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 04/38] spapr: Add pseries-2.3 machine, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 22/38] adb.c: include ADBDevice parent state in KBDState and MouseState,
Alexander Graf <=
- [Qemu-ppc] [PULL 03/38] pseries: Limit PCI host bridge "index" value, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 17/38] vga: Expose framebuffer byteorder as a QOM property, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 07/38] Add more VMSTATE_*_TEST variants for integers, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 34/38] PPC: Remove duplicate OPENPIC defines in default-configs, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 36/38] target-ppc: Add versions to server CPU descriptions, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 37/38] sPAPR: Implement EEH RTAS calls, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 29/38] openpic: convert to vmstate, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 30/38] spapr_vio: Convert to realize(), Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 27/38] openpic: fix up loadvm under -M mac99, Alexander Graf, 2015/03/08
- Re: [Qemu-ppc] [PULL 2.3 00/38] ppc patch queue 2015-03-08, Peter Maydell, 2015/03/09