diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-11-11 13:38:17 -0500 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-15 10:02:07 -0500 |
commit | 27edeeaafe439d0f58d9ff464a97ec418293d0b7 (patch) | |
tree | b75db6d48903aaed5eb6b4f224da28c8654fbdac | |
parent | b91def7b8382eb862bad5a60e752a02b7123db71 (diff) | |
download | qemu-27edeeaafe439d0f58d9ff464a97ec418293d0b7.zip qemu-27edeeaafe439d0f58d9ff464a97ec418293d0b7.tar.gz qemu-27edeeaafe439d0f58d9ff464a97ec418293d0b7.tar.bz2 |
virt: Register "its" as class property
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Note: "its" is currently registered conditionally, but this makes
the feature be registered unconditionally. The only side effect
is that it will be now possible to set its=on on virt-2.7 and
older.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20201111183823.283752-7-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | hw/arm/virt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6a37d07..9698591 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2531,6 +2531,13 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) "Set on/off to enable/disable emulating a " "guest CPU which implements the ARM " "Memory Tagging Extension"); + + object_class_property_add_bool(oc, "its", virt_get_its, + virt_set_its); + object_class_property_set_description(oc, "its", + "Set on/off to enable/disable " + "ITS instantiation"); + } static void virt_instance_init(Object *obj) @@ -2558,11 +2565,6 @@ static void virt_instance_init(Object *obj) } else { /* Default allows ITS instantiation */ vms->its = true; - object_property_add_bool(obj, "its", virt_get_its, - virt_set_its); - object_property_set_description(obj, "its", - "Set on/off to enable/disable " - "ITS instantiation"); } /* Default disallows iommu instantiation */ |