On Sun, 30 May 2021 at 11:55, Lukas Jünger <lukas.juen...@greensocs.com> wrote: > > QOMify sifive_uart model > > Signed-off-by: Lukas Jünger <lukas.juen...@greensocs.com> > --- > include/hw/char/sifive_uart.h | 6 +-- > hw/char/sifive_uart.c | 72 ++++++++++++++++++++++++++++++----- > 2 files changed, 65 insertions(+), 13 deletions(-)
> +static void sifive_uart_class_init(ObjectClass *oc, void *data) > +{ > + DeviceClass *dc = DEVICE_CLASS(oc); > + > + dc->realize = sifive_uart_realize; > + device_class_set_props(dc, sifive_uart_properties); > +} > + > +static const TypeInfo sifive_uart_info = { > + .name = TYPE_SIFIVE_UART, > + .parent = TYPE_SYS_BUS_DEVICE, > + .instance_size = sizeof(SiFiveUARTState), > + .instance_init = sifive_uart_init, > + .class_init = sifive_uart_class_init, > +}; > + > +static void sifive_uart_register_types(void) > +{ > + type_register_static(&sifive_uart_info); > +} > + > +type_init(sifive_uart_register_types) All new QOM devices must implement migration. This is a baseline requirement so that we always ratchet upwards. It holds even if not all other devices in the machine model support migration -- that way we can gradually move towards actually supporting migration. You're also missing an implementation of the reset method. thanks -- PMM