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 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.) thanks -- PMM
