[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vm
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field |
Date: |
Fri, 26 Jul 2019 10:59:25 +0100 |
User-agent: |
Mutt/1.12.0 (2019-05-25) |
* Peter Maydell (address@hidden) wrote:
> On Thu, 25 Jul 2019 at 18:40, Philippe Mathieu-Daudé <address@hidden> wrote:
> >
> > On 7/25/19 7:02 PM, Dr. David Alan Gilbert wrote:
> > > * Peter Maydell (address@hidden) wrote:
> > >> gamepad_state::buttons is a pointer to an array of structs,
> > >> not an array of structs, so should be declared in the vmstate
> > >> with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we
> > >> corrupt memory on incoming migration.
> > >>
> > >> We bump the vmstate version field as the easiest way to
> > >> deal with the migration break, since migration wouldn't have
> > >> worked reliably before anyway.
> > >>
> > >> Signed-off-by: Peter Maydell <address@hidden>
> > >
> > > OK, it would be great to change num_buttons to uint32_t and make that a
> > > UINT32 at some point; it's hard to press negative buttons.
> >
> > Since the version is incremented, now seems to be a good time.
>
> ...except this patch is for 4.1 and we've already done rc2,
> so it's not really an ideal time to put in code cleanups...
Don't worry; you can always change the int to a uint later without
bumping the version again. Unless someone somewhere has a device with
-ve buttons it'll be fine.
Dave
> thanks
> -- PMM
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [Qemu-arm] [PATCH for-4.1? 0/2] Typecheck VMSTATE VARRAY macros and fix bug found, Peter Maydell, 2019/07/25
- Re: [Qemu-arm] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field, Peter Maydell, 2019/07/25
- Re: [Qemu-arm] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field, Dr. David Alan Gilbert, 2019/07/25
- Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field, Damien Hedde, 2019/07/26
- Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field, Peter Maydell, 2019/07/26
[Qemu-arm] [PATCH for-4.1? 2/2] vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros, Peter Maydell, 2019/07/25