QOM-ify further. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- hw/char/serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/char/serial.c b/hw/char/serial.c index fb0dd98103..143e39c1b1 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); memory_region_init_io(&s->io, NULL, &serial_io_ops, s, "serial", 8); @@ -1005,6 +1004,7 @@ static void serial_class_init(ObjectClass *klass, void* data) DeviceClass *dc = DEVICE_CLASS(klass); dc->user_creatable = false; + dc->vmsd = &vmstate_serial; } static const TypeInfo serial_info = { @@ -1068,7 +1068,7 @@ SerialState *serial_mm_init(MemoryRegion *address_space, 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(DEVICE(s), base, 2); qdev_init_nofail(dev); memory_region_init_io(&s->io, NULL, &serial_mm_ops[end], s, -- 2.23.0.606.g08da6496b6