On Mon, Sep 21, 2020 at 3:28 PM Eduardo Habkost <ehabk...@redhat.com> wrote: > > Class properties make QOM introspection simpler and easier, as > they don't require an object to be instantiated. > > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com> Alistair > --- > Cc: Alistair Francis <alist...@alistair23.me> > Cc: "Edgar E. Iglesias" <edgar.igles...@gmail.com> > Cc: Peter Maydell <peter.mayd...@linaro.org> > Cc: qemu-...@nongnu.org > Cc: qemu-devel@nongnu.org > --- > hw/arm/xlnx-zcu102.c | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) > > diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c > index 19d5a4d4e0e..4deb96bfcc1 100644 > --- a/hw/arm/xlnx-zcu102.c > +++ b/hw/arm/xlnx-zcu102.c > @@ -208,20 +208,8 @@ static void xlnx_zcu102_machine_instance_init(Object > *obj) > > /* Default to secure mode being disabled */ > s->secure = false; > - object_property_add_bool(obj, "secure", zcu102_get_secure, > - zcu102_set_secure); > - object_property_set_description(obj, "secure", > - "Set on/off to enable/disable the ARM " > - "Security Extensions (TrustZone)"); > - > /* Default to virt (EL2) being disabled */ > s->virt = false; > - object_property_add_bool(obj, "virtualization", zcu102_get_virt, > - zcu102_set_virt); > - object_property_set_description(obj, "virtualization", > - "Set on/off to enable/disable emulating > a " > - "guest CPU which implements the ARM " > - "Virtualization Extensions"); > } > > static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data) > @@ -237,6 +225,19 @@ static void xlnx_zcu102_machine_class_init(ObjectClass > *oc, void *data) > mc->max_cpus = XLNX_ZYNQMP_NUM_APU_CPUS + XLNX_ZYNQMP_NUM_RPU_CPUS; > mc->default_cpus = XLNX_ZYNQMP_NUM_APU_CPUS; > mc->default_ram_id = "ddr-ram"; > + > + object_class_property_add_bool(oc, "secure", zcu102_get_secure, > + zcu102_set_secure); > + object_class_property_set_description(oc, "secure", > + "Set on/off to enable/disable the > ARM " > + "Security Extensions (TrustZone)"); > + > + object_class_property_add_bool(oc, "virtualization", zcu102_get_virt, > + zcu102_set_virt); > + object_class_property_set_description(oc, "virtualization", > + "Set on/off to enable/disable > emulating a " > + "guest CPU which implements the > ARM " > + "Virtualization Extensions"); > } > > static const TypeInfo xlnx_zcu102_machine_init_typeinfo = { > -- > 2.26.2 > >