diff options
author | Peter Maydell | 2020-12-15 16:35:47 +0100 |
---|---|---|
committer | Peter Maydell | 2020-12-15 16:35:47 +0100 |
commit | 69e92bd558d71fdbd0c1989391b20edcc700daa9 (patch) | |
tree | 68a95e1c194f56973a86183dddcb77d46ceb0402 /include/hw | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/audio-20201215-pull-request... (diff) | |
parent | MAINTAINERS: Update my git repository URLs (diff) | |
download | qemu-69e92bd558d71fdbd0c1989391b20edcc700daa9.tar.gz qemu-69e92bd558d71fdbd0c1989391b20edcc700daa9.tar.xz qemu-69e92bd558d71fdbd0c1989391b20edcc700daa9.zip |
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
Machine queue, 2020-12-15
* qdev code cleanup
* Convert some QOM instance properties to class properties
* Update git URLs on MAINTAINERS
# gpg: Signature made Tue 15 Dec 2020 15:18:47 GMT
# gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg: issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/machine-next-pull-request: (25 commits)
MAINTAINERS: Update my git repository URLs
qdev: Move UUID property to qdev-properties-system.c
qdev: Make qdev_propinfo_get_uint16() static
qdev: Make error_set_from_qdev_prop_error() get Object* argument
qdev: Make check_prop_still_unset() get Object* argument
qdev: Make qdev_find_global_prop() get Object* argument
qdev: Make qdev_get_prop_ptr() get Object* arg
qdev: Make bit_prop_set() get Object* argument
qdev: Make PropertyInfo.print method get Object* argument
qdev: Don't use dev->id on set_size32() error message
sparc: Check dev->realized at sparc_set_nwindows()
qdev: Check dev->realized at set_size()
qdev: Move property code to qdev-properties.[ch]
cpu: Move cpu_common_props to hw/core/cpu.c
cs4231: Get rid of empty property array
netfilter: Use class properties
netfilter: Reorder functions
can_host: Use class properties
arm/cpu64: Register "aarch64" as class property
virt: Register "its" as class property
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/core/cpu.h | 1 | ||||
-rw-r--r-- | include/hw/qdev-core.h | 37 | ||||
-rw-r--r-- | include/hw/qdev-properties.h | 44 |
3 files changed, 41 insertions, 41 deletions
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 3d92c967ff..8e7552910d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1111,7 +1111,6 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx); void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -extern Property cpu_common_props[]; void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 9fbb22a48d..8f91faebc3 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -277,43 +277,6 @@ struct BusState { }; /** - * Property: - * @set_default: true if the default value should be set from @defval, - * in which case @info->set_default_value must not be NULL - * (if false then no default value is set by the property system - * and the field retains whatever value it was given by instance_init). - * @defval: default value for the property. This is used only if @set_default - * is true. - */ -struct Property { - const char *name; - const PropertyInfo *info; - ptrdiff_t offset; - uint8_t bitnr; - bool set_default; - union { - int64_t i; - uint64_t u; - } defval; - int arrayoffset; - const PropertyInfo *arrayinfo; - int arrayfieldsize; - const char *link_type; -}; - -struct PropertyInfo { - const char *name; - const char *description; - const QEnumLookup *enum_table; - int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len); - void (*set_default_value)(ObjectProperty *op, const Property *prop); - void (*create)(ObjectClass *oc, Property *prop); - ObjectPropertyAccessor *get; - ObjectPropertyAccessor *set; - ObjectPropertyRelease *release; -}; - -/** * GlobalProperty: * @used: Set to true if property was used when initializing a device. * @optional: If set to true, GlobalProperty will be skipped without errors diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 4437450065..530286e869 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -3,6 +3,44 @@ #include "hw/qdev-core.h" +/** + * Property: + * @set_default: true if the default value should be set from @defval, + * in which case @info->set_default_value must not be NULL + * (if false then no default value is set by the property system + * and the field retains whatever value it was given by instance_init). + * @defval: default value for the property. This is used only if @set_default + * is true. + */ +struct Property { + const char *name; + const PropertyInfo *info; + ptrdiff_t offset; + uint8_t bitnr; + bool set_default; + union { + int64_t i; + uint64_t u; + } defval; + int arrayoffset; + const PropertyInfo *arrayinfo; + int arrayfieldsize; + const char *link_type; +}; + +struct PropertyInfo { + const char *name; + const char *description; + const QEnumLookup *enum_table; + int (*print)(Object *obj, Property *prop, char *dest, size_t len); + void (*set_default_value)(ObjectProperty *op, const Property *prop); + void (*create)(ObjectClass *oc, Property *prop); + ObjectPropertyAccessor *get; + ObjectPropertyAccessor *set; + ObjectPropertyRelease *release; +}; + + /*** qdev-properties.c ***/ extern const PropertyInfo qdev_prop_bit; @@ -264,14 +302,14 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name, const uint8_t *value); void qdev_prop_set_enum(DeviceState *dev, const char *name, int value); -void *qdev_get_prop_ptr(DeviceState *dev, Property *prop); +void *qdev_get_prop_ptr(Object *obj, Property *prop); void qdev_prop_register_global(GlobalProperty *prop); -const GlobalProperty *qdev_find_global_prop(DeviceState *dev, +const GlobalProperty *qdev_find_global_prop(Object *obj, const char *name); int qdev_prop_check_globals(void); void qdev_prop_set_globals(DeviceState *dev); -void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, +void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, Property *prop, const char *value); /** |