Message ID | 20210117192446.23753-17-f4bug@amsat.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw: Mark the device with no migratable fields | expand |
вс, 17 янв. 2021 г., 20:26 Philippe Mathieu-Daudé <f4bug@amsat.org>: > These devices don't have fields to migrate. Be explicit > by using vmstate_qdev_no_state_to_migrate. > > Add a more descriptive comment to keep a clear separation > between static property vs runtime changeable. > Nice, thanks for this! > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com> --- > hw/sparc64/sun4u.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c > index 0fa13a73302..fdf0aa875be 100644 > --- a/hw/sparc64/sun4u.c > +++ b/hw/sparc64/sun4u.c > @@ -84,12 +84,15 @@ struct hwdef { > struct EbusState { > /*< private >*/ > PCIDevice parent_obj; > + /*< public >*/ > > ISABus *isa_bus; > qemu_irq isa_bus_irqs[ISA_NUM_IRQS]; > - uint64_t console_serial_base; > MemoryRegion bar0; > MemoryRegion bar1; > + > + /* Properties */ > + uint64_t console_serial_base; > }; > > #define TYPE_EBUS "ebus" > @@ -386,6 +389,7 @@ static void ebus_class_init(ObjectClass *klass, void > *data) > k->device_id = PCI_DEVICE_ID_SUN_EBUS; > k->revision = 0x01; > k->class_id = PCI_CLASS_BRIDGE_OTHER; > + dc->vmsd = vmstate_qdev_no_state_to_migrate; > device_class_set_props(dc, ebus_properties); > } > > -- > 2.26.2 > >
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 0fa13a73302..fdf0aa875be 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -84,12 +84,15 @@ struct hwdef { struct EbusState { /*< private >*/ PCIDevice parent_obj; + /*< public >*/ ISABus *isa_bus; qemu_irq isa_bus_irqs[ISA_NUM_IRQS]; - uint64_t console_serial_base; MemoryRegion bar0; MemoryRegion bar1; + + /* Properties */ + uint64_t console_serial_base; }; #define TYPE_EBUS "ebus" @@ -386,6 +389,7 @@ static void ebus_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_SUN_EBUS; k->revision = 0x01; k->class_id = PCI_CLASS_BRIDGE_OTHER; + dc->vmsd = vmstate_qdev_no_state_to_migrate; device_class_set_props(dc, ebus_properties); }
These devices don't have fields to migrate. Be explicit by using vmstate_qdev_no_state_to_migrate. Add a more descriptive comment to keep a clear separation between static property vs runtime changeable. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/sparc64/sun4u.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)