qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 4/6] hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct
Date: Tue, 17 Oct 2023 15:09:05 +0200	[thread overview]
Message-ID: <ae8c8832-4d67-a0dc-5dc9-2a7da560f2c9@linaro.org> (raw)
In-Reply-To: <CAFEAcA8OfRyVnP-tdMWz0g9HvYJtQb6xDha1zO05Dp855_SMfw@mail.gmail.com>

On 17/10/23 14:52, Peter Maydell wrote:
> 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.

OK, this is what I thought (I'm still trying to correctly understand
that myself). With that updated:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




  reply	other threads:[~2023-10-17 13:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 12:22 [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev Peter Maydell
2023-10-17 12:22 ` [PATCH 1/6] hw/input/stellaris_input: Rename to stellaris_gamepad Peter Maydell
2023-10-17 12:44   ` Philippe Mathieu-Daudé
2023-10-17 12:22 ` [PATCH 2/6] hw/input/stellaris_gamepad: Rename structs to our usual convention Peter Maydell
2023-10-17 12:44   ` Philippe Mathieu-Daudé
2023-10-17 12:22 ` [PATCH 3/6] qdev: Add qdev_prop_set_array() Peter Maydell
2023-10-17 12:23 ` [PATCH 4/6] hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct Peter Maydell
2023-10-17 12:44   ` Philippe Mathieu-Daudé
2023-10-17 12:52     ` Peter Maydell
2023-10-17 13:09       ` Philippe Mathieu-Daudé [this message]
2023-10-17 12:23 ` [PATCH 5/6] hw/input/stellaris_input: Convert to qdev Peter Maydell
2023-10-17 12:48   ` Philippe Mathieu-Daudé
2023-10-17 12:49     ` Peter Maydell
2023-10-17 12:23 ` [PATCH 6/6] hw/input/stellaris_gamepad: Convert to qemu_input_handler_register() Peter Maydell
2023-10-17 13:09   ` Philippe Mathieu-Daudé
2023-10-19 21:47   ` Philippe Mathieu-Daudé
2023-10-30 10:39 ` [PATCH 0/6] arm/stellaris: convert gamepad input device to qdev Philippe Mathieu-Daudé
2023-10-30 11:29   ` Peter Maydell
2023-10-30 13:19     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae8c8832-4d67-a0dc-5dc9-2a7da560f2c9@linaro.org \
    --to=philmd@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).