diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2024-10-18 11:18:25 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-05 14:18:14 +0100 |
| commit | d36f165d9523a5d151f11888938fcc66a6dd10df (patch) | |
| tree | 531195304568083712eb91cbf59452e615458351 /include/hw/qdev-core.h | |
| parent | 11b8920ed2093848f79f93d106afe8a69a61a523 (diff) | |
| download | focaccia-qemu-d36f165d9523a5d151f11888938fcc66a6dd10df.tar.gz focaccia-qemu-d36f165d9523a5d151f11888938fcc66a6dd10df.zip | |
qdev: make properties array "const"
Constify all accesses to qdev properties, except for the ObjectPropertyAccessor itself. This makes it possible to place them in read-only memory, and also lets Rust bindings switch from "static mut" arrays to "static"; which is advantageous, because mutable statics are highly discouraged. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/qdev-core.h')
| -rw-r--r-- | include/hw/qdev-core.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index aa97c34a4b..f9fa291cc6 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -132,7 +132,7 @@ struct DeviceClass { * ensures a compile-time error if someone attempts to assign * dc->props directly. */ - Property *props_; + const Property *props_; /** * @user_creatable: Can user instantiate with -device / device_add? @@ -935,7 +935,7 @@ char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev); * you attempt to add an existing property defined by a parent class. * To modify an inherited property you need to use???? */ -void device_class_set_props(DeviceClass *dc, Property *props); +void device_class_set_props(DeviceClass *dc, const Property *props); /** * device_class_set_parent_realize() - set up for chaining realize fns |