On Mon, Nov 18, 2019 at 6:22 PM Peter Maydell <[email protected]> wrote: > > On Wed, 23 Oct 2019 at 18:33, Marc-André Lureau > <[email protected]> wrote: > > > > QOM-ify further. > > > > Signed-off-by: Marc-André Lureau <[email protected]> > > --- > > hw/char/serial.c | 13 ++++++++++--- > > 1 file changed, 10 insertions(+), 3 deletions(-) > > > > diff --git a/hw/char/serial.c b/hw/char/serial.c > > index c839035fdd..4af8b0ce4c 100644 > > --- a/hw/char/serial.c > > +++ b/hw/char/serial.c > > @@ -990,8 +990,7 @@ SerialState *serial_init(int base, qemu_irq irq, int > > baudbase, > > s->baudbase = baudbase; > > qemu_chr_fe_init(&s->chr, chr, &error_abort); > > serial_realize_core(s, &error_fatal); > > - > > - vmstate_register(NULL, base, &vmstate_serial, s); > > + qdev_set_legacy_instance_id(dev, base, 2); > > qdev_init_nofail(dev); > > Did you test whether migration still works from a QEMU > version without this patch to one with it? (The migration
Yes, I thought I did test correctly, but I realized testing with x86 isn't correct. So with arm/musicpal for ex, I can migrate from before->after, however after->before won't work. Is that ok? > vmstate code is too complicated for me to be able to figure > out whether passing the 'dev' pointer makes a difference > to whot it names the state sections and whether the > 'qdev_set_legacy_instance_id' suffices to avoid problems.) I don't see a way to fix after->before, because the instance id is initially 0 with the new code, and the old code expect a different value.
