[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/6] hw/input/stellaris_gamepad: Remove StellarisGamepadButto
From: |
Peter Maydell |
Subject: |
Re: [PATCH 4/6] hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct |
Date: |
Tue, 17 Oct 2023 13:52:21 +0100 |
On Tue, 17 Oct 2023 at 13:44, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Hi Peter,
>
> On 17/10/23 14:23, Peter Maydell wrote:
> > Currently for each button on the device we have a
> > StellarisGamepadButton struct which has the irq, keycode and pressed
> > state for it. When we convert to qdev, the qdev property and GPIO
> > APIs are going to require that we have separate arrays for the irqs
> > and keycodes. Convert from array-of-structs to three separate arrays
> > in preparation.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> > hw/input/stellaris_gamepad.c | 43 ++++++++++++------------------------
> > 1 file changed, 14 insertions(+), 29 deletions(-)
>
>
> > -static const VMStateDescription vmstate_stellaris_button = {
> > - .name = "stellaris_button",
> > - .version_id = 0,
> > - .minimum_version_id = 0,
> > - .fields = (VMStateField[]) {
> > - VMSTATE_UINT8(pressed, StellarisGamepadButton),
> > - VMSTATE_END_OF_LIST()
> > - }
> > -};
> > -
> > static const VMStateDescription vmstate_stellaris_gamepad = {
> > .name = "stellaris_gamepad",
> > .version_id = 2,
> > .minimum_version_id = 2,
> > .fields = (VMStateField[]) {
> > VMSTATE_INT32(extension, StellarisGamepad),
> > - VMSTATE_STRUCT_VARRAY_POINTER_INT32(buttons, StellarisGamepad,
> > - num_buttons,
> > - vmstate_stellaris_button,
> > - StellarisGamepadButton),
> > + VMSTATE_VARRAY_UINT32(pressed, StellarisGamepad, num_buttons,
> > + 0, vmstate_info_uint8, uint8_t),
>
> Don't this break the migration stream?
Yes; this is OK because we don't care about migration compat
for this board. But I forgot to mention it in the commit
message, and we should bump the version_id fields too.
thanks
-- PMM
- [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev, Peter Maydell, 2023/10/17
- [PATCH 6/6] hw/input/stellaris_gamepad: Convert to qemu_input_handler_register(), Peter Maydell, 2023/10/17
- [PATCH 3/6] qdev: Add qdev_prop_set_array(), Peter Maydell, 2023/10/17
- [PATCH 5/6] hw/input/stellaris_input: Convert to qdev, Peter Maydell, 2023/10/17
- Re: [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev, Philippe Mathieu-Daudé, 2023/10/30