qom/qdev: associate properties with QAPI schema types
Subsystems (8)
v8 cover qom/qdev: associate properties with QAPI schema types
This is a bigger change from v7 than I'd like, but it gets us to something I'm willing to merge late in the development cycle. In this version:
1. The new @qapi-type in output of qom-list, qom-list-get, qom-list-properties is marked unstable. See thread
Subject: ObjectPropertyInfo design (was: [PATCH v7 00/65] Hi)
Date: Thu, 22 Oct 2026 16:04:44 +0200
Message-ID: <[email protected]>2. No changes to @type values in output of qom-list, qom-list-get, qom-list-properties. The changed values are not enough of an improvement to be worth the risk and the churn.
3. Less code churn:
v7: 170 files changed, 2317 insertions(+), 1628 deletions(-)
v8: 148 files changed, 1638 insertions(+), 1067 deletions(-)
Changes in v8:
* PATCH 11: Mark new qapi-type unstable. While there, improve commit message to better explain why we're doing this.
* Drop typed array PropertyInfos
Why? They complicate matters, and I ran out of time.
- PATCH 07+09: Drop QAPITypeInfo member @list.
- PATCH 09: Doc adjustment.
- Old PATCH 59-60: Drop.
- PATCH 52: Drop only PropertyInfo member @enum_table. Commit message adjusted accordingly.
* Extend object_property_try_add(), object_property_add(), object_class_property_add_enum() instead of adding _add_qapi variants. Avoid changing values of ObjectPropertyInfo / ObjectPropertyValue member @type.
- PATCH 09: Doc adjustment.
- PATCH 14-16: New, replacing old PATCH 16-17.
- PATCH 17-32,36-45,53: Adjust the conversions, and where appropriate their commit messages.
- Old PATCH 19: Drop, because the above removed the new helper's only use.
- PATCH 32: Keep SpaprCapabilityInfo member @type, name new member @qapi_type instead of @type.
- PATCH 46: Simplify, adjust commit message accordingly.
- PATCH 47-51: Keep PropertyInfo member @type, adjust commit messages accordingly.
- PATCH 54: New, replacing old PATCH 63.
* Avoid other changes to values of ObjectPropertyInfo / ObjectPropertyValue member @type.
- Old PATCH 33,48-51,54: Drop.
- PATCH 48: Add a comment to qdev_prop_pci_devfn.
* Missing conversions
- PATCH 26: Property "guest-memfd" in backends/hostmem-memfd.c. Commit message adjusted.
- PATCH 36: Property ACPI_PM_PROP_GPE0_BLK in hw/acpi/ich9.c, "subsystem-base" in hw/hexagon/hexagon_dsp.c, "socket" in hw/remote/vfio-user-obj.c, "policy" and "tsc-frequency" in target/i386/sev.c.
- PATCH 36: object_class_property_add_bool_ptr(),
object_class_property_add_uint8_ptr()
object_class_property_add_uint16_ptr(),
object_class_property_add_uint32_ptr(),
object_class_property_add_uint64_ptr().- This list may not be complete.
* Miscellaneous minor stuff
- PATCH 02-04,09: Update docs/devel/qapi-code-gen.rst examples.
- PATCH 07: Comment tweaked.
- PATCH 09: Explain why modular in commit message.
- Old PATCH 10 squashed into 09.
- PATCH 36: Use &uint32_type_info qapi-type with "uint64_t" type, not &size_type_info, to keep the patch mechanical.
- PATCH 40+41+53: QAPI schema comments tweaked.
- PATCH 40: Move assertion to a more logical place.
- PATCH 55: Exploit all enums have non-null @qapi_type.
Marc-André's cover letter for v7:
This series connects QOM and qdev properties to the QAPI type system, so that management tools can discover the QAPI schema type of each object property.
Today, QOM properties carry a free-form "type" string ("bool", "uint32", "OnOffAuto", ..) that has no formal link to the QAPI schema exposed by query-qmp-schema. Management tools must maintain ad-hoc mappings or rely on naming conventions to figure out how to interpret property values.
This series adds:
- A new QAPITypeInfo struct that pairs a property with its QAPI schema type name, enum lookup table, and list-element type.
- A QAPI code generator (qapi-type-infos) that emits a QAPITypeInfo instance for every schema-defined type, including the mapping between internal C names and the schema name visible to clients.
- A "qapi-type" field in the ObjectPropertyInfo and ObjectPropertyValue QMP structs, populated from the QAPITypeInfo when present giving clients a cross-reference into query-qmp-schema output.
- Conversion of all PropertyInfo definitions from the old .type/.enum_table strings to the new .qapi_type pointer.
- Replacement of the generic qdev_prop_array with typed per-element array PropertyInfos, removing the arrayinfo/arrayfieldsize indirection from struct Property.
- Removal of the deprecated PropertyInfo.type and .enum_table fields, and of the old object_property_add_enum/add_tm APIs.
Along the way, a few pre-existing type mismatches in property definitions are fixed, the "struct tm" RTC property is replaced with a proper QAPI StructTm type etc. Introducing more specific types or a "typedef" to QAPI could help provide better associated type informations than plain "str" in many cases, for example.
Changes in v7:
- fixed a few more mis-typed list properties
- use designated initializers for StructTm fields
- assert enum get() returns >= or an error
- a few commit message and code comment tweaks
- rebased, add r-b trailers
Changes in v6:
- Rebase, resolve a few conflicts
- Replace old PATCH 03-04 by new PATCH 01-06, adjust PATCH 09 [old PATCH 05]
- Fix temporary build breakage: convert PCSouthBridgeOption only when it gets QAPIfied [PATCH 62], delay removal of old interface until after that [PATCH 63].
- Clean up checkpatch long line warnings, except leave the ones in PATCH 38 for later
Changes in v5:
- make "masked_name" mandatory, skip QType QAPITypeInfo generation
- added/split "hw/ppc/spapr_caps: fix property type name" patch
- added "qapi: select introspectable types directly", simplifying type discovery
- fixed an include path
- doc adjustments
- rebased, collect r-b trailers
- Link to v4: https://lore.kernel.org/qemu-devel/[email protected]
Changes in v4:
- new patch "qom/qmp: populate description & default-value"
- added gtk-doc comments for class_property_add_qapi*()
- correct some property types to reflect the visitor
- collected rb, rebased
- Link to v3: https://lore.kernel.org/qemu-devel/[email protected]
Changes in v3:
- QAPI analysis redesign (replacing the old "expose name map" from introspect)
- all non-implicit QAPI types are now introspectable, including QOM-only types
- QAPITypeInfo.schema_name -> masked_name
- exposes integer signedness and width through query-qmp-schema
- various extra property fixes
- rebase, some patch split or merge
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]
Changes in v2:
- Added kernel-doc documentation for the QAPITypeInfo struct fields.
- Dropped "qom: drop free-form property typename registration", it's
still needed for array of links to provide useful type names.
- Added qdev_prop_link_list for array-of-links properties, with a
create function that generates "link<TYPE>List" type names matching the existing "link<TYPE>" convention.
- qdev_prop_link now uses &str_type_info instead of "link" (the full "link<TYPE>" type name is set at property-add time)
- Simplified DEFINE_PROP_LINK_ARRAY to use qdev_prop_link_list, dropping
the now-unnecessary _arraytype parameter.
- rebased
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]
Marc-André Lureau (46):
qapi: add QAPITypeInfo struct definition
qapi/gen: fix _module_basename for multi-dash 'what' parameters
qapi: add type-infos generator
qom: add qapi_type field to ObjectProperty
qapi/qom: add qapi-type to qom-list, qom-list-properties, qom-list-get qom/qmp: populate qapi-type in QMP handlers
qom/qmp: populate description & default-value in qom_property_info()
tests: update check-qom-proplist for QAPI-aware property registration
qom: convert QAPI enum properties to QAPI-aware registration
qom: convert struct properties to QAPI-aware registration
x86: convert OnOffAuto properties to QAPI-aware registration
microvm: convert OnOffAuto properties to QAPI-aware registration
pc: convert OnOffAuto vmport property to QAPI-aware registration arm/virt: convert OnOffAuto acpi property to QAPI-aware registration riscv/virt: convert OnOffAuto properties to QAPI-aware registration loongarch/virt: convert OnOffAuto properties to QAPI-aware
registration
hostmem: convert OnOffAuto rom property to QAPI-aware registration
sev: convert OnOffAuto legacy-vm-type property to QAPI-aware
registration
whpx: convert OnOffAuto hyperv property to QAPI-aware registration
whpx: convert OnOffAuto arch properties to QAPI-aware registration accel/kvm: convert OnOffSplit property to QAPI-aware registration
whpx: convert OnOffSplit property to QAPI-aware registration ppc/spapr-caps: convert to QAPI-aware property registration net/colo-compare: fix compare_timeout setter visitor type net/colo-compare: fix max_queue_size setter visitor type hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events
qom: convert scalar properties to QAPI-aware registration i386/cpu: convert strList property to QAPI-aware registration accel/hvf: convert OnOffSplit property to QAPI-aware registration i386/x86: convert SgxEPCList property to QAPI-aware registration
virtio-balloon: convert guest-stats property to QAPI type
qom: replace object_property_add_tm with StructTm QAPI type hw/nvdimm: convert UUID property to QAPI-aware registration hw/s390-virtio-ccw: convert loadparm property to QAPI-aware
registration
hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration hw/s390x: convert BootCertificatesList to QAPI-aware registration
qdev: add qapi_type field to PropertyInfo with fallback registration
qdev: convert core PropertyInfo definitions to use qapi_type
qdev: convert system PropertyInfo definitions to use qapi_type
hw: convert device-local PropertyInfo definitions to use qapi_type target/riscv: convert PropertyInfo definitions to use qapi_type
qdev: convert PropertyInfo definitions to use qapi_type
qdev: PropertyInfo.enum_table is no longer used, drop hw/i386: convert PCSouthBridgeOption to QAPI enum
qom: use QAPITypeInfo in object_property_get_enum tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema
Markus Armbruster (10):
qapi/schema: Rename .lookup_entity() and tighten return type
qapi: Ease access to introspection names qapi/introspect: Simplify masked name comment emission slighly qapi/introspect: Don't elide types
qapi: QAPISchemaVisitor.visit_needed() is now unused, drop qapi/introspect: Tweak integer type masking
qom: New object_property_add() etc. parameter @qapi_type qom/object: Move enum property code so it is together
qom: New object_property_add_enum() etc. parameter @qapi_type
qom: Drop object_property_add_enum() parameter @lookup
docs/devel/qapi-code-gen.rst | 161 +++++++++++++----- docs/interop/virtio-balloon-stats.rst | 22 +-- docs/sphinx/qapidoc.py | 2 +- meson.build | 1 + qapi/common.json | 27 +++ qapi/machine.json | 101 ++++++++++++ qapi/pragma.json | 1 + qapi/qom.json | 18 ++ include/chardev/char.h | 3 +- include/hw/core/qdev-properties.h | 2 +- include/hw/i386/pc.h | 4 +- include/qapi/qapi-type-info.h | 25 +++ include/qom/object.h | 48 ++---- accel/hvf/hvf-all.c | 24 +-- accel/kvm/kvm-all.c | 33 ++-- accel/nitro/nitro-accel.c | 2 + accel/tcg/tcg-all.c | 7 +- accel/whpx/whpx-common.c | 48 ++---- authz/list.c | 7 +- backends/cryptodev.c | 7 +- backends/hostmem-file.c | 40 ++--- backends/hostmem-memfd.c | 25 ++- backends/hostmem.c | 30 ++-- backends/spdm-socket.c | 3 +- backends/tpm/tpm_util.c | 2 + block/throttle-groups.c | 11 +- chardev/char-socket.c | 2 + crypto/secret_common.c | 6 +- crypto/secret_keyring.c | 9 +- crypto/tlscreds.c | 6 +- event-loop-base.c | 4 + hw/acpi/ich9.c | 2 + hw/acpi/pci.c | 9 +- hw/arm/virt.c | 35 ++-- hw/block/xen-block.c | 2 + hw/core/clock.c | 2 + hw/core/machine-qmp-cmds.c | 4 +- hw/core/machine.c | 27 +-- hw/core/qdev-properties-system.c | 69 +++++--- hw/core/qdev-properties.c | 41 ++++- hw/cpu/core.c | 7 +- hw/cxl/cxl-host.c | 4 +- hw/gpio/aspeed_gpio.c | 9 +- hw/gpio/aspeed_sgpio.c | 4 +- hw/gpio/pca9552.c | 4 +- hw/gpio/pca9554.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 5 +- hw/hexagon/hexagon_dsp.c | 2 + hw/i386/microvm.c | 65 +++----- hw/i386/pc.c | 39 +++-- hw/i386/pc_piix.c | 56 ++----- hw/i386/sgx-epc.c | 2 + hw/i386/x86.c | 92 ++++------- hw/ide/ide-dev.c | 3 +- hw/intc/apic_common.c | 3 +- hw/loongarch/virt.c | 73 ++++----- hw/mem/nvdimm.c | 6 +- hw/mem/pc-dimm.c | 4 +- hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 +- hw/misc/aspeed_lpc.c | 37 +++-- hw/misc/aspeed_sdmc.c | 3 +- hw/misc/npcm7xx_mft.c | 3 +- hw/misc/xlnx-versal-trng.c | 14 ++ hw/net/ne2000-isa.c | 3 +- hw/nvme/ctrl.c | 2 + hw/nvme/nguid.c | 2 + hw/nvram/xlnx-bbram.c | 2 + hw/nvram/xlnx-efuse.c | 2 + hw/pci-bridge/pci_expander_bridge.c | 3 +- hw/pci-host/i440fx.c | 5 + hw/pci-host/pnv_phb3.c | 5 +- hw/pci-host/pnv_phb4.c | 5 +- hw/pci-host/q35.c | 5 + hw/pci/pci.c | 2 + hw/ppc/spapr_caps.c | 19 ++- hw/ppc/spapr_drc.c | 7 +- hw/ppc/spapr_rtc.c | 25 ++- hw/remote/vfio-user-obj.c | 4 +- hw/riscv/microchip_pfsoc.c | 2 + hw/riscv/virt.c | 40 ++--- hw/rtc/mc146818rtc.c | 23 ++- hw/s390x/ccw-device.c | 2 + hw/s390x/css.c | 3 + hw/s390x/s390-pci-bus.c | 2 + hw/s390x/s390-virtio-ccw.c | 5 +- hw/s390x/sclpcpi.c | 8 +- hw/s390x/virtio-ccw-mem.c | 2 + hw/sensor/adc128d818.c | 10 +- hw/sensor/adm1266.c | 3 +- hw/sensor/adm1272.c | 9 +- hw/sensor/emc141x.c | 9 +- hw/sensor/isl_pmbus_vr.c | 19 ++- hw/sensor/lsm303dlhc_mag.c | 25 +-- hw/sensor/max34451.c | 5 +- hw/sensor/tmp105.c | 3 +- hw/sensor/tmp421.c | 9 +- hw/usb/dev-storage-classic.c | 3 +- hw/vfio-user/pci.c | 4 +- hw/vfio/pci-quirks.c | 2 + hw/virtio/virtio-balloon.c | 85 ++++------ hw/virtio/virtio-mem-pci.c | 2 + hw/virtio/virtio-mem.c | 7 +- hw/xen/xen-pvh-common.c | 5 + iothread.c | 9 +- migration/options.c | 3 + monitor/qmp.c | 3 +- net/colo-compare.c | 15 +- net/dump.c | 4 +- net/filter-buffer.c | 3 +- net/filter.c | 6 +- qom/object.c | 199 ++++++++--------------- qom/qom-qmp-cmds.c | 47 +++--- system/bootdevice.c | 3 +- system/memory.c | 5 +- target/arm/cpu64.c | 12 +- target/arm/kvm.c | 3 +- target/arm/tcg/cpu64.c | 6 +- target/i386/cpu.c | 22 ++- target/i386/kvm/kvm.c | 12 +- target/i386/kvm/tdx.c | 8 +- target/i386/sev.c | 30 ++-- target/i386/whpx/whpx-all.c | 83 +++------- target/ppc/compat.c | 3 +- target/riscv/cpu.c | 34 +++- target/riscv/kvm/kvm-cpu.c | 7 +- target/riscv/tcg/tcg-cpu.c | 7 +- target/s390x/cpu-system.c | 2 + target/s390x/cpu_models.c | 7 +- target/sparc/cpu.c | 2 + tests/qtest/qmp-cmd-test.c | 55 ++++++- tests/unit/check-qom-proplist.c | 95 +++++++++-- tests/unit/test-qdev-global-props.c | 7 +- ui/console-vc.c | 1 + ui/console.c | 3 +- ui/dbus.c | 8 +- ui/input-linux.c | 3 +- util/thread-context.c | 6 +- hw/display/apple-gfx.m | 2 + qapi/meson.build | 4 + qga/meson.build | 2 + scripts/qapi/backend.py | 2 + scripts/qapi/gen.py | 2 +- scripts/qapi/introspect.py | 74 +++------ scripts/qapi/schema.py | 57 +++++-- scripts/qapi/type_infos.py | 149 +++++++++++++++++ tests/include/meson.build | 2 + tests/meson.build | 6 + tests/qapi-schema/meson.build | 1 + 148 files changed, 1638 insertions(+), 1067 deletions(-) create mode 100644 include/qapi/qapi-type-info.h create mode 100644 scripts/qapi/type_infos.py
Signature · 1 line
2.55.0
PATCH v8 1/56 qapi/schema: Rename .lookup_entity() and tighten return type
Commit 060b5a9323 (qapi: Dumb down QAPISchema.lookup_entity()) accidentally relaxed QAPISchema.lookup_entity()'s return type to QAPISchemaEntity. Tighten it back to QAPISchemaDefinition, and rename the method to .lookup_defn().
--- docs/sphinx/qapidoc.py | 2 +- scripts/qapi/schema.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
docs/sphinx/qapidoc.py +1 -1
@@ -512,7 +512,7 @@ def transmogrify(self, schema: QAPISchema) -> nodes.Element: modules.add(module_source) if doc.symbol: - ent = schema.lookup_entity(doc.symbol) + ent = schema.lookup_defn(doc.symbol) assert isinstance(ent, QAPISchemaDefinition) vis.visit_entity(ent) else:
scripts/qapi/schema.py +3 -3
@@ -1184,11 +1184,11 @@ def _def_definition(self, defn: QAPISchemaDefinition) -> None: defn.info, "%s is already defined" % other_defn.describe()) self._entity_dict[defn.name] = defn - def lookup_entity(self, name: str) -> Optional[QAPISchemaEntity]: + def lookup_defn(self, name: str) -> Optional[QAPISchemaDefinition]: return self._entity_dict.get(name) def lookup_type(self, name: str) -> Optional[QAPISchemaType]: - typ = self.lookup_entity(name) + typ = self.lookup_defn(name) if isinstance(typ, QAPISchemaType): return typ return None
@@ -1324,7 +1324,7 @@ def _make_implicit_object_type( return None # See also QAPISchemaObjectTypeMember.describe() name = 'q_obj_%s-%s' % (name, role) - typ = self.lookup_entity(name) + typ = self.lookup_defn(name) if typ: assert isinstance(typ, QAPISchemaObjectType) # The implicit object type has multiple users. This can
Signature · 1 line
2.55.0
PATCH v8 2/56 qapi: Ease access to introspection names
In reply to Markus Armbrusterquery-qmp-schema masks type names, because they are not part of the external interface. Marc-André Lureau would like to also use them with qom-list & friends. Trouble is the masked names are buried deep in QAPISchemaGenIntrospectVisitor. Lift them into schema.py: new QAPISchemaDefinition method introspection_name() returns a definition's name for use in introspection.
This changes the masked names, which is fine.
--- docs/devel/qapi-code-gen.rst | 24 ++++++++++---------- scripts/qapi/introspect.py | 23 ++++--------------- scripts/qapi/schema.py | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 31 deletions(-)
docs/devel/qapi-code-gen.rst +12 -12
@@ -2012,33 +2012,33 @@ Example:: const QLitObject example_qmp_schema_qlit = QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("0"), }, + { "arg-type", QLIT_QSTR("34"), }, { "meta-type", QLIT_QSTR("command"), }, { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("1"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("2"), }, + { "arg-type", QLIT_QSTR("30"), }, { "meta-type", QLIT_QSTR("event"), }, { "name", QLIT_QSTR("MY_EVENT"), }, {} })), - /* "0" = q_obj_my-command-arg */ + /* "34" = q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[1]"), }, + { "type", QLIT_QSTR("[32]"), }, {} })), {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("0"), }, + { "name", QLIT_QSTR("34"), }, {} })), - /* "1" = UserDefOne */ + /* "32" = UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) {
@@ -2061,22 +2061,22 @@ Example:: {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("1"), }, + { "name", QLIT_QSTR("32"), }, {} })), - /* "2" = q_empty */ + /* "30" = q_empty */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("2"), }, + { "name", QLIT_QSTR("30"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "element-type", QLIT_QSTR("1"), }, + { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), }, - { "name", QLIT_QSTR("[1]"), }, + { "name", QLIT_QSTR("[32]"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) {
scripts/qapi/introspect.py +4 -19
@@ -30,7 +30,6 @@ QAPISchemaAlternatives, QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaBuiltinType, QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature,
@@ -177,7 +176,6 @@ def __init__(self, prefix: str, unmask: bool): self._schema: Optional[QAPISchema] = None self._trees: List[Annotated[SchemaInfo]] = [] self._used_types: List[QAPISchemaType] = [] - self._name_map: Dict[str, str] = {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h"
@@ -208,18 +206,14 @@ def visit_end(self) -> None: self._schema = None self._trees = [] self._used_types = [] - self._name_map = {} def visit_needed(self, entity: QAPISchemaEntity) -> bool: # Ignore types on first pass; visit_end() will pick up used types return not isinstance(entity, QAPISchemaType) def _name(self, name: str) -> str: - if self._unmask: - return name - if name not in self._name_map: - self._name_map[name] = '%d' % len(self._name_map) - return self._name_map[name] + assert self._schema + return self._schema.definition_introspection_name(name, self._unmask) def _use_type(self, typ: QAPISchemaType) -> str: assert self._schema is not None
@@ -237,13 +231,6 @@ def _use_type(self, typ: QAPISchemaType) -> str: # Add type to work queue if new if typ not in self._used_types: self._used_types.append(typ) - # Clients should examine commands and events, not types. Hide - # type names as integers to reduce the temptation. Also, it - # saves a few characters on the wire. - if isinstance(typ, QAPISchemaBuiltinType): - return typ.name - if isinstance(typ, QAPISchemaArrayType): - return '[' + self._use_type(typ.element_type) + ']' return self._name(typ.name) @staticmethod
@@ -271,8 +258,7 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[str, object], # Output a comment to make it easy to map masked names # back to the source when reading the generated output. comment = f'"{self._name(name)}" = {name}' - name = self._name(name) - obj['name'] = name + obj['name'] = self._name(name) obj['meta-type'] = mtype if features: obj['features'] = self._gen_features(features)
@@ -327,8 +313,7 @@ def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: element = self._use_type(element_type) - self._gen_tree('[' + element + ']', 'array', {'element-type': element}, - ifcond) + self._gen_tree(name, 'array', {'element-type': element}, ifcond) def visit_object_type_flat(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond,
scripts/qapi/schema.py +43 -0
85 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v8 3/56 qapi/introspect: Simplify masked name comment emission slighly
In reply to Markus ArmbrusterInstead of emitting the comment for certain meta-types, simply emit it when introspection name and name differ.
This additionally emits it for arrays, which is fine.
--- docs/devel/qapi-code-gen.rst | 1 + scripts/qapi/introspect.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-)
docs/devel/qapi-code-gen.rst +1 -0
@@ -2073,6 +2073,7 @@ Example:: { "name", QLIT_QSTR("30"), }, {} })), + /* "[32]" = UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), },
scripts/qapi/introspect.py +6 -6
@@ -253,12 +253,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[str, object], Will be omitted from the output if empty. """ comment: Optional[str] = None - if mtype not in ('command', 'event', 'builtin', 'array'): - if not self._unmask: - # Output a comment to make it easy to map masked names - # back to the source when reading the generated output. - comment = f'"{self._name(name)}" = {name}' - obj['name'] = self._name(name) + introspection_name = self._name(name) + if introspection_name != name: + # Output a comment to make it easy to map masked names + # back to the source when reading the generated output. + comment = f'"{introspection_name}" = {name}' + obj['name'] = introspection_name obj['meta-type'] = mtype if features: obj['features'] = self._gen_features(features)
Signature · 1 line
2.55.0
PATCH v8 4/56 qapi/introspect: Don't elide types
In reply to Markus Armbrusterquery-qmp-schema elides types not reachable from commands and events. It currently emits 1251 out of 1385 definitions, and elides 134 types. Whether that's worthwhile is debatable.
Marc-André Lureau would like to make QOM introspection (qom-list & friends) refer to QAPI types. We additionally need types reachable from QOM properties.
Unfortunately, the QAPI generator knows nothing about QOM properties.
We could manually mark the QAPI types to elide, or the QAPI types not to elide even though they are not reachable from commands and events. Feels very much not worthwhile to me.
We could conservatively approximate "reachable from QOM properties" by "available for use with QOM properties". These are the built-in and user-defined types, and their arrays. With that, we'd elide just 38 out of 1385 definitions. Too few to be worthwhile.
Simply emit everything.
Output of query-qmp-schema grows from 247KiB to 274KiB for me.
--- docs/devel/qapi-code-gen.rst | 67 ++++++++++++++---------------------- scripts/qapi/introspect.py | 31 +++-------------- 2 files changed, 30 insertions(+), 68 deletions(-)
docs/devel/qapi-code-gen.rst +26 -41
@@ -1250,8 +1250,6 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. -QAPI schema definitions not reachable that way are omitted. - The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the
@@ -2012,32 +2010,19 @@ Example:: const QLitObject example_qmp_schema_qlit = QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("34"), }, - { "meta-type", QLIT_QSTR("command"), }, - { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("32"), }, + { "json-type", QLIT_QSTR("string"), }, + { "meta-type", QLIT_QSTR("builtin"), }, + { "name", QLIT_QSTR("str"), }, {} })), + /* "[str]" = strList */ QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("30"), }, - { "meta-type", QLIT_QSTR("event"), }, - { "name", QLIT_QSTR("MY_EVENT"), }, - {} - })), - /* "34" = q_obj_my-command-arg */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - QLIT_QDICT(((QLitDictEntry[]) { - { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[32]"), }, - {} - })), - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("34"), }, + { "element-type", QLIT_QSTR("str"), }, + { "meta-type", QLIT_QSTR("array"), }, + { "name", QLIT_QSTR("[str]"), }, {} })), + [Remainder of built-in types omitted...] /* "32" = UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) {
@@ -2064,15 +2049,6 @@ Example:: { "name", QLIT_QSTR("32"), }, {} })), - /* "30" = q_empty */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("30"), }, - {} - })), /* "[32]" = UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), },
@@ -2080,22 +2056,31 @@ Example:: { "name", QLIT_QSTR("[32]"), }, {} })), + /* "34" = q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("int"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("int"), }, + { "members", QLIT_QLIST(((QLitObject[]) { + QLIT_QDICT(((QLitDictEntry[]) { + { "name", QLIT_QSTR("arg1"), }, + { "type", QLIT_QSTR("[32]"), }, + {} + })), + {} + })), }, + { "meta-type", QLIT_QSTR("object"), }, + { "name", QLIT_QSTR("34"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("string"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("str"), }, + { "arg-type", QLIT_QSTR("34"), }, + { "meta-type", QLIT_QSTR("command"), }, + { "name", QLIT_QSTR("my-command"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("boolean"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("bool"), }, + { "arg-type", QLIT_QSTR("30"), }, + { "meta-type", QLIT_QSTR("event"), }, + { "name", QLIT_QSTR("MY_EVENT"), }, {} })), {}
scripts/qapi/introspect.py +4 -27
@@ -28,9 +28,7 @@ from .schema import ( QAPISchema, QAPISchemaAlternatives, - QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, QAPISchemaIfCond,
@@ -175,7 +173,6 @@ def __init__(self, prefix: str, unmask: bool): self._unmask = unmask self._schema: Optional[QAPISchema] = None self._trees: List[Annotated[SchemaInfo]] = [] - self._used_types: List[QAPISchemaType] = [] self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h"
@@ -187,10 +184,6 @@ def visit_begin(self, schema: QAPISchema) -> None: self._schema = schema def visit_end(self) -> None: - # visit the types that are actually used - for typ in self._used_types: - typ.visit(self) - # generate C name = c_name(self._prefix, protect=False) + 'qmp_schema_qlit' self._genh.add(mcgen(''' #include "qobject/qlit.h"
@@ -205,32 +198,12 @@ def visit_end(self) -> None: c_string=_tree_to_qlit(self._trees))) self._schema = None self._trees = [] - self._used_types = [] - - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # Ignore types on first pass; visit_end() will pick up used types - return not isinstance(entity, QAPISchemaType) def _name(self, name: str) -> str: assert self._schema return self._schema.definition_introspection_name(name, self._unmask) def _use_type(self, typ: QAPISchemaType) -> str: - assert self._schema is not None - - # Map the various integer types to plain int - if typ.json_type() == 'int': - type_int = self._schema.lookup_type('int') - assert type_int - typ = type_int - elif (isinstance(typ, QAPISchemaArrayType) and - typ.element_type.json_type() == 'int'): - type_intlist = self._schema.lookup_type('intList') - assert type_intlist - typ = type_intlist - # Add type to work queue if new - if typ not in self._used_types: - self._used_types.append(typ) return self._name(typ.name) @staticmethod
@@ -295,6 +268,8 @@ def _gen_variant(self, variant: QAPISchemaVariant def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: + if json_type == 'int' and name != 'int': + return self._gen_tree(name, 'builtin', {'json-type': json_type}) def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo],
@@ -312,6 +287,8 @@ def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: + if element_type.json_type() == 'int' and name != 'intList': + return element = self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond)
Signature · 1 line
2.55.0
PATCH v8 5/56 qapi: QAPISchemaVisitor.visit_needed() is now unused, drop
In reply to Markus Armbruster--- scripts/qapi/schema.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
scripts/qapi/schema.py +1 -7
@@ -179,11 +179,6 @@ def visit_end(self) -> None: def visit_module(self, name: str) -> None: pass - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # pylint: disable=unused-argument - # Default to visiting everything - return True - def visit_include(self, name: str, info: Optional[QAPISourceInfo]) -> None: pass
@@ -315,8 +310,7 @@ def add_entity(self, ent: QAPISchemaEntity) -> None: def visit(self, visitor: QAPISchemaVisitor) -> None: visitor.visit_module(self.name) for entity in self._entity_list: - if visitor.visit_needed(entity): - entity.visit(visitor) + entity.visit(visitor) class QAPISchemaInclude(QAPISchemaEntity):
Signature · 1 line
2.55.0
PATCH v8 6/56 qapi/introspect: Tweak integer type masking
In reply to Markus ArmbrusterSince introspection maps all integer types to 'int', we need to skip all but one of them. Instead of filtering by hardcoded name, filter out duplicates.
--- scripts/qapi/introspect.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
scripts/qapi/introspect.py +10 -8
@@ -172,7 +172,7 @@ def __init__(self, prefix: str, unmask: bool): ' * QAPI/QMP schema introspection', __doc__) self._unmask = unmask self._schema: Optional[QAPISchema] = None - self._trees: List[Annotated[SchemaInfo]] = [] + self._trees: Dict[str, Annotated[SchemaInfo]] = {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h"
@@ -191,13 +191,14 @@ def visit_end(self) -> None: extern const QLitObject %(c_name)s; ''', c_name=c_name(name))) + trees = list(self._trees.values()) self._genc.add(mcgen(''' const QLitObject %(c_name)s = %(c_string)s; ''', c_name=c_name(name), - c_string=_tree_to_qlit(self._trees))) + c_string=_tree_to_qlit(trees))) self._schema = None - self._trees = [] + self._trees = {} def _name(self, name: str) -> str: assert self._schema
@@ -235,7 +236,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[str, object], obj['meta-type'] = mtype if features: obj['features'] = self._gen_features(features) - self._trees.append(Annotated(obj, ifcond, comment)) + if introspection_name in self._trees: + # Duplicates are possible because + # QAPISchemaBuiltinType.introspection_name() returns 'int' + # for all integer types. Ignore them. + return + self._trees[introspection_name] = Annotated(obj, ifcond, comment) def _gen_enum_member(self, member: QAPISchemaEnumMember ) -> Annotated[SchemaInfoEnumMember]:
@@ -268,8 +274,6 @@ def _gen_variant(self, variant: QAPISchemaVariant def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: - if json_type == 'int' and name != 'int': - return self._gen_tree(name, 'builtin', {'json-type': json_type}) def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo],
@@ -287,8 +291,6 @@ def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: - if element_type.json_type() == 'int' and name != 'intList': - return element = self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond)
Signature · 1 line
2.55.0
PATCH v8 7/56 qapi: add QAPITypeInfo struct definition
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Introduce a minimal struct that pairs a QAPI type's internal name with its "masked" introspection name. Generated constants of this type will let QOM property registration carry a reliable reference to the QAPI schema and possibly other associated data.
The fields are populated in following commits.
--- include/qapi/qapi-type-info.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/qapi/qapi-type-info.h
include/qapi/qapi-type-info.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +/** +* QAPITypeInfo - QAPI type metadata +* +* @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List"). +* QOM uses this as the property type string. +* @masked_name: Name of the type in the output of query-qmp-schema, +* assigned by scripts/qapi code generator (e.g. "368"). +* @lookup: QEnumLookup for this type, or NULL for non-enum types. +*/ +typedef struct QAPITypeInfo { +const char *name; +const char *masked_name; +const QEnumLookup *lookup; +}QAPITypeInfo ; + +#endif /* QAPI_TYPE_INFO_H */
Signature · 1 line
2.55.0
PATCH v8 8/56 qapi/gen: fix _module_basename for multi-dash 'what' parameters
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
The re.sub() call replaces every hyphen in 'what' with the system module infix. This produces broken filenames for multi-hyphen names (e.g. 'qapi-type-infos' becomes 'qapi-builtin-type-builtin-infos').
Add count=1 so only the first hyphen is replaced.
--- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/gen.py +1 -1
@@ -300,7 +300,7 @@ def _module_basename(self, what: str, name: str) -> str: ret += '-' + os.path.splitext(basename)[0] else: assert QAPISchemaModule.is_system_module(name) - ret += re.sub(r'-', '-' + name[2:] + '-', what) + ret += re.sub(r'-', '-' + name[2:] + '-', what, count=1) return ret def _module_filename(self, what: str, name: str) -> str:
Signature · 1 line
2.55.0
PATCH v8 9/56 qapi: add type-infos generator
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
New QAPISchemaGenTypeInfoVisitor produces per-module qapi-type-infos-*.h/c files. Each file declares QAPITypeInfo constants pairing the QAPI type name with its masked introspection name.
We want per-module .h for less recompiling when we touch QAPI types. Unfortunately, the per-module .c usually all change then, because the masked names all change.
--- docs/devel/qapi-code-gen.rst | 87 ++++++++++++++++++++ meson.build | 1 + qapi/meson.build | 4 + qga/meson.build | 2 + scripts/qapi/backend.py | 2 + scripts/qapi/type_infos.py | 149 ++++++++++++++++++++++++++++++++++ tests/include/meson.build | 2 + tests/meson.build | 6 ++ tests/qapi-schema/meson.build | 1 + 9 files changed, 254 insertions(+) create mode 100644 scripts/qapi/type_infos.py
docs/devel/qapi-code-gen.rst +87 -0
@@ -1250,6 +1250,9 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. +.. TODO document QOM introspection (qom-list, qom-list-properties, + qom-get) and how it relates to QAPI type information. + The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the
@@ -2087,3 +2090,87 @@ Example:: })); [Uninteresting stuff omitted...] + + +Code generated for type information +----------------------------------- + +Type information is generated for user-defined types and their array +types. With option --builtins, it is also generated for the built-in +types. + +The following files are created: + + ``$(prefix)qapi-type-infos.c`` + A ``QAPITypeInfo`` instance for each type listed above, providing + a mapping between the QAPI type name and the masked name used by + introspection, along with optional enum lookup table and array + type pointers. + + ``$(prefix)qapi-type-infos.h`` + Declarations for the above type info instances + +Each ``QAPITypeInfo`` struct has the following fields: + +``name`` + The QAPI type name (e.g. ``"UserDefOne"``). + +``masked_name`` + The masked name used in ``query-qmp-schema`` output. + +``lookup`` + For enum types, a pointer to the corresponding ``QEnumLookup`` + table. ``NULL`` for non-enum types. + +These type info instances are used by QOM property registration +functions (``object_property_add()``, +``object_class_property_add_enum()``, etc.) to associate each property +with its QAPI type. The ``qom-list`` and ``device-list-properties`` +QMP commands then expose the ``qapi-type`` field, giving management +tools a formal type reference they can look up in the introspection +schema. + +Example:: + + $ cat qapi-generated/example-qapi-type-infos.h + [Uninteresting stuff omitted...] + + #ifndef EXAMPLE_QAPI_TYPE_INFOS_H + #define EXAMPLE_QAPI_TYPE_INFOS_H + + #include "qapi/qapi-builtin-type-infos.h" + + extern const QAPITypeInfo UserDefOne_type_info; + + extern const QAPITypeInfo UserDefOneList_type_info; + + #endif /* EXAMPLE_QAPI_TYPE_INFOS_H */ + $ cat qapi-generated/example-qapi-type-infos.c + [Uninteresting stuff omitted...] + + const QAPITypeInfo UserDefOne_type_info = { + .name = "UserDefOne", + .masked_name = "32", + }; + + const QAPITypeInfo UserDefOneList_type_info = { + .name = "UserDefOneList", + .masked_name = "[32]", + }; + + [Uninteresting stuff omitted...] + +For a modular QAPI schema (see section `Include directives`_), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into :: + + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + + ``qapi-builtin-type-infos.h`` + Type info instances for built-in types + + ``qapi-builtin-type-infos.c`` + Definitions for the above type info instances
meson.build +1 -0
@@ -3522,6 +3522,7 @@ qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/parser.py', meson.current_source_dir() / 'scripts/qapi/schema.py', meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/type_infos.py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py'
qapi/meson.build +4 -0
@@ -79,6 +79,7 @@ endif qapi_nonmodule_outputs = [ 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-types.c', 'qapi-types.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c',
@@ -88,6 +89,7 @@ qapi_nonmodule_outputs = [ ] qapi_outputs = qapi_nonmodule_outputs + [ + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ]
@@ -96,6 +98,8 @@ qapi_inputs = [] foreach module : qapi_all_modules qapi_inputs += [ files(module + '.json') ] qapi_module_outputs = [ + 'qapi-type-infos-@[email protected]'.format(module), + 'qapi-type-infos-@[email protected]'.format(module), 'qapi-types-@[email protected]'.format(module), 'qapi-types-@[email protected]'.format(module), 'qapi-visit-@[email protected]'.format(module),
qga/meson.build +2 -0
@@ -39,6 +39,8 @@ qga_qapi_outputs = [ 'qga-qapi-init-commands.h', 'qga-qapi-introspect.c', 'qga-qapi-introspect.h', + 'qga-qapi-type-infos.c', + 'qga-qapi-type-infos.h', 'qga-qapi-types.c', 'qga-qapi-types.h', 'qga-qapi-visit.c',
scripts/qapi/backend.py +2 -0
@@ -8,6 +8,7 @@ from .features import gen_features from .introspect import gen_introspect from .schema import QAPISchema +from .type_infos import gen_type_infos from .types import gen_types from .visit import gen_visit
@@ -63,3 +64,4 @@ def generate(self, gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, unmask) + gen_type_infos(schema, output_dir, prefix, builtins, unmask)
scripts/qapi/type_infos.py new file +149 -0
149 lines not on this page · raw message
tests/include/meson.build +2 -0
@@ -4,6 +4,8 @@ test_qapi_outputs_extra = [ 'test-qapi-commands-sub-module.h', 'test-qapi-events-sub-module.c', 'test-qapi-events-sub-module.h', + 'test-qapi-type-infos-sub-module.c', + 'test-qapi-type-infos-sub-module.h', 'test-qapi-types-sub-module.c', 'test-qapi-types-sub-module.h', 'test-qapi-visit-sub-module.c',
tests/meson.build +6 -0
@@ -2,6 +2,8 @@ subdir('bench') subdir('qemu-iotests') test_qapi_outputs = [ + 'qapi-builtin-type-infos.c', + 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.c',
@@ -22,6 +24,10 @@ test_qapi_outputs = [ 'test-qapi-init-commands.h', 'test-qapi-introspect.c', 'test-qapi-introspect.h', + 'test-qapi-type-infos-sub-sub-module.c', + 'test-qapi-type-infos-sub-sub-module.h', + 'test-qapi-type-infos.c', + 'test-qapi-type-infos.h', 'test-qapi-types-sub-sub-module.c', 'test-qapi-types-sub-sub-module.h', 'test-qapi-types.c',
tests/qapi-schema/meson.build +1 -0
@@ -231,6 +231,7 @@ custom_target('QAPI doc', 'doc-good-qapi-events.c', 'doc-good-qapi-events.h', 'doc-good-qapi-init-commands.c', 'doc-good-qapi-init-commands.h', 'doc-good-qapi-introspect.c', 'doc-good-qapi-introspect.h', + 'doc-good-qapi-type-infos.c', 'doc-good-qapi-type-infos.h', 'doc-good-qapi-types.c', 'doc-good-qapi-types.h', 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], input: files('doc-good.json'),
Signature · 1 line
2.55.0
PATCH v8 10/56 qom: add qapi_type field to ObjectProperty
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Add a const pointer to QAPITypeInfo in ObjectProperty. NULL for now, but future patches will add means to make it non-null. The QAPITypeInfo will then be used by QOM introspection to tie the property to a QAPI type.
--- include/qom/object.h | 2 ++ qom/object.c | 1 + 2 files changed, 3 insertions(+)
include/qom/object.h +2 -0
@@ -15,6 +15,7 @@#define QEMU_OBJECT_H #include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-type-info.h" #include "qemu/module.h" struct TypeImpl ;
@@ -91,6 +92,7 @@ struct ObjectPropertychar *name;char *type;char *description; +const QAPITypeInfo *qapi_type;ObjectPropertyAccessor *get;ObjectPropertyAccessor *set;ObjectPropertyResolve *resolve;
qom/object.c +1 -0
@@ -3171,6 +3171,7 @@ object_property_add_alias(Object *obj, const char *name, property_release_alias, prop); op->resolve = property_resolve_alias; + op->qapi_type = target_prop->qapi_type;if (target_prop->defval) { op->defval =qobject_ref (target_prop->defval); }
Signature · 1 line
2.55.0
PATCH v8 11/56 qapi/qom: add qapi-type to qom-list, qom-list-properties, qom-list-get
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
QOM introspection is flawed: the type information is just a string (ObjectPropertyInfo and ObjectPropertyValue field 'type'). Management applications need to know these strings. Their documentation is of little help.
QAPI introspection is more powerful, and management applications already know how to use it. Let's put it to use for QOM introspection.
Add an optional 'qapi-type' field to ObjectPropertyInfo and ObjectPropertyValue. When present, it contains the masked type name that can be looked up in query-qmp-schema output. Absent for properties without a QAPI type association. Always absent for now, populated in the following changes.
This cannot fully replace 'type', yet: it doesn't cover child and link properties. Mark 'unstable' for now.
--- qapi/qom.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
qapi/qom.json +18 -0
@@ -35,15 +35,24 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 1.2 ## { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', '*default-value': 'any' } }
@@ -55,14 +64,23 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @value: the value of the property. Absent when the property cannot # be read. # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 10.1 ## { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*value': 'any' } } ##
Signature · 1 line
2.55.0
PATCH v8 12/56 qom/qmp: populate qapi-type in QMP handlers
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Wire up the new qapi-type field in all four QMP handlers that return ObjectPropertyInfo or ObjectPropertyValue: qom-list, qom-list-get, device-list-properties, and qom-list-properties.
When an ObjectProperty has a qapi_type set, the masked QAPI type name is copied into the response, allowing clients to cross-reference with query-qmp-schema.
No property has it yet, the following changes will populate it.
--- qom/qom-qmp-cmds.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
qom/qom-qmp-cmds.c +21 -13
@@ -25,9 +25,23 @@#include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" +#include "qapi/qapi-type-info.h" #include "qom/object_interfaces.h" #include "qom/qom-qobject.h" +static ObjectPropertyInfo *qom_property_info (ObjectProperty *prop) +{ +ObjectPropertyInfo *info =g_new0 (ObjectPropertyInfo,1 ); + + info->name =g_strdup (prop->name); + info->type =g_strdup (prop->type); +if (prop->qapi_type) { +assert (prop->qapi_type->masked_name); + info->qapi_type =g_strdup (prop->qapi_type->masked_name); + } +return info; +} +static Object *qom_resolve_path (const char *path,Error **errp) {bool ambiguous = false;
@@ -58,12 +72,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)object_property_iter_init (&iter, obj);while ((prop =object_property_iter_next (&iter))) { -ObjectPropertyInfo *value =g_new0 (ObjectPropertyInfo,1 ); - -QAPI_LIST_PREPEND (props, value); - - value->name =g_strdup (prop->name); - value->type =g_strdup (prop->type); +QAPI_LIST_PREPEND (props,qom_property_info (prop)); }return props;
@@ -78,6 +87,10 @@ static void qom_list_add_property_value(Object *obj, ObjectProperty *prop, item->name =g_strdup (prop->name); item->type =g_strdup (prop->type); +if (prop->qapi_type) { +assert (prop->qapi_type->masked_name); + item->qapi_type =g_strdup (prop->qapi_type->masked_name); + } item->value =object_property_get_qobject (obj, prop->name,NULL ); }
@@ -241,9 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,continue ; } - info =g_new0 (ObjectPropertyInfo,1 ); - info->name =g_strdup (prop->name); - info->type =g_strdup (prop->type); + info =qom_property_info (prop); info->description =g_strdup (prop->description); info->default_value =qobject_ref (prop->defval);
@@ -284,11 +295,8 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,object_property_iter_init (&iter, obj); }while ((prop =object_property_iter_next (&iter))) { -ObjectPropertyInfo *info; +ObjectPropertyInfo *info =qom_property_info (prop); - info =g_malloc0 (sizeof (*info)); - info->name =g_strdup (prop->name); - info->type =g_strdup (prop->type); info->description =g_strdup (prop->description); info->default_value =qobject_ref (prop->defval);
Signature · 1 line
2.55.0
PATCH v8 13/56 qom/qmp: populate description & default-value in qom_property_info()
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Move description and default_value population from the individual QMP handlers into qom_property_info(), so all callers get them.
This also adds description and default-value to qom-list responses, which previously only returned name and type. The handler doesn't care.
--- qom/qom-qmp-cmds.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
qom/qom-qmp-cmds.c +4 -13
@@ -35,6 +35,8 @@ static ObjectPropertyInfo *qom_property_info(ObjectProperty *prop) info->name =g_strdup (prop->name); info->type =g_strdup (prop->type); + info->description =g_strdup (prop->description); + info->default_value =qobject_ref (prop->defval);if (prop->qapi_type) {assert (prop->qapi_type->masked_name); info->qapi_type =g_strdup (prop->qapi_type->masked_name);
@@ -243,8 +245,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,object_property_iter_init (&iter, obj);while ((prop =object_property_iter_next (&iter))) { -ObjectPropertyInfo *info; -/* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") == 0 || strcmp(prop->name, "realized") == 0 ||
@@ -254,11 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,continue ; } - info =qom_property_info (prop); - info->description =g_strdup (prop->description); - info->default_value =qobject_ref (prop->defval); - -QAPI_LIST_PREPEND (prop_list, info); +QAPI_LIST_PREPEND (prop_list,qom_property_info (prop)); }object_unref (obj);
@@ -295,12 +291,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,object_property_iter_init (&iter, obj); }while ((prop =object_property_iter_next (&iter))) { -ObjectPropertyInfo *info =qom_property_info (prop); - - info->description =g_strdup (prop->description); - info->default_value =qobject_ref (prop->defval); - -QAPI_LIST_PREPEND (prop_list, info); +QAPI_LIST_PREPEND (prop_list,qom_property_info (prop)); }object_unref (obj);
Signature · 1 line
2.55.0
PATCH v8 14/56 qom: New object_property_add() etc. parameter @qapi_type
In reply to Markus ArmbrusterThis permits setting ObjectProperty's optional @qapi_type. For now, all callers pass null. Callers updated with this Coccinelle script:
@@
identifier fun = {
object_property_try_add, object_property_add, object_class_property_add
};
expression obj, name, type;
@@
- fun(obj, name, type,
+ fun(obj, name, type, NULL,
...)
--- include/qom/object.h | 5 +++ accel/hvf/hvf-all.c | 6 +-- accel/kvm/kvm-all.c | 19 +++++---- accel/nitro/nitro-accel.c | 2 +- accel/tcg/tcg-all.c | 6 +-- accel/whpx/whpx-common.c | 12 +++--- authz/list.c | 2 +- backends/cryptodev.c | 6 +-- backends/hostmem-file.c | 21 +++++----- backends/hostmem-memfd.c | 4 +- backends/hostmem.c | 24 +++++------ block/throttle-groups.c | 7 +--- chardev/char-socket.c | 2 +- crypto/secret_keyring.c | 2 +- event-loop-base.c | 6 +-- hw/acpi/ich9.c | 2 +- hw/acpi/pci.c | 8 ++-- hw/arm/virt.c | 10 ++--- hw/core/clock.c | 2 +- hw/core/machine.c | 29 +++++++------ hw/core/qdev-properties.c | 5 +-- hw/cpu/core.c | 6 ++- hw/cxl/cxl-host.c | 4 +- hw/gpio/aspeed_gpio.c | 6 +-- hw/gpio/aspeed_sgpio.c | 2 +- hw/gpio/pca9552.c | 4 +- hw/gpio/pca9554.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 4 +- hw/hexagon/hexagon_dsp.c | 2 +- hw/i386/microvm.c | 6 +-- hw/i386/pc.c | 27 ++++++------ hw/i386/sgx-epc.c | 2 +- hw/i386/x86.c | 23 ++++++----- hw/ide/ide-dev.c | 2 +- hw/intc/apic_common.c | 2 +- hw/loongarch/virt.c | 18 ++++---- hw/mem/nvdimm.c | 5 ++- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 36 ++++++++++------ hw/misc/aspeed_sdmc.c | 2 +- hw/misc/npcm7xx_mft.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/nvme/ctrl.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci-host/i440fx.c | 4 ++ hw/pci-host/pnv_phb3.c | 4 +- hw/pci-host/pnv_phb4.c | 4 +- hw/pci-host/q35.c | 8 ++-- hw/ppc/spapr_caps.c | 2 +- hw/ppc/spapr_drc.c | 4 +- hw/remote/vfio-user-obj.c | 2 +- hw/riscv/microchip_pfsoc.c | 1 + hw/riscv/virt.c | 4 +- hw/s390x/s390-virtio-ccw.c | 4 +- hw/s390x/sclpcpi.c | 6 ++- hw/s390x/virtio-ccw-mem.c | 2 +- hw/sensor/adc128d818.c | 8 ++-- hw/sensor/adm1266.c | 2 +- hw/sensor/adm1272.c | 8 ++-- hw/sensor/emc141x.c | 8 ++-- hw/sensor/isl_pmbus_vr.c | 18 ++++---- hw/sensor/lsm303dlhc_mag.c | 24 +++++------ hw/sensor/max34451.c | 4 +- hw/sensor/tmp105.c | 2 +- hw/sensor/tmp421.c | 8 ++-- hw/usb/dev-storage-classic.c | 2 +- hw/vfio-user/pci.c | 2 +- hw/virtio/virtio-balloon.c | 4 +- hw/virtio/virtio-mem-pci.c | 2 +- hw/virtio/virtio-mem.c | 7 ++-- hw/xen/xen-pvh-common.c | 8 ++-- iothread.c | 8 ++-- net/colo-compare.c | 6 +-- net/dump.c | 3 +- net/filter-buffer.c | 2 +- qom/object.c | 64 ++++++++++++++++------------- system/bootdevice.c | 2 +- system/memory.c | 4 +- target/arm/cpu64.c | 10 ++--- target/arm/kvm.c | 2 +- target/arm/tcg/cpu64.c | 4 +- target/i386/cpu.c | 20 +++++---- target/i386/kvm/kvm.c | 8 ++-- target/i386/kvm/tdx.c | 2 +- target/i386/sev.c | 8 ++-- target/i386/whpx/whpx-all.c | 18 ++++---- target/ppc/compat.c | 2 +- target/riscv/cpu.c | 12 +++--- target/riscv/kvm/kvm-cpu.c | 6 +-- target/riscv/tcg/tcg-cpu.c | 6 +-- target/s390x/cpu-system.c | 1 + target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 6 ++- ui/console.c | 2 +- util/thread-context.c | 6 +-- 95 files changed, 377 insertions(+), 327 deletions(-)
include/qom/object.h +5 -0
@@ -1163,6 +1163,7 @@ void object_unref(void *obj);* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL,
@@ -1188,6 +1189,7 @@ void object_unref(void *obj);*/ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
@@ -1203,6 +1205,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL,
@@ -1220,6 +1223,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,*/ ObjectProperty *object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
@@ -1237,6 +1241,7 @@ void object_property_del(Object *obj, const char *name); ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
accel/hvf/hvf-all.c +3 -3
@@ -277,9 +277,9 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data) ac->allowed = &hvf_allowed; hvf_kernel_irqchip_override = false; hvf_kernel_irqchip = false; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , hvf_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , hvf_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure HVF irqchip" ); }
accel/kvm/kvm-all.c +10 -9
@@ -4303,21 +4303,22 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data) ac->has_memory = kvm_accel_has_memory; ac->allowed = &kvm_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , kvm_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , kvm_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure KVM in-kernel irqchip" ); -object_class_property_add (oc,"kvm-shadow-mem" ,"int" , - kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, -NULL ,NULL ); +object_class_property_add (oc,"kvm-shadow-mem" ,"int" ,NULL , + kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, +NULL ,NULL );object_class_property_set_description (oc,"kvm-shadow-mem" ,"KVM shadow MMU size" ); -object_class_property_add (oc,"dirty-ring-size" ,"uint32" , - kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, -NULL ,NULL ); +object_class_property_add (oc,"dirty-ring-size" ,"uint32" ,NULL , + kvm_get_dirty_ring_size, + kvm_set_dirty_ring_size, +NULL ,NULL );object_class_property_set_description (oc,"dirty-ring-size" ,"Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)" );
accel/nitro/nitro-accel.c +1 -1
@@ -238,7 +238,7 @@ static void nitro_accel_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"debug-mode" ,"Start enclave in debug mode (enables console output)" ); -object_class_property_add (oc,"enclave-cid" ,"uint64" , +object_class_property_add (oc,"enclave-cid" ,"uint64" ,NULL , nitro_get_enclave_cid, nitro_set_enclave_cid,NULL ,NULL );
accel/tcg/tcg-all.c +3 -3
@@ -270,9 +270,9 @@ static void tcg_accel_class_init(ObjectClass *oc, const void *data) tcg_get_thread, tcg_set_thread); -object_class_property_add (oc,"tb-size" ,"uint32" , - tcg_get_tb_size, tcg_set_tb_size, -NULL ,NULL ); +object_class_property_add (oc,"tb-size" ,"uint32" ,NULL , + tcg_get_tb_size, tcg_set_tb_size, +NULL ,NULL );object_class_property_set_description (oc,"tb-size" ,"TCG translation block cache size" );
accel/whpx/whpx-common.c +6 -6
@@ -528,14 +528,14 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data) ac->pre_resume_vm = whpx_pre_resume_vm; ac->allowed = &whpx_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , whpx_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , whpx_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure WHPX in-kernel irqchip" ); -object_class_property_add (oc,"hyperv" ,"OnOffAuto" , -NULL , whpx_set_hyperv, -NULL ,NULL ); +object_class_property_add (oc,"hyperv" ,"OnOffAuto" ,NULL , +NULL , whpx_set_hyperv, +NULL ,NULL );object_class_property_set_description (oc,"hyperv" ,"Configure Hyper-V enlightenments" );
authz/list.c +1 -1
@@ -126,7 +126,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *data) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); -object_class_property_add (oc,"rules" ,"QAuthZListRule" , +object_class_property_add (oc,"rules" ,"QAuthZListRule" ,NULL , qauthz_list_prop_get_rules, qauthz_list_prop_set_rules,NULL ,NULL );
backends/cryptodev.c +3 -3
@@ -622,15 +622,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const void *data) ucc->prepare_delete = cryptodev_backend_prepare_delete;QTAILQ_INIT (&crypto_clients); -object_class_property_add (oc,"queues" ,"uint32" , +object_class_property_add (oc,"queues" ,"uint32" ,NULL , cryptodev_backend_get_queues, cryptodev_backend_set_queues,NULL ,NULL ); -object_class_property_add (oc,"throttle-bps" ,"uint64" , +object_class_property_add (oc,"throttle-bps" ,"uint64" ,NULL , cryptodev_backend_get_bps, cryptodev_backend_set_bps,NULL ,NULL ); -object_class_property_add (oc,"throttle-ops" ,"uint64" , +object_class_property_add (oc,"throttle-ops" ,"uint64" ,NULL , cryptodev_backend_get_ops, cryptodev_backend_set_ops,NULL ,NULL );
backends/hostmem-file.c +11 -10
@@ -281,14 +281,14 @@ file_backend_class_init(ObjectClass *oc, const void *data) file_memory_backend_get_discard_data, file_memory_backend_set_discard_data);object_class_property_add_str (oc,"mem-path" , get_mem_path, set_mem_path); -object_class_property_add (oc,"align" ,"uint64" , - file_memory_backend_get_align, - file_memory_backend_set_align, -NULL ,NULL ); -object_class_property_add (oc,"offset" ,"int" , - file_memory_backend_get_offset, - file_memory_backend_set_offset, -NULL ,NULL ); +object_class_property_add (oc,"align" ,"uint64" ,NULL , + file_memory_backend_get_align, + file_memory_backend_set_align, +NULL ,NULL ); +object_class_property_add (oc,"offset" ,"int" ,NULL , + file_memory_backend_get_offset, + file_memory_backend_set_offset, +NULL ,NULL );object_class_property_set_description (oc,"offset" ,"Offset into the target file (ex: 1G)" );#ifdef CONFIG_LIBPMEM
@@ -298,8 +298,9 @@ file_backend_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"readonly" , file_memory_backend_get_readonly, file_memory_backend_set_readonly); -object_class_property_add (oc,"rom" ,"OnOffAuto" , - file_memory_backend_get_rom, file_memory_backend_set_rom,NULL ,NULL ); +object_class_property_add (oc,"rom" ,"OnOffAuto" ,NULL , + file_memory_backend_get_rom, + file_memory_backend_set_rom,NULL ,NULL );object_class_property_set_description (oc,"rom" ,"Whether to create Read Only Memory (ROM)" ); }
backends/hostmem-memfd.c +2 -2
@@ -195,7 +195,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) memfd_backend_set_hugetlb);object_class_property_set_description (oc,"hugetlb" ,"Use huge pages" ); -object_class_property_add (oc,"hugetlbsize" ,"uint64" , +object_class_property_add (oc,"hugetlbsize" ,"uint64" ,NULL , memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize,NULL ,NULL );
@@ -203,7 +203,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) "Huge pages size (ex: 2M, 1G)"); } -object_class_property_add (oc,"guest-memfd" ,"OnOffAuto" , +object_class_property_add (oc,"guest-memfd" ,"OnOffAuto" ,NULL , memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd,NULL ,NULL ); object_class_property_set_description(oc, "guest-memfd",
backends/hostmem.c +12 -12
@@ -528,10 +528,10 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) host_memory_backend_set_prealloc);object_class_property_set_description (oc,"prealloc" ,"Preallocate memory" ); -object_class_property_add (oc,"prealloc-threads" ,"int" , - host_memory_backend_get_prealloc_threads, - host_memory_backend_set_prealloc_threads, -NULL ,NULL ); +object_class_property_add (oc,"prealloc-threads" ,"int" ,NULL , + host_memory_backend_get_prealloc_threads, + host_memory_backend_set_prealloc_threads, +NULL ,NULL );object_class_property_set_description (oc,"prealloc-threads" ,"Number of CPU threads to use for prealloc" ); object_class_property_add_link(oc, "prealloc-context",
@@ -539,16 +539,16 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG);object_class_property_set_description (oc,"prealloc-context" ,"Context to use for creating CPU threads for preallocation" ); -object_class_property_add (oc,"size" ,"size" , - host_memory_backend_get_size, - host_memory_backend_set_size, -NULL ,NULL ); +object_class_property_add (oc,"size" ,"size" ,NULL , + host_memory_backend_get_size, + host_memory_backend_set_size, +NULL ,NULL );object_class_property_set_description (oc,"size" ,"Size of the memory region (ex: 500M)" ); -object_class_property_add (oc,"host-nodes" ,"[uint16]" , - host_memory_backend_get_host_nodes, - host_memory_backend_set_host_nodes, -NULL ,NULL ); +object_class_property_add (oc,"host-nodes" ,"[uint16]" ,NULL , + host_memory_backend_get_host_nodes, + host_memory_backend_set_host_nodes, +NULL ,NULL );object_class_property_set_description (oc,"host-nodes" ,"Binds memory to the list of NUMA host nodes" ); object_class_property_add_enum(oc, "policy", "HostMemPolicy",
block/throttle-groups.c +2 -5
@@ -984,17 +984,14 @@ static void throttle_group_obj_class_init(ObjectClass *klass,/* individual properties */ for (i =0 ; i <sizeof (properties) /sizeof (ThrottleParamInfo); i++) { -object_class_property_add (klass, - properties[i].name, -"int64" , +object_class_property_add (klass, properties[i].name,"int64" ,NULL , throttle_group_get, throttle_group_set,NULL , &properties[i]); }/* ThrottleLimits */ -object_class_property_add (klass, -"limits" ,"ThrottleLimits" , +object_class_property_add (klass,"limits" ,"ThrottleLimits" ,NULL , throttle_group_get_limits, throttle_group_set_limits,NULL ,NULL );
chardev/char-socket.c +1 -1
@@ -1568,7 +1568,7 @@ static void char_socket_class_init(ObjectClass *oc, const void *data) cc->chr_listener_cleanup = tcp_chr_listener_cleanup; cc->chr_get_filename = tcp_chr_get_filename; -object_class_property_add (oc,"addr" ,"SocketAddress" , +object_class_property_add (oc,"addr" ,"SocketAddress" ,NULL , char_socket_get_addr,NULL ,NULL ,NULL );
crypto/secret_keyring.c +1 -1
@@ -107,7 +107,7 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, const void *data)QCryptoSecretCommonClass *sic =QCRYPTO_SECRET_COMMON_CLASS (oc); sic->load_data = qcrypto_secret_keyring_load_data; -object_class_property_add (oc,"serial" ,"int32_t" , +object_class_property_add (oc,"serial" ,"int32_t" ,NULL , qcrypto_secret_prop_get_key, qcrypto_secret_prop_set_key,NULL ,NULL );
event-loop-base.c +3 -3
@@ -104,15 +104,15 @@ static void event_loop_base_class_init(ObjectClass *klass, ucc->complete = event_loop_base_complete; ucc->prepare_delete = event_loop_base_prepare_delete; -object_class_property_add (klass,"aio-max-batch" ,"int64" , +object_class_property_add (klass,"aio-max-batch" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &aio_max_batch_info); -object_class_property_add (klass,"thread-pool-min" ,"int64" , +object_class_property_add (klass,"thread-pool-min" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_min_info); -object_class_property_add (klass,"thread-pool-max" ,"int64" , +object_class_property_add (klass,"thread-pool-max" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_max_info);
hw/acpi/ich9.c +1 -1
@@ -379,7 +379,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset)PM_REG_FIELD (acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); -object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" , +object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" ,NULL , ich9_pm_get_gpe0_blk,NULL ,NULL ,NULL ); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED,
hw/acpi/pci.c +4 -4
@@ -139,8 +139,8 @@ static void acpi_generic_initiator_class_init(ObjectClass *oc, const void *data) acpi_generic_initiator_set_pci_device);object_class_property_set_description (oc,"pci-dev" ,"PCI device to associate with the node" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL , - acpi_generic_initiator_set_node,NULL ,NULL ); +object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , + acpi_generic_initiator_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"NUMA node associated with the PCI device" ); }
@@ -253,8 +253,8 @@ static void acpi_generic_port_class_init(ObjectClass *oc, const void *data) acpi_generic_port_set_pci_bus);object_class_property_set_description (oc,"pci-bus" ,"PCI Bus of the host bridge associated with this GP affinity structure" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL , - acpi_generic_port_set_node,NULL ,NULL ); +object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , + acpi_generic_port_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"The NUMA node like ID to index HMAT/SLIT NUMA properties involving GP" ); }
hw/arm/virt.c +5 -5
@@ -4206,9 +4206,9 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="mach-virt.ram" ; mc->default_nic ="virtio-net-pci" ; -object_class_property_add (oc,"acpi" ,"OnOffAuto" , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , + virt_get_acpi, virt_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); object_class_property_add_bool(oc, "secure", virt_get_secure,
@@ -4259,7 +4259,7 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)"Set on/off to enable/disable high " "memory region for PCI MMIO"); -object_class_property_add (oc,"highmem-mmio-size" ,"size" , +object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , virt_get_highmem_mmio_size, virt_set_highmem_mmio_size,NULL ,NULL );
@@ -4267,7 +4267,7 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)"Set the high memory region size " "for PCI MMIO"); -object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" , +object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" ,NULL , virt_get_virtio_transports, virt_set_virtio_transports,NULL ,NULL );
hw/core/clock.c +1 -1
@@ -185,7 +185,7 @@ static void clock_initfn(Object *obj)QLIST_INIT (&clk->children);if (qtest_enabled ()) { -object_property_add (obj,"qtest-clock-period" ,"uint64" , +object_property_add (obj,"qtest-clock-period" ,"uint64" ,NULL , clock_period_prop_get,NULL ,NULL ,NULL ); } }
hw/core/machine.c +16 -13
@@ -1118,26 +1118,29 @@ static void machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dumpdtb" ,"Dump current dtb to a file and quit" ); -object_class_property_add (oc,"boot" ,"BootConfiguration" , - machine_get_boot, machine_set_boot, -NULL ,NULL ); +object_class_property_add (oc,"boot" ,"BootConfiguration" ,NULL , + machine_get_boot, machine_set_boot, +NULL ,NULL );object_class_property_set_description (oc,"boot" ,"Boot configuration" ); -object_class_property_add (oc,"smp" ,"SMPConfiguration" , - machine_get_smp, machine_set_smp, -NULL ,NULL ); +object_class_property_add (oc,"smp" ,"SMPConfiguration" ,NULL , + machine_get_smp, machine_set_smp, +NULL ,NULL );object_class_property_set_description (oc,"smp" ,"CPU topology" );object_class_property_add (oc,"smp-cache" ,"SmpCachePropertiesWrapper" , - machine_get_smp_cache, machine_set_smp_cache,NULL ,NULL ); +NULL , + machine_get_smp_cache, machine_set_smp_cache, +NULL ,NULL );object_class_property_set_description (oc,"smp-cache" ,"Cache properties list for SMP machine" ); -object_class_property_add (oc,"phandle-start" ,"int" , - machine_get_phandle_start, machine_set_phandle_start, -NULL ,NULL ); +object_class_property_add (oc,"phandle-start" ,"int" ,NULL , + machine_get_phandle_start, + machine_set_phandle_start, +NULL ,NULL );object_class_property_set_description (oc,"phandle-start" ,"The first phandle ID we may generate dynamically" );
@@ -1212,9 +1215,9 @@ static void machine_class_init(ObjectClass *oc, const void *data)"Set RAM backend" "Valid value is ID of hostmem based backend"); -object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" , - machine_get_mem, machine_set_mem, -NULL ,NULL ); +object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" ,NULL , + machine_get_mem, machine_set_mem, +NULL ,NULL );object_class_property_set_description (oc,"memory" ,"Memory size configuration" ); }
hw/core/qdev-properties.c +2 -3
@@ -1150,7 +1150,7 @@ void qdev_property_add_static(DeviceState *dev, const Property *prop)assert (!prop->info->create); - op = object_property_add(obj, prop->name, prop->info->type, + op = object_property_add(obj, prop->name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,
@@ -1176,8 +1176,7 @@ static void qdev_class_add_property(DeviceClass *klass, const char *name,if (prop->info->create) { op = prop->info->create (oc, name, prop); }else { - op = object_class_property_add(oc, - name, prop->info->type, + op = object_class_property_add(oc, name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,
hw/cpu/core.c +4 -2
@@ -82,9 +82,11 @@ static void cpu_core_class_init(ObjectClass *oc, const void *data)DeviceClass *dc =DEVICE_CLASS (oc);set_bit (DEVICE_CATEGORY_CPU , dc->categories); -object_class_property_add (oc,"core-id" ,"int" , core_prop_get_core_id, +object_class_property_add (oc,"core-id" ,"int" ,NULL , + core_prop_get_core_id, core_prop_set_core_id,NULL ,NULL ); -object_class_property_add (oc,"nr-threads" ,"int" , core_prop_get_nr_threads, +object_class_property_add (oc,"nr-threads" ,"int" ,NULL , + core_prop_get_nr_threads, core_prop_set_nr_threads,NULL ,NULL ); }
hw/cxl/cxl-host.c +2 -2
@@ -610,13 +610,13 @@ static void machine_set_cfmw(Object *obj, Visitor *v, const char *name,void cxl_machine_init (Object *obj,CXLState *state) { -object_property_add (obj,"cxl" ,"bool" , machine_get_cxl, +object_property_add (obj,"cxl" ,"bool" ,NULL , machine_get_cxl, machine_set_cxl,NULL , state);object_property_set_description (obj,"cxl" ,"Set on/off to enable/disable " "CXL instantiation" ); -object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" , +object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" ,NULL , machine_get_cfmw, machine_set_cfmw,NULL , state); object_property_set_description(obj, "cxl-fmw",
hw/gpio/aspeed_gpio.c +3 -3
@@ -1481,7 +1481,7 @@ static void aspeed_gpio_init(Object *obj)int pin_idx = j %GPIOS_PER_GROUP ;const char *group = &props->group_label[group_idx][0 ];char *name =g_strdup_printf ("gpio%s%d" , group, pin_idx); -object_property_add (obj, name,"bool" , aspeed_gpio_get_pin, +object_property_add (obj, name,"bool" ,NULL , aspeed_gpio_get_pin, aspeed_gpio_set_pin,NULL ,NULL );g_free (name); }
@@ -1489,8 +1489,8 @@ static void aspeed_gpio_init(Object *obj)for (int i =0 ; i < agc->nr_gpio_sets; i++) { g_autofree char *name = g_strdup_printf("gpio-set[%d]", i); -object_property_add (obj, name,"uint32" , aspeed_gpio_get_set, - aspeed_gpio_set_set,NULL ,NULL ); +object_property_add (obj, name,"uint32" ,NULL , aspeed_gpio_get_set, + aspeed_gpio_set_set,NULL ,NULL ); } }
hw/gpio/aspeed_sgpio.c +1 -1
@@ -300,7 +300,7 @@ static void aspeed_sgpio_init(Object *obj) {for (int i =0 ; i <ASPEED_SGPIO_MAX_PIN_PAIR *2 ; i++) { g_autofree char *name = g_strdup_printf("sgpio%03d", i); -object_property_add (obj, name,"bool" , aspeed_sgpio_get_pin, +object_property_add (obj, name,"bool" ,NULL , aspeed_sgpio_get_pin, aspeed_sgpio_set_pin,NULL ,NULL ); } }
hw/gpio/pca9552.c +2 -2
@@ -567,12 +567,12 @@ static void pca955x_initfn(Object *obj)if (k->has_led_support) {/* LED variant: expose the LED selector state as led%d. */ name =g_strdup_printf ("led%d" , ix); -object_property_add (obj, name,"bool" , +object_property_add (obj, name,"bool" ,NULL , pca955x_get_led, pca955x_set_led,NULL ,NULL ); }else {/* GPIO variant: expose the pin logic level as pin%d. */ name =g_strdup_printf ("pin%d" , ix); -object_property_add (obj, name,"str" , +object_property_add (obj, name,"str" ,NULL , pca955x_get_pin, pca955x_set_pin,NULL ,NULL ); }g_free (name);
hw/gpio/pca9554.c +2 -1
@@ -280,7 +280,8 @@ static void pca9554_initfn(Object *obj)char *name; name =g_strdup_printf ("pin%d" , pin); -object_property_add (obj, name,"str" , pca9554_get_pin, pca9554_set_pin, +object_property_add (obj, name,"str" ,NULL , pca9554_get_pin, + pca9554_set_pin,NULL ,NULL );g_free (name); }
hw/gpio/stm32l4x5_gpio.c +2 -2
@@ -409,10 +409,10 @@ static void stm32l4x5_gpio_init(Object *obj) s->clk =qdev_init_clock_in (DEVICE (s),"clk" ,NULL , s,0 ); -object_property_add (obj,"disconnected-pins" ,"uint16" , +object_property_add (obj,"disconnected-pins" ,"uint16" ,NULL , disconnected_pins_get, disconnected_pins_set,NULL , &s->disconnected_pins); -object_property_add (obj,"clock-freq-hz" ,"uint32" , +object_property_add (obj,"clock-freq-hz" ,"uint32" ,NULL , clock_freq_get,NULL ,NULL ,NULL ); }
hw/hexagon/hexagon_dsp.c +1 -1
@@ -153,7 +153,7 @@ static void hexagon_sim_set_subsystem_base(Object *obj, Visitor *v,static void add_dsp_properties (ObjectClass *oc) { -object_class_property_add (oc,"subsystem-base" ,"uint32" , +object_class_property_add (oc,"subsystem-base" ,"uint32" ,NULL , hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base,NULL ,NULL ); object_class_property_set_description(oc, "subsystem-base",
hw/i386/microvm.c +3 -3
@@ -673,21 +673,21 @@ static void microvm_class_init(ObjectClass *oc, const void *data) hc->unplug_request = microvm_device_unplug_request_cb; hc->unplug = microvm_device_unplug_cb; -object_class_property_add (oc,MICROVM_MACHINE_RTC ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_RTC ,"OnOffAuto" ,NULL , microvm_machine_get_rtc, microvm_machine_set_rtc,NULL ,NULL );object_class_property_set_description (oc,MICROVM_MACHINE_RTC ,"Enable MC146818 RTC" ); -object_class_property_add (oc,MICROVM_MACHINE_PCIE ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_PCIE ,"OnOffAuto" ,NULL , microvm_machine_get_pcie, microvm_machine_set_pcie,NULL ,NULL );object_class_property_set_description (oc,MICROVM_MACHINE_PCIE ,"Enable PCIe" ); -object_class_property_add (oc,MICROVM_MACHINE_IOAPIC2 ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_IOAPIC2 ,"OnOffAuto" ,NULL , microvm_machine_get_ioapic2, microvm_machine_set_ioapic2,NULL ,NULL );
hw/i386/pc.c +15 -12
@@ -1722,15 +1722,16 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="pc.ram" ; pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_AUTO ; -object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" , - pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" ,NULL , + pc_machine_get_max_ram_below_4g, + pc_machine_set_max_ram_below_4g, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"Maximum ram below the 4G boundary (32bit boundary)" ); -object_class_property_add (oc,PC_MACHINE_VMPORT ,"OnOffAuto" , - pc_machine_get_vmport, pc_machine_set_vmport, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_VMPORT ,"OnOffAuto" ,NULL , + pc_machine_get_vmport, pc_machine_set_vmport, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_VMPORT ,"Enable vmport (pc & q35)" );
@@ -1758,15 +1759,17 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); -object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" , - pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" ,NULL , + pc_machine_get_max_fw_size, + pc_machine_set_max_fw_size, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_MAX_FW_SIZE ,"Maximum combined firmware size" ); -object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" , - pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" ,NULL , + pc_machine_get_smbios_ep, + pc_machine_set_smbios_ep, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_SMBIOS_EP ,"SMBIOS Entry Point type [32, 64]" );
hw/i386/sgx-epc.c +1 -1
@@ -159,7 +159,7 @@ static void sgx_epc_class_init(ObjectClass *oc, const void *data) mdc->get_memory_region = sgx_epc_md_get_memory_region; mdc->fill_device_info = sgx_epc_md_fill_device_info; -object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" , +object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" ,NULL , sgx_epc_get_size,NULL ,NULL ,NULL );
hw/i386/x86.c +12 -11
@@ -391,26 +391,26 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) mc->kvm_type = x86_kvm_type; nc->raise_nmi = x86_nmi; -object_class_property_add (oc,X86_MACHINE_SMM ,"OnOffAuto" , - x86_machine_get_smm, x86_machine_set_smm, -NULL ,NULL ); +object_class_property_add (oc,X86_MACHINE_SMM ,"OnOffAuto" ,NULL , + x86_machine_get_smm, x86_machine_set_smm, +NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_SMM ,"Enable SMM" ); -object_class_property_add (oc,X86_MACHINE_ACPI ,"OnOffAuto" , - x86_machine_get_acpi, x86_machine_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,X86_MACHINE_ACPI ,"OnOffAuto" ,NULL , + x86_machine_get_acpi, x86_machine_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_ACPI ,"Enable ACPI" ); -object_class_property_add (oc,X86_MACHINE_PIT ,"OnOffAuto" , +object_class_property_add (oc,X86_MACHINE_PIT ,"OnOffAuto" ,NULL , x86_machine_get_pit, x86_machine_set_pit,NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_PIT ,"Enable i8254 PIT" ); -object_class_property_add (oc,X86_MACHINE_PIC ,"OnOffAuto" , +object_class_property_add (oc,X86_MACHINE_PIC ,"OnOffAuto" ,NULL , x86_machine_get_pic, x86_machine_set_pic,NULL ,NULL );
@@ -435,14 +435,15 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) "The string may be up to 8 bytes in size");object_class_property_add (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"uint64_t" , +NULL , x86_machine_get_bus_lock_ratelimit, x86_machine_set_bus_lock_ratelimit,NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"Set the ratelimit for the bus locks acquired in VMs" ); -object_class_property_add (oc,"sgx-epc" ,"SgxEPC" , - machine_get_sgx_epc, machine_set_sgx_epc, -NULL ,NULL ); +object_class_property_add (oc,"sgx-epc" ,"SgxEPC" ,NULL , + machine_get_sgx_epc, machine_set_sgx_epc, +NULL ,NULL );object_class_property_set_description (oc,"sgx-epc" ,"SGX EPC device" ); }
hw/ide/ide-dev.c +1 -1
@@ -174,7 +174,7 @@ out:static void ide_dev_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , ide_dev_get_bootindex, ide_dev_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/intc/apic_common.c +1 -1
@@ -442,7 +442,7 @@ static void apic_common_initfn(Object *obj)APICCommonState *s =APIC_COMMON (obj); s->id = s->initial_apic_id =-1 ; -object_property_add (obj,"id" ,"uint32" , +object_property_add (obj,"id" ,"uint32" ,NULL , apic_common_get_id, apic_common_set_id,NULL ,NULL ); }
hw/loongarch/virt.c +9 -9
@@ -1483,18 +1483,18 @@ static void virt_class_init(ObjectClass *oc, const void *data) hc->unplug_request = virt_device_unplug_request; hc->unplug = virt_device_unplug; -object_class_property_add (oc,"acpi" ,"OnOffAuto" , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , + virt_get_acpi, virt_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"v-eiointc" ,"OnOffAuto" , - virt_get_veiointc, virt_set_veiointc, -NULL ,NULL ); +object_class_property_add (oc,"v-eiointc" ,"OnOffAuto" ,NULL , + virt_get_veiointc, virt_set_veiointc, +NULL ,NULL );object_class_property_set_description (oc,"v-eiointc" ,"Enable Virt Extend I/O Interrupt Controller." ); -object_class_property_add (oc,"dmsi" ,"OnOffAuto" , - virt_get_dmsi, virt_set_dmsi,NULL ,NULL ); +object_class_property_add (oc,"dmsi" ,"OnOffAuto" ,NULL , + virt_get_dmsi, virt_set_dmsi,NULL ,NULL );object_class_property_set_description (oc,"dmsi" ,"Enable direct Message-interrupts Controller." );machine_class_allow_dynamic_sysbus_dev (mc,TYPE_RAMFB_DEVICE );
@@ -1525,7 +1525,7 @@ static void virt_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"highmem-mmio" ,"Set on/off to enable/disable high " "memory region for PCI MMIO" ); -object_class_property_add (oc,"highmem-mmio-size" ,"size" , +object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , virt_get_highmem_mmio_size, virt_set_highmem_mmio_size,NULL ,NULL );
hw/mem/nvdimm.c +3 -2
@@ -99,11 +99,12 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,static void nvdimm_init (Object *obj) { -object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" , +object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" ,NULL , nvdimm_get_label_size, nvdimm_set_label_size,NULL ,NULL ); -object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" , nvdimm_get_uuid, +object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" ,NULL , + nvdimm_get_uuid, nvdimm_set_uuid,NULL ,NULL ); }
hw/mem/pc-dimm.c +2 -1
@@ -176,7 +176,8 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name,static void pc_dimm_init (Object *obj) { -object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" , pc_dimm_get_size, +object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" ,NULL , + pc_dimm_get_size,NULL ,NULL ,NULL ); }
hw/misc/aspeed_lpc.c +24 -12
@@ -417,29 +417,41 @@ static void aspeed_lpc_realize(DeviceState *dev, Error **errp)static void aspeed_lpc_init (Object *obj) { -object_property_add (obj,"idr1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); }
hw/misc/aspeed_sdmc.c +1 -1
@@ -259,7 +259,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visitor *v, const char *name,static void aspeed_sdmc_initfn (Object *obj) { -object_property_add (obj,"ram-size" ,"int" , +object_property_add (obj,"ram-size" ,"int" ,NULL , aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size,NULL ,NULL ); }
hw/misc/npcm7xx_mft.c +1 -1
@@ -491,7 +491,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =qdev_init_clock_out (dev,"clock2" );for (int i =0 ; i <NPCM7XX_PWM_PER_MODULE ; ++i) { -object_property_add (obj,"max_rpm[*]" ,"uint32" , +object_property_add (obj,"max_rpm[*]" ,"uint32" ,NULL , npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm,NULL , &s->max_rpm[i]);
hw/net/ne2000-isa.c +1 -1
@@ -131,7 +131,7 @@ out:static void isa_ne2000_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , isa_ne2000_get_bootindex, isa_ne2000_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/nvme/ctrl.c +1 -1
@@ -10612,7 +10612,7 @@ static void nvme_instance_init(Object *obj)"bootindex" ,"/namespace@1,0" , DEVICE(obj)); -object_property_add (obj,"smart_critical_warning" ,"uint8" , +object_property_add (obj,"smart_critical_warning" ,"uint8" ,NULL , nvme_get_smart_warning, nvme_set_smart_warning,NULL ,NULL ); }
hw/pci-bridge/pci_expander_bridge.c +1 -1
@@ -103,7 +103,7 @@ static void pxb_bus_class_init(ObjectClass *class, const void *data) pbc->bus_num = pxb_bus_num; pbc->numa_node = pxb_bus_numa_node; -object_class_property_add (class,"acpi_uid" ,"uint32" , +object_class_property_add (class,"acpi_uid" ,"uint32" ,NULL , prop_pxb_uid_get,NULL ,NULL ,NULL );object_class_property_set_description (class,"acpi_uid" ,"ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI00016" );
hw/pci-host/i440fx.c +4 -0
@@ -388,18 +388,22 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, const void *data) dc->user_creatable = false;object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , +NULL , i440fx_pcihost_get_pci_hole_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , +NULL , i440fx_pcihost_get_pci_hole_end,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , +NULL , i440fx_pcihost_get_pci_hole64_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , +NULL , i440fx_pcihost_get_pci_hole64_end,NULL ,NULL ,NULL ); }
hw/pci-host/pnv_phb3.c +2 -2
@@ -1164,12 +1164,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" , +object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" , +object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL );
hw/pci-host/pnv_phb4.c +2 -2
@@ -1775,12 +1775,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" , +object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" , +object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL );
hw/pci-host/q35.c +4 -4
@@ -226,19 +226,19 @@ static void q35_host_initfn(Object *obj)qdev_prop_set_uint64 (DEVICE (s),PCI_HOST_PROP_PCI_HOLE64_SIZE ,Q35_PCI_HOST_HOLE64_SIZE_DEFAULT ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" ,NULL , q35_host_get_pci_hole_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" ,NULL , q35_host_get_pci_hole_end,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" ,NULL , q35_host_get_pci_hole64_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" ,NULL , q35_host_get_pci_hole64_end,NULL ,NULL ,NULL );
hw/ppc/spapr_caps.c +1 -1
@@ -1069,7 +1069,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name = g_strdup_printf("cap-%s", cap->name); g_autofree char *desc = g_strdup(cap->description); -object_class_property_add (klass, name, cap->type, +object_class_property_add (klass, name, cap->type,NULL , cap->get, cap->set,NULL , cap);
hw/ppc/spapr_drc.c +2 -2
@@ -584,9 +584,9 @@ static void spapr_dr_connector_instance_init(Object *obj)SpaprDrcClass *drck =SPAPR_DR_CONNECTOR_GET_CLASS (drc);object_property_add_uint32_ptr (obj,"id" , &drc->id,OBJ_PROP_FLAG_READ ); -object_property_add (obj,"index" ,"uint32" , prop_get_index, +object_property_add (obj,"index" ,"uint32" ,NULL , prop_get_index,NULL ,NULL ,NULL ); -object_property_add (obj,"fdt" ,"struct" , prop_get_fdt, +object_property_add (obj,"fdt" ,"struct" ,NULL , prop_get_fdt,NULL ,NULL ,NULL ); drc->state = drck->empty_state; }
hw/remote/vfio-user-obj.c +1 -1
@@ -931,7 +931,7 @@ static void vfu_object_class_init(ObjectClass *klass, const void *data) k->nr_devs =0 ; -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL , +object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , vfu_object_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" , "SocketAddress "
hw/riscv/microchip_pfsoc.c +1 -0
@@ -744,6 +744,7 @@ static void microchip_icicle_kit_machine_class_init(ObjectClass *oc, mc->default_ram_size =1537 * MiB;object_class_property_add (oc,"clint-timebase-frequency" ,"uint32_t" , +NULL , microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq,NULL ,NULL );
hw/riscv/virt.c +2 -2
@@ -1184,13 +1184,13 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"aia-guests" , str); } -object_class_property_add (oc,"acpi" ,"OnOffAuto" , +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , virt_get_acpi, virt_set_acpi,NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"iommu-sys" ,"OnOffAuto" , +object_class_property_add (oc,"iommu-sys" ,"OnOffAuto" ,NULL , virt_get_iommu_sys, virt_set_iommu_sys,NULL ,NULL ); object_class_property_set_description(oc, "iommu-sys",
hw/s390x/s390-virtio-ccw.c +2 -2
@@ -908,7 +908,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dea-key-wrap" ,"enable/disable DEA key wrapping using the CPACF wrapping key" ); -object_class_property_add (oc,"loadparm" ,"loadparm" , +object_class_property_add (oc,"loadparm" ,"loadparm" ,NULL , machine_get_loadparm, machine_set_loadparm,NULL ,NULL ); object_class_property_set_description(oc, "loadparm",
@@ -916,7 +916,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)" to upper case) to pass to machine loader, boot manager," " and guest kernel"); -object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" , +object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" ,NULL , machine_get_boot_certs, machine_set_boot_certs,NULL ,NULL );object_class_property_set_description (oc,"boot-certs" ,"provide paths to a directory and/or a certificate file for secure boot" );
hw/s390x/sclpcpi.c +4 -2
@@ -195,12 +195,14 @@ static void cpi_class_init(ObjectClass *klass, const void *data)"name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); -object_class_property_add (klass,"system_level" ,"uint64" , get_system_level, +object_class_property_add (klass,"system_level" ,"uint64" ,NULL , + get_system_level,NULL ,NULL ,NULL );object_class_property_set_description (klass,"system_level" ,"distribution and kernel version in Linux e.g. 74872343805430528" ); -object_class_property_add (klass,"timestamp" ,"uint64" , get_timestamp, +object_class_property_add (klass,"timestamp" ,"uint64" ,NULL , + get_timestamp,NULL ,NULL ,NULL );object_class_property_set_description (klass,"timestamp" ,"latest update of CPI data in nanoseconds since the UNIX EPOCH" );
hw/s390x/virtio-ccw-mem.c +1 -1
@@ -205,7 +205,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size,NULL ,NULL ); }
hw/sensor/adc128d818.c +5 -3
@@ -642,14 +642,16 @@ static void adc128d818_initfn(Object *obj)for (unsigned ch =0u ; ch <ADC128D818_NUM_CHANNELS ; ch++) {char *name =g_strdup_printf ("ain%u" , ch); -object_property_add (obj, name,"int" , adc128d818_get_ain, +object_property_add (obj, name,"int" ,NULL , adc128d818_get_ain, adc128d818_set_ain,NULL ,NULL );g_free (name); } -object_property_add (obj,"temperature" ,"int" , adc128d818_get_temperature, +object_property_add (obj,"temperature" ,"int" ,NULL , + adc128d818_get_temperature, adc128d818_set_temperature,NULL ,NULL ); -object_property_add (obj,"ext-vref-mv" ,"int" , adc128d818_get_ext_vref, +object_property_add (obj,"ext-vref-mv" ,"int" ,NULL , + adc128d818_get_ext_vref, adc128d818_set_ext_vref,NULL ,NULL ); }
hw/sensor/adm1266.c +1 -1
@@ -217,7 +217,7 @@ static void adm1266_init(Object *obj)for (int i =0 ; i <ADM1266_NUM_PAGES ; i++) {pmbus_page_config (pmdev, i, flags); -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , adm1266_get, adm1266_set,NULL , &pmdev->pages[i].read_vout); }
hw/sensor/adm1272.c +4 -4
@@ -493,19 +493,19 @@ static void adm1272_init(Object *obj)pmbus_page_config (pmdev,0 , flags); -object_property_add (obj,"vin" ,"uint16" , +object_property_add (obj,"vin" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vin); -object_property_add (obj,"vout" ,"uint16" , +object_property_add (obj,"vout" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vout); -object_property_add (obj,"iout" ,"uint16" , +object_property_add (obj,"iout" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_iout); -object_property_add (obj,"pin" ,"uint16" , +object_property_add (obj,"pin" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_pin);
hw/sensor/emc141x.c +4 -4
@@ -251,16 +251,16 @@ static void emc141x_reset(DeviceState *dev)static void emc141x_initfn (Object *obj) { -object_property_add (obj,"temperature0" ,"int" , +object_property_add (obj,"temperature0" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature1" ,"int" , +object_property_add (obj,"temperature1" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature2" ,"int" , +object_property_add (obj,"temperature2" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature3" ,"int" , +object_property_add (obj,"temperature3" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); }
hw/sensor/isl_pmbus_vr.c +9 -9
@@ -136,63 +136,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)PMBusDevice *pmdev =PMBUS_DEVICE (obj);for (int i =0 ; i < pages; i++) {if (flags[i] &PB_HAS_VIN ) { -object_property_add (obj,"vin[*]" ,"uint16" , +object_property_add (obj,"vin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vin); }if (flags[i] &PB_HAS_VOUT ) { -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vout); }if (flags[i] &PB_HAS_IIN ) { -object_property_add (obj,"iin[*]" ,"uint16" , +object_property_add (obj,"iin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iin); }if (flags[i] &PB_HAS_IOUT ) { -object_property_add (obj,"iout[*]" ,"uint16" , +object_property_add (obj,"iout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iout); }if (flags[i] &PB_HAS_PIN ) { -object_property_add (obj,"pin[*]" ,"uint16" , +object_property_add (obj,"pin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pin); }if (flags[i] &PB_HAS_POUT ) { -object_property_add (obj,"pout[*]" ,"uint16" , +object_property_add (obj,"pout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pout); }if (flags[i] &PB_HAS_TEMPERATURE ) { -object_property_add (obj,"temp1[*]" ,"uint16" , +object_property_add (obj,"temp1[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_1); }if (flags[i] &PB_HAS_TEMP2 ) { -object_property_add (obj,"temp2[*]" ,"uint16" , +object_property_add (obj,"temp2[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_2); }if (flags[i] &PB_HAS_TEMP3 ) { -object_property_add (obj,"temp3[*]" ,"uint16" , +object_property_add (obj,"temp3[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_3);
hw/sensor/lsm303dlhc_mag.c +12 -12
@@ -509,21 +509,21 @@ static void lsm303dlhc_mag_reset(DeviceState *dev)*/ static void lsm303dlhc_mag_initfn (Object *obj) { -object_property_add (obj,"mag-x" ,"int" , - lsm303dlhc_mag_get_x, - lsm303dlhc_mag_set_x,NULL ,NULL ); +object_property_add (obj,"mag-x" ,"int" ,NULL , + lsm303dlhc_mag_get_x, + lsm303dlhc_mag_set_x,NULL ,NULL ); -object_property_add (obj,"mag-y" ,"int" , - lsm303dlhc_mag_get_y, - lsm303dlhc_mag_set_y,NULL ,NULL ); +object_property_add (obj,"mag-y" ,"int" ,NULL , + lsm303dlhc_mag_get_y, + lsm303dlhc_mag_set_y,NULL ,NULL ); -object_property_add (obj,"mag-z" ,"int" , - lsm303dlhc_mag_get_z, - lsm303dlhc_mag_set_z,NULL ,NULL ); +object_property_add (obj,"mag-z" ,"int" ,NULL , + lsm303dlhc_mag_get_z, + lsm303dlhc_mag_set_z,NULL ,NULL ); -object_property_add (obj,"temperature" ,"int" , - lsm303dlhc_mag_get_temperature, - lsm303dlhc_mag_set_temperature,NULL ,NULL ); +object_property_add (obj,"temperature" ,"int" ,NULL , + lsm303dlhc_mag_get_temperature, + lsm303dlhc_mag_set_temperature,NULL ,NULL ); }/*
hw/sensor/max34451.c +2 -2
@@ -727,7 +727,7 @@ static void max34451_init(Object *obj)/* get and set the voltage in millivolts, max is 32767 mV */ for (int i =0 ; i <MAX34451_NUM_PWR_DEVICES ; i++) { -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , max34451_get, max34451_set,NULL , &pmdev->pages[i].read_vout); }
@@ -737,7 +737,7 @@ static void max34451_init(Object *obj)* centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =0 ; i <MAX34451_NUM_TEMP_DEVICES ; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add(obj, "temperature[*]", "uint16", NULL, max34451_get, max34451_set, NULL,
hw/sensor/tmp105.c +1 -1
@@ -408,7 +408,7 @@ static void tmp105_realize(DeviceState *dev, Error **errp)static void tmp105_initfn (Object *obj) { -object_property_add (obj,"temperature" ,"int" , +object_property_add (obj,"temperature" ,"int" ,NULL , tmp105_get_temperature, tmp105_set_temperature,NULL ,NULL ); object_property_set_description(obj, "temperature",
hw/sensor/tmp421.c +4 -4
@@ -350,16 +350,16 @@ static void tmp421_class_init(ObjectClass *klass, const void *data) dc->vmsd = &vmstate_tmp421; sc->dev = (DeviceInfo *) data; -object_class_property_add (klass,"temperature0" ,"int" , +object_class_property_add (klass,"temperature0" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature1" ,"int" , +object_class_property_add (klass,"temperature1" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature2" ,"int" , +object_class_property_add (klass,"temperature2" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature3" ,"int" , +object_class_property_add (klass,"temperature3" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); }
hw/usb/dev-storage-classic.c +1 -1
@@ -122,7 +122,7 @@ out:static void usb_msd_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , usb_msd_get_bootindex, usb_msd_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/vfio-user/pci.c +1 -1
@@ -471,7 +471,7 @@ static void vfio_user_pci_class_init(ObjectClass *klass, const void *data)device_class_set_legacy_reset (dc, vfio_user_pci_reset);device_class_set_props (dc, vfio_user_pci_properties); -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL , +object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , vfio_user_pci_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" ,"SocketAddress (UNIX sockets only)" );
hw/virtio/virtio-balloon.c +2 -2
@@ -1036,10 +1036,10 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN ; s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify; -object_property_add (obj,"guest-stats" ,"guest statistics" , +object_property_add (obj,"guest-stats" ,"guest statistics" ,NULL , balloon_stats_get_all,NULL ,NULL ,NULL ); -object_property_add (obj,"guest-stats-polling-interval" ,"int" , +object_property_add (obj,"guest-stats-polling-interval" ,"int" ,NULL , balloon_stats_get_poll_interval, balloon_stats_set_poll_interval,NULL ,NULL );
hw/virtio/virtio-mem-pci.c +1 -1
@@ -211,7 +211,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size,NULL ,NULL ); }
hw/virtio/virtio-mem.c +4 -3
@@ -1533,12 +1533,13 @@ static void virtio_mem_instance_init(Object *obj)notifier_list_init (&vmem->size_change_notifiers); -object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" , virtio_mem_get_size, +object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" ,NULL , + virtio_mem_get_size,NULL ,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_mem_get_requested_size, virtio_mem_set_requested_size,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" ,NULL , virtio_mem_get_block_size, virtio_mem_set_block_size,NULL ,NULL ); }
hw/xen/xen-pvh-common.c +4 -4
@@ -413,7 +413,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)#define OC_MEMMAP_PROP_BASE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add(c, prop_name "-base", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \
@@ -422,7 +422,7 @@ do { \#define OC_MEMMAP_PROP_SIZE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \
@@ -458,7 +458,7 @@ do { \OC_MEMMAP_PROP (oc,"pci-mmio" , pci_mmio);OC_MEMMAP_PROP (oc,"pci-mmio-high" , pci_mmio_high); -object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" , +object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" ,NULL , xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base,NULL ,NULL );
@@ -468,7 +468,7 @@ do { \#ifdef CONFIG_TPM if (xpc->has_tpm) { -object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" , +object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" ,NULL , xen_pvh_get_tpm_base, xen_pvh_set_tpm_base,NULL ,NULL );
iothread.c +4 -4
@@ -315,19 +315,19 @@ static void iothread_class_init(ObjectClass *klass, const void *class_data) bc->init = iothread_init; bc->update_params = iothread_set_aio_context_params; -object_class_property_add (klass,"poll-max-ns" ,"int64" , +object_class_property_add (klass,"poll-max-ns" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_max_ns_info); -object_class_property_add (klass,"poll-grow" ,"int64" , +object_class_property_add (klass,"poll-grow" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_grow_info); -object_class_property_add (klass,"poll-shrink" ,"int64" , +object_class_property_add (klass,"poll-shrink" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_shrink_info); -object_class_property_add (klass,"poll-weight" ,"int64" , +object_class_property_add (klass,"poll-weight" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_weight_info);
net/colo-compare.c +3 -3
@@ -1373,15 +1373,15 @@ static void colo_compare_init(Object *obj)object_property_add_str (obj,"notify_dev" , compare_get_notify_dev, compare_set_notify_dev); -object_property_add (obj,"compare_timeout" ,"uint64" , +object_property_add (obj,"compare_timeout" ,"uint64" ,NULL , compare_get_timeout, compare_set_timeout,NULL ,NULL ); -object_property_add (obj,"expired_scan_cycle" ,"uint32" , +object_property_add (obj,"expired_scan_cycle" ,"uint32" ,NULL , compare_get_expired_scan_cycle, compare_set_expired_scan_cycle,NULL ,NULL ); -object_property_add (obj,"max_queue_size" ,"uint32" , +object_property_add (obj,"max_queue_size" ,"uint32" ,NULL , get_max_queue_size, set_max_queue_size,NULL ,NULL );
net/dump.c +2 -1
@@ -238,7 +238,8 @@ static void filter_dump_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"maxlen" ,"uint32" , filter_dump_get_maxlen, +object_class_property_add (oc,"maxlen" ,"uint32" ,NULL , + filter_dump_get_maxlen, filter_dump_set_maxlen,NULL ,NULL );object_class_property_add_str (oc,"file" , file_dump_get_filename, file_dump_set_filename);
net/filter-buffer.c +1 -1
@@ -182,7 +182,7 @@ static void filter_buffer_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"interval" ,"uint32" , +object_class_property_add (oc,"interval" ,"uint32" ,NULL , filter_buffer_get_interval, filter_buffer_set_interval,NULL ,NULL );
qom/object.c +35 -29
261 lines not on this page · raw message
system/bootdevice.c +1 -1
@@ -336,7 +336,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, prop->suffix = suffix; prop->dev = dev; - object_property_add(obj, name, "int32", + object_property_add(obj, name, "int32", NULL, device_get_bootindex, device_set_bootindex, property_release_bootindex,
system/memory.c +2 -2
@@ -1293,11 +1293,11 @@ static void memory_region_initfn(Object *obj)object_property_add_uint64_ptr (OBJECT (mr),"addr" , &mr->addr,OBJ_PROP_FLAG_READ ); -object_property_add (OBJECT (mr),"priority" ,"int32" , +object_property_add (OBJECT (mr),"priority" ,"int32" ,NULL , memory_region_get_priority,NULL ,/* memory_region_set_priority */ NULL ,NULL ); -object_property_add (OBJECT (mr),"size" ,"uint64" , +object_property_add (OBJECT (mr),"size" ,"uint64" ,NULL , memory_region_get_size,NULL ,/* memory_region_set_size, */ NULL ,NULL );
target/arm/cpu64.c +5 -5
@@ -328,7 +328,7 @@ static void prop_bool_set_false(Object *obj, Visitor *v, const char *name,static void prop_add_stub_bool (Object *obj,const char *name) { -object_property_add (obj, name,"bool" , prop_bool_get_false, +object_property_add (obj, name,"bool" ,NULL , prop_bool_get_false, prop_bool_set_false,NULL ,NULL ); }
@@ -518,13 +518,13 @@ void aarch64_add_sve_properties(Object *obj)for (vq =1 ; vq <=ARM_MAX_VQ ; ++vq) {char name[8 ];snprintf (name,sizeof (name),"sve%d" , vq *128 ); -object_property_add (obj, name,"bool" , cpu_arm_get_vq, +object_property_add (obj, name,"bool" ,NULL , cpu_arm_get_vq, cpu_arm_set_vq,NULL , &cpu->sve_vq); }#ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ -object_property_add (obj,"sve-default-vector-length" ,"int32" , +object_property_add (obj,"sve-default-vector-length" ,"int32" ,NULL , cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len,NULL , &cpu->sve_default_vq);
@@ -543,13 +543,13 @@ void aarch64_add_sme_properties(Object *obj)for (vq =1 ; vq <=ARM_MAX_VQ ; vq <<=1 ) {char name[8 ];snprintf (name,sizeof (name),"sme%d" , vq *128 ); -object_property_add (obj, name,"bool" , cpu_arm_get_vq, +object_property_add (obj, name,"bool" ,NULL , cpu_arm_get_vq, cpu_arm_set_vq,NULL , &cpu->sme_vq); }#ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ -object_property_add (obj,"sme-default-vector-length" ,"int32" , +object_property_add (obj,"sme-default-vector-length" ,"int32" ,NULL , cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len,NULL , &cpu->sme_default_vq);
target/arm/kvm.c +1 -1
@@ -1820,7 +1820,7 @@ static void kvm_arch_set_eager_split_size(Object *obj, Visitor *v,void kvm_arch_accel_class_init (ObjectClass *oc) { -object_class_property_add (oc,"eager-split-size" ,"size" , +object_class_property_add (oc,"eager-split-size" ,"size" ,NULL , kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size,NULL ,NULL );
target/arm/tcg/cpu64.c +2 -2
@@ -1392,7 +1392,7 @@ void aarch64_max_v8_tcg_initfn(Object *obj)/* v8.2: FEAT_SVE */ cpu->sve_vq.supported =MAKE_64BIT_MASK (0 ,ARM_MAX_VQ );aarch64_add_sve_properties (OBJECT (cpu)); -object_property_add (OBJECT (cpu),"sve-max-vq" ,"uint32" , +object_property_add (OBJECT (cpu),"sve-max-vq" ,"uint32" ,NULL , cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq,NULL ,NULL );
@@ -1529,7 +1529,7 @@ void aarch64_max_v9_tcg_initfn(Object *obj)object_property_add_bool (obj,"x-rme" , cpu_arm_get_rme, cpu_arm_set_rme);/* v9.4: FEAT_RME_GPC2 */ -object_property_add (obj,"x-l0gptsz" ,"uint32" , cpu_max_get_l0gptsz, +object_property_add (obj,"x-l0gptsz" ,"uint32" ,NULL , cpu_max_get_l0gptsz, cpu_max_set_l0gptsz,NULL ,NULL ); }
target/i386/cpu.c +11 -9
@@ -10484,7 +10484,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *xcc, fp =g_new0 (BitProperty,1 ); fp->w = w; fp->mask = mask; -object_class_property_add (oc, prop_name,"bool" , +object_class_property_add (oc, prop_name,"bool" ,NULL , x86_cpu_get_bit_prop, x86_cpu_set_bit_prop,NULL , fp);
@@ -10569,10 +10569,11 @@ static void x86_cpu_initfn(Object *obj)x86_cpu_init_default_topo (cpu); -object_property_add (obj,"feature-words" ,"X86CPUFeatureWordInfo" , +object_property_add (obj,"feature-words" ,"X86CPUFeatureWordInfo" ,NULL , x86_cpu_get_feature_words,NULL ,NULL , (void *)env->features);object_property_add (obj,"filtered-features" ,"X86CPUFeatureWordInfo" , +NULL , x86_cpu_get_feature_words,NULL ,NULL , (void *)cpu->filtered_features);
@@ -11005,13 +11006,13 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data) dc->user_creatable = true; -object_class_property_add (oc,"family" ,"uint64" , +object_class_property_add (oc,"family" ,"uint64" ,NULL , x86_cpuid_version_get_family, x86_cpuid_version_set_family,NULL ,NULL ); -object_class_property_add (oc,"model" ,"uint64" , +object_class_property_add (oc,"model" ,"uint64" ,NULL , x86_cpuid_version_get_model, x86_cpuid_version_set_model,NULL ,NULL ); -object_class_property_add (oc,"stepping" ,"uint64" , +object_class_property_add (oc,"stepping" ,"uint64" ,NULL , x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping,NULL ,NULL ); object_class_property_add_str(oc, "vendor",
@@ -11020,7 +11021,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data)object_class_property_add_str (oc,"model-id" , x86_cpuid_get_model_id, x86_cpuid_set_model_id); -object_class_property_add (oc,"tsc-frequency" ,"int" , +object_class_property_add (oc,"tsc-frequency" ,"int" ,NULL , x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq,NULL ,NULL );/*
@@ -11029,17 +11030,18 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data)* QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ -object_class_property_add (oc,"unavailable-features" ,"strList" , +object_class_property_add (oc,"unavailable-features" ,"strList" ,NULL , x86_cpu_get_unavailable_features,NULL ,NULL ,NULL ); -object_class_property_add (oc,"avx10-version" ,"uint8" , +object_class_property_add (oc,"avx10-version" ,"uint8" ,NULL , x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version,NULL ,NULL );#if !defined(CONFIG_USER_ONLY ) -object_class_property_add (oc,"crash-information" ,"GuestPanicInformation" , +object_class_property_add (oc,"crash-information" , +"GuestPanicInformation" ,NULL , x86_cpu_get_crash_info_qom,NULL ,NULL ,NULL );#endif
target/i386/kvm/kvm.c +4 -4
@@ -7096,7 +7096,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc)object_class_property_set_description (oc,"notify-vmexit" ,"Enable notify VM exit" ); -object_class_property_add (oc,"notify-window" ,"uint32" , +object_class_property_add (oc,"notify-window" ,"uint32" ,NULL , kvm_arch_get_notify_window, kvm_arch_set_notify_window,NULL ,NULL );
@@ -7104,7 +7104,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc)"Clock cycles without an event window " "after which a notification VM exit occurs"); -object_class_property_add (oc,"xen-version" ,"uint32" , +object_class_property_add (oc,"xen-version" ,"uint32" ,NULL , kvm_arch_get_xen_version, kvm_arch_set_xen_version,NULL ,NULL );
@@ -7113,14 +7113,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc)"(in XENVER_version form " "e.g. 0x4000a for 4.10)"); -object_class_property_add (oc,"xen-gnttab-max-frames" ,"uint16" , +object_class_property_add (oc,"xen-gnttab-max-frames" ,"uint16" ,NULL , kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames,NULL ,NULL );object_class_property_set_description (oc,"xen-gnttab-max-frames" ,"Maximum number of grant table frames" ); -object_class_property_add (oc,"xen-evtchn-max-pirq" ,"uint16" , +object_class_property_add (oc,"xen-evtchn-max-pirq" ,"uint16" ,NULL , kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq,NULL ,NULL );
target/i386/kvm/tdx.c +1 -1
@@ -1586,7 +1586,7 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); -object_property_add (obj,"quote-generation-socket" ,"SocketAddress" , +object_property_add (obj,"quote-generation-socket" ,"SocketAddress" ,NULL , tdx_guest_get_qgs, tdx_guest_set_qgs,NULL ,NULL );
target/i386/sev.c +4 -4
@@ -3024,7 +3024,7 @@ sev_guest_class_init(ObjectClass *oc, const void *data) sev_guest_set_session_file);object_class_property_set_description (oc,"session-file" ,"guest owners session parameters (encoded with base64)" ); -object_class_property_add (oc,"legacy-vm-type" ,"OnOffAuto" , +object_class_property_add (oc,"legacy-vm-type" ,"OnOffAuto" ,NULL , sev_guest_get_legacy_vm_type, sev_guest_set_legacy_vm_type,NULL ,NULL ); object_class_property_set_description(oc, "legacy-vm-type",
@@ -3056,7 +3056,7 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =DEFAULT_GUEST_POLICY ;object_property_add_uint32_ptr (obj,"handle" , &sev_guest->handle,OBJ_PROP_FLAG_READWRITE ); -object_property_add (obj,"policy" ,"uint32" , sev_guest_get_policy, +object_property_add (obj,"policy" ,"uint32" ,NULL , sev_guest_get_policy, sev_guest_set_policy,NULL ,NULL );object_apply_compat_props (obj);
@@ -3334,7 +3334,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void *data) x86_klass->adjust_cpuid_features = sev_snp_adjust_cpuid_features; x86_klass->kvm_type = sev_snp_kvm_type; -object_class_property_add (oc,"policy" ,"uint64" , +object_class_property_add (oc,"policy" ,"uint64" ,NULL , sev_snp_guest_get_policy, sev_snp_guest_set_policy,NULL ,NULL ); object_class_property_add_str(oc, "guest-visible-workarounds",
@@ -3358,7 +3358,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"secure-tsc" , sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); -object_class_property_add (oc,"tsc-frequency" ,"uint32" , +object_class_property_add (oc,"tsc-frequency" ,"uint32" ,NULL , sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency,NULL ,NULL ); }
target/i386/whpx/whpx-all.c +9 -9
@@ -3010,19 +3010,19 @@ static void whpx_set_ssd(Object *obj, Visitor *v,void whpx_arch_accel_class_init (ObjectClass *oc) { -object_class_property_add (oc,"ignore-unknown-msr" ,"OnOffAuto" , -NULL , whpx_set_unknown_msr, -NULL ,NULL ); +object_class_property_add (oc,"ignore-unknown-msr" ,"OnOffAuto" ,NULL , +NULL , whpx_set_unknown_msr, +NULL ,NULL );object_class_property_set_description (oc,"ignore-unknown-msr" ,"Configure unknown MSR behavior" ); -object_class_property_add (oc,"intercept-msr-gp" ,"OnOffAuto" , -NULL , whpx_set_intercept_msr_gp, -NULL ,NULL ); +object_class_property_add (oc,"intercept-msr-gp" ,"OnOffAuto" ,NULL , +NULL , whpx_set_intercept_msr_gp, +NULL ,NULL );object_class_property_set_description (oc,"intercept-msr-gp" ,"Intercept #GP to log erroring MSR accesses." ); -object_class_property_add (oc,"ssd" ,"OnOffAuto" , -NULL , whpx_set_ssd, -NULL ,NULL ); +object_class_property_add (oc,"ssd" ,"OnOffAuto" ,NULL , +NULL , whpx_set_ssd, +NULL ,NULL );object_class_property_set_description (oc,"ssd" ,"Separate security domain" ); }
target/ppc/compat.c +1 -1
@@ -335,7 +335,7 @@ void ppc_compat_add_property(Object *obj, const char *name,gchar *names, *desc;int i; -object_property_add (obj, name,"string" , +object_property_add (obj, name,"string" ,NULL , ppc_compat_prop_get, ppc_compat_prop_set,NULL , compat_pvr);
target/riscv/cpu.c +6 -6
@@ -1412,20 +1412,20 @@ void riscv_add_satp_mode_properties(Object *obj) {RISCVCPU *cpu =RISCV_CPU (obj); -object_property_add (obj,"svbare" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"svbare" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes);if (cpu->env.misa_mxl ==MXL_RV32 ) { -object_property_add (obj,"sv32" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"sv32" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); }else { -object_property_add (obj,"sv39" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"sv39" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv48" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"sv48" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv57" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"sv57" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv64" ,"bool" , cpu_riscv_get_satp, +object_property_add (obj,"sv64" ,"bool" ,NULL , cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); } }
target/riscv/kvm/kvm-cpu.c +3 -3
@@ -541,7 +541,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj, const char *prop_name)* unknown to KVM and error out if the user attempts * to enable any of them. */ -object_property_add (obj, prop_name,"bool" , +object_property_add (obj, prop_name,"bool" ,NULL , cpu_get_cfg_unavailable, cpu_set_cfg_unavailable,NULL , (void *)prop_name);
@@ -561,7 +561,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *cpu_obj) misa_cfg->name =riscv_get_misa_ext_name (bit); misa_cfg->description =riscv_get_misa_ext_description (bit); -object_property_add (cpu_obj, misa_cfg->name,"bool" , +object_property_add (cpu_obj, misa_cfg->name,"bool" ,NULL , kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg,NULL , misa_cfg);
@@ -577,7 +577,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *cpu_obj)for (i =0 ; i <ARRAY_SIZE (kvm_multi_ext_cfgs); i++) {KVMCPUConfig *multi_cfg = &kvm_multi_ext_cfgs[i]; -object_property_add (cpu_obj, multi_cfg->name,"bool" , +object_property_add (cpu_obj, multi_cfg->name,"bool" ,NULL , kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg,NULL , multi_cfg);
target/riscv/tcg/tcg-cpu.c +3 -3
@@ -1478,7 +1478,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu_obj)continue ; } -object_property_add (cpu_obj, name,"bool" , +object_property_add (cpu_obj, name,"bool" ,NULL , cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg,NULL , (void *)misa_cfg);
@@ -1532,7 +1532,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj)for (int i =0 ; riscv_profiles[i] !=NULL ; i++) {RISCVCPUProfile *profile = riscv_profiles[i]; -object_property_add (cpu_obj, profile->name,"bool" , +object_property_add (cpu_obj, profile->name,"bool" ,NULL , cpu_get_profile, cpu_set_profile,NULL , (void *)profile);
@@ -1608,7 +1608,7 @@ static void riscv_cpu_add_user_properties(Object *obj)for (edata = isa_edata_arr; edata && edata->name; edata++) {if (edata->prop_name) { -object_property_add (obj, edata->prop_name,"bool" , +object_property_add (obj, edata->prop_name,"bool" ,NULL , cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg,NULL , (void *)&edata->ext_enable_offset);
target/s390x/cpu-system.c +1 -0
@@ -138,6 +138,7 @@ void s390_cpu_system_init(Object *obj) cs->start_powered_off = true;object_property_add (obj,"crash-information" ,"GuestPanicInformation" , +NULL , s390_cpu_get_crash_info_qom,NULL ,NULL ,NULL ); cpu->env.tod_timer =timer_new_ns (QEMU_CLOCK_VIRTUAL , s390x_tod_timer, cpu);
target/s390x/cpu_models.c +3 -2
@@ -792,13 +792,14 @@ void s390_cpu_model_class_register_props(ObjectClass *oc)for (feat =0 ; feat <S390_FEAT_MAX ; feat++) {const S390FeatDef *def =s390_feat_def (feat); -object_class_property_add (oc, def->name,"bool" , get_feature, +object_class_property_add (oc, def->name,"bool" ,NULL , get_feature, set_feature,NULL , (void *) feat);object_class_property_set_description (oc, def->name, def->desc); }for (group =0 ; group <S390_FEAT_GROUP_MAX ; group++) {const S390FeatGroupDef *def =s390_feat_group_def (group); -object_class_property_add (oc, def->name,"bool" , get_feature_group, +object_class_property_add (oc, def->name,"bool" ,NULL , + get_feature_group, set_feature_group,NULL , (void *) group);object_class_property_set_description (oc, def->name, def->desc); }
tests/unit/test-qdev-global-props.c +4 -2
@@ -171,9 +171,11 @@ static void prop2_accessor(Object *obj, Visitor *v, const char *name,static void dynamic_instance_init (Object *obj) { -object_property_add (obj,"prop1" ,"uint32" , prop1_accessor, prop1_accessor, +object_property_add (obj,"prop1" ,"uint32" ,NULL , prop1_accessor, + prop1_accessor,NULL ,NULL ); -object_property_add (obj,"prop2" ,"uint32" , prop2_accessor, prop2_accessor, +object_property_add (obj,"prop2" ,"uint32" ,NULL , prop2_accessor, + prop2_accessor,NULL ,NULL ); }
ui/console.c +1 -1
@@ -535,7 +535,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const void *data) offsetof(QemuGraphicConsole , device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); -object_class_property_add (oc,"head" ,"uint32" , +object_class_property_add (oc,"head" ,"uint32" ,NULL , qemu_graphic_console_prop_get_head,NULL ,NULL ,NULL );
util/thread-context.c +3 -3
@@ -278,13 +278,13 @@ static void thread_context_class_init(ObjectClass *oc, const void *data)UserCreatableClass *ucc =USER_CREATABLE_CLASS (oc); ucc->complete = thread_context_instance_complete; -object_class_property_add (oc,"thread-id" ,"uint64" , +object_class_property_add (oc,"thread-id" ,"uint64" ,NULL , thread_context_get_thread_id,NULL ,NULL ,NULL ); -object_class_property_add (oc,"cpu-affinity" ,"[uint16]" , +object_class_property_add (oc,"cpu-affinity" ,"[uint16]" ,NULL , thread_context_get_cpu_affinity, thread_context_set_cpu_affinity,NULL ,NULL ); -object_class_property_add (oc,"node-affinity" ,"[uint16]" ,NULL , +object_class_property_add (oc,"node-affinity" ,"[uint16]" ,NULL ,NULL , thread_context_set_node_affinity,NULL ,NULL ); }
Signature · 1 line
2.55.0
Re: [PATCH v8 14/56] qom: New object_property_add() etc. parameter @qapi_type
Quoted 1,731 lines
This permits setting ObjectProperty's optional @qapi_type. For now, all callers pass null. Callers updated with this Coccinelle script:
@@
identifier fun = {
object_property_try_add,object_property_add,object_class_property_add
};
expression obj, name, type;
@@(quoted diff) +1
-1- fun(obj, name, type, + fun(obj, name, type, NULL, ...)Signed-off-by Markus Armbruster <[email protected]>Message-ID: <[email protected]>
--- include/qom/object.h | 5 +++ accel/hvf/hvf-all.c | 6 +-- accel/kvm/kvm-all.c | 19 +++++---- accel/nitro/nitro-accel.c | 2 +- accel/tcg/tcg-all.c | 6 +-- accel/whpx/whpx-common.c | 12 +++--- authz/list.c | 2 +- backends/cryptodev.c | 6 +-- backends/hostmem-file.c | 21 +++++----- backends/hostmem-memfd.c | 4 +- backends/hostmem.c | 24 +++++------ block/throttle-groups.c | 7 +--- chardev/char-socket.c | 2 +- crypto/secret_keyring.c | 2 +- event-loop-base.c | 6 +-- hw/acpi/ich9.c | 2 +- hw/acpi/pci.c | 8 ++-- hw/arm/virt.c | 10 ++--- hw/core/clock.c | 2 +- hw/core/machine.c | 29 +++++++------ hw/core/qdev-properties.c | 5 +-- hw/cpu/core.c | 6 ++- hw/cxl/cxl-host.c | 4 +- hw/gpio/aspeed_gpio.c | 6 +-- hw/gpio/aspeed_sgpio.c | 2 +- hw/gpio/pca9552.c | 4 +- hw/gpio/pca9554.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 4 +- hw/hexagon/hexagon_dsp.c | 2 +- hw/i386/microvm.c | 6 +-- hw/i386/pc.c | 27 ++++++------ hw/i386/sgx-epc.c | 2 +- hw/i386/x86.c | 23 ++++++----- hw/ide/ide-dev.c | 2 +- hw/intc/apic_common.c | 2 +- hw/loongarch/virt.c | 18 ++++---- hw/mem/nvdimm.c | 5 ++- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 36 ++++++++++------ hw/misc/aspeed_sdmc.c | 2 +- hw/misc/npcm7xx_mft.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/nvme/ctrl.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci-host/i440fx.c | 4 ++ hw/pci-host/pnv_phb3.c | 4 +- hw/pci-host/pnv_phb4.c | 4 +- hw/pci-host/q35.c | 8 ++-- hw/ppc/spapr_caps.c | 2 +- hw/ppc/spapr_drc.c | 4 +- hw/remote/vfio-user-obj.c | 2 +- hw/riscv/microchip_pfsoc.c | 1 + hw/riscv/virt.c | 4 +- hw/s390x/s390-virtio-ccw.c | 4 +- hw/s390x/sclpcpi.c | 6 ++- hw/s390x/virtio-ccw-mem.c | 2 +- hw/sensor/adc128d818.c | 8 ++-- hw/sensor/adm1266.c | 2 +- hw/sensor/adm1272.c | 8 ++-- hw/sensor/emc141x.c | 8 ++-- hw/sensor/isl_pmbus_vr.c | 18 ++++---- hw/sensor/lsm303dlhc_mag.c | 24 +++++------ hw/sensor/max34451.c | 4 +- hw/sensor/tmp105.c | 2 +- hw/sensor/tmp421.c | 8 ++-- hw/usb/dev-storage-classic.c | 2 +- hw/vfio-user/pci.c | 2 +- hw/virtio/virtio-balloon.c | 4 +- hw/virtio/virtio-mem-pci.c | 2 +- hw/virtio/virtio-mem.c | 7 ++-- hw/xen/xen-pvh-common.c | 8 ++-- iothread.c | 8 ++-- net/colo-compare.c | 6 +-- net/dump.c | 3 +- net/filter-buffer.c | 2 +- qom/object.c | 64 ++++++++++++++++------------- system/bootdevice.c | 2 +- system/memory.c | 4 +- target/arm/cpu64.c | 10 ++--- target/arm/kvm.c | 2 +- target/arm/tcg/cpu64.c | 4 +- target/i386/cpu.c | 20 +++++---- target/i386/kvm/kvm.c | 8 ++-- target/i386/kvm/tdx.c | 2 +- target/i386/sev.c | 8 ++-- target/i386/whpx/whpx-all.c | 18 ++++---- target/ppc/compat.c | 2 +- target/riscv/cpu.c | 12 +++--- target/riscv/kvm/kvm-cpu.c | 6 +-- target/riscv/tcg/tcg-cpu.c | 6 +-- target/s390x/cpu-system.c | 1 + target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 6 ++- ui/console.c | 2 +- util/thread-context.c | 6 +-- 95 files changed, 377 insertions(+), 327 deletions(-)accel/hvf/hvf-all.c +3
-3@@ -277,9 +277,9 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data) ac->allowed = &hvf_allowed; hvf_kernel_irqchip_override = false; hvf_kernel_irqchip = false; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , hvf_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , hvf_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure HVF irqchip" ); }accel/kvm/kvm-all.c +10
-9@@ -4303,21 +4303,22 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data) ac->has_memory = kvm_accel_has_memory; ac->allowed = &kvm_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , kvm_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , kvm_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure KVM in-kernel irqchip" ); -object_class_property_add (oc,"kvm-shadow-mem" ,"int" , - kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, -NULL ,NULL ); +object_class_property_add (oc,"kvm-shadow-mem" ,"int" ,NULL , + kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, +NULL ,NULL );object_class_property_set_description (oc,"kvm-shadow-mem" ,"KVM shadow MMU size" ); -object_class_property_add (oc,"dirty-ring-size" ,"uint32" , - kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, -NULL ,NULL ); +object_class_property_add (oc,"dirty-ring-size" ,"uint32" ,NULL , + kvm_get_dirty_ring_size, + kvm_set_dirty_ring_size, +NULL ,NULL );object_class_property_set_description (oc,"dirty-ring-size" ,"Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)" );accel/nitro/nitro-accel.c +1
-1@@ -238,7 +238,7 @@ static void nitro_accel_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"debug-mode" ,"Start enclave in debug mode (enables console output)" ); -object_class_property_add (oc,"enclave-cid" ,"uint64" , +object_class_property_add (oc,"enclave-cid" ,"uint64" ,NULL , nitro_get_enclave_cid, nitro_set_enclave_cid,NULL ,NULL );accel/tcg/tcg-all.c +3
-3@@ -270,9 +270,9 @@ static void tcg_accel_class_init(ObjectClass *oc, const void *data) tcg_get_thread, tcg_set_thread); -object_class_property_add (oc,"tb-size" ,"uint32" , - tcg_get_tb_size, tcg_set_tb_size, -NULL ,NULL ); +object_class_property_add (oc,"tb-size" ,"uint32" ,NULL , + tcg_get_tb_size, tcg_set_tb_size, +NULL ,NULL );object_class_property_set_description (oc,"tb-size" ,"TCG translation block cache size" );accel/whpx/whpx-common.c +6
-6@@ -528,14 +528,14 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data) ac->pre_resume_vm = whpx_pre_resume_vm; ac->allowed = &whpx_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" , -NULL , whpx_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , +NULL , whpx_set_kernel_irqchip, +NULL ,NULL );object_class_property_set_description (oc,"kernel-irqchip" ,"Configure WHPX in-kernel irqchip" ); -object_class_property_add (oc,"hyperv" ,"OnOffAuto" , -NULL , whpx_set_hyperv, -NULL ,NULL ); +object_class_property_add (oc,"hyperv" ,"OnOffAuto" ,NULL , +NULL , whpx_set_hyperv, +NULL ,NULL );object_class_property_set_description (oc,"hyperv" ,"Configure Hyper-V enlightenments" );authz/list.c +1
-1@@ -126,7 +126,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *data) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); -object_class_property_add (oc,"rules" ,"QAuthZListRule" , +object_class_property_add (oc,"rules" ,"QAuthZListRule" ,NULL , qauthz_list_prop_get_rules, qauthz_list_prop_set_rules,NULL ,NULL );backends/cryptodev.c +3
-3@@ -622,15 +622,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const void *data) ucc->prepare_delete = cryptodev_backend_prepare_delete;QTAILQ_INIT (&crypto_clients); -object_class_property_add (oc,"queues" ,"uint32" , +object_class_property_add (oc,"queues" ,"uint32" ,NULL , cryptodev_backend_get_queues, cryptodev_backend_set_queues,NULL ,NULL ); -object_class_property_add (oc,"throttle-bps" ,"uint64" , +object_class_property_add (oc,"throttle-bps" ,"uint64" ,NULL , cryptodev_backend_get_bps, cryptodev_backend_set_bps,NULL ,NULL ); -object_class_property_add (oc,"throttle-ops" ,"uint64" , +object_class_property_add (oc,"throttle-ops" ,"uint64" ,NULL , cryptodev_backend_get_ops, cryptodev_backend_set_ops,NULL ,NULL );backends/hostmem-file.c +11
-10@@ -281,14 +281,14 @@ file_backend_class_init(ObjectClass *oc, const void *data) file_memory_backend_get_discard_data, file_memory_backend_set_discard_data);object_class_property_add_str (oc,"mem-path" , get_mem_path, set_mem_path); -object_class_property_add (oc,"align" ,"uint64" , - file_memory_backend_get_align, - file_memory_backend_set_align, -NULL ,NULL ); -object_class_property_add (oc,"offset" ,"int" , - file_memory_backend_get_offset, - file_memory_backend_set_offset, -NULL ,NULL ); +object_class_property_add (oc,"align" ,"uint64" ,NULL , + file_memory_backend_get_align, + file_memory_backend_set_align, +NULL ,NULL ); +object_class_property_add (oc,"offset" ,"int" ,NULL , + file_memory_backend_get_offset, + file_memory_backend_set_offset, +NULL ,NULL );object_class_property_set_description (oc,"offset" ,"Offset into the target file (ex: 1G)" );#ifdef CONFIG_LIBPMEM @@ -298,8 +298,9 @@ file_backend_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"readonly" , file_memory_backend_get_readonly, file_memory_backend_set_readonly); -object_class_property_add (oc,"rom" ,"OnOffAuto" , - file_memory_backend_get_rom, file_memory_backend_set_rom,NULL ,NULL ); +object_class_property_add (oc,"rom" ,"OnOffAuto" ,NULL , + file_memory_backend_get_rom, + file_memory_backend_set_rom,NULL ,NULL );object_class_property_set_description (oc,"rom" ,"Whether to create Read Only Memory (ROM)" ); }backends/hostmem-memfd.c +2
-2@@ -195,7 +195,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) memfd_backend_set_hugetlb);object_class_property_set_description (oc,"hugetlb" ,"Use huge pages" ); -object_class_property_add (oc,"hugetlbsize" ,"uint64" , +object_class_property_add (oc,"hugetlbsize" ,"uint64" ,NULL , memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize,NULL ,NULL );@@ -203,7 +203,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) "Huge pages size (ex: 2M, 1G)"); } -object_class_property_add (oc,"guest-memfd" ,"OnOffAuto" , +object_class_property_add (oc,"guest-memfd" ,"OnOffAuto" ,NULL , memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd,NULL ,NULL ); object_class_property_set_description(oc, "guest-memfd",backends/hostmem.c +12
-12@@ -528,10 +528,10 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) host_memory_backend_set_prealloc);object_class_property_set_description (oc,"prealloc" ,"Preallocate memory" ); -object_class_property_add (oc,"prealloc-threads" ,"int" , - host_memory_backend_get_prealloc_threads, - host_memory_backend_set_prealloc_threads, -NULL ,NULL ); +object_class_property_add (oc,"prealloc-threads" ,"int" ,NULL , + host_memory_backend_get_prealloc_threads, + host_memory_backend_set_prealloc_threads, +NULL ,NULL );object_class_property_set_description (oc,"prealloc-threads" ,"Number of CPU threads to use for prealloc" ); object_class_property_add_link(oc, "prealloc-context",@@ -539,16 +539,16 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG);object_class_property_set_description (oc,"prealloc-context" ,"Context to use for creating CPU threads for preallocation" ); -object_class_property_add (oc,"size" ,"size" , - host_memory_backend_get_size, - host_memory_backend_set_size, -NULL ,NULL ); +object_class_property_add (oc,"size" ,"size" ,NULL , + host_memory_backend_get_size, + host_memory_backend_set_size, +NULL ,NULL );object_class_property_set_description (oc,"size" ,"Size of the memory region (ex: 500M)" ); -object_class_property_add (oc,"host-nodes" ,"[uint16]" , - host_memory_backend_get_host_nodes, - host_memory_backend_set_host_nodes, -NULL ,NULL ); +object_class_property_add (oc,"host-nodes" ,"[uint16]" ,NULL , + host_memory_backend_get_host_nodes, + host_memory_backend_set_host_nodes, +NULL ,NULL );object_class_property_set_description (oc,"host-nodes" ,"Binds memory to the list of NUMA host nodes" ); object_class_property_add_enum(oc, "policy", "HostMemPolicy",block/throttle-groups.c +2
-5@@ -984,17 +984,14 @@ static void throttle_group_obj_class_init(ObjectClass *klass,/* individual properties */ for (i =0 ; i <sizeof (properties) /sizeof (ThrottleParamInfo); i++) { -object_class_property_add (klass, - properties[i].name, -"int64" , +object_class_property_add (klass, properties[i].name,"int64" ,NULL , throttle_group_get, throttle_group_set,NULL , &properties[i]); }/* ThrottleLimits */ -object_class_property_add (klass, -"limits" ,"ThrottleLimits" , +object_class_property_add (klass,"limits" ,"ThrottleLimits" ,NULL , throttle_group_get_limits, throttle_group_set_limits,NULL ,NULL );chardev/char-socket.c +1
-1@@ -1568,7 +1568,7 @@ static void char_socket_class_init(ObjectClass *oc, const void *data) cc->chr_listener_cleanup = tcp_chr_listener_cleanup; cc->chr_get_filename = tcp_chr_get_filename; -object_class_property_add (oc,"addr" ,"SocketAddress" , +object_class_property_add (oc,"addr" ,"SocketAddress" ,NULL , char_socket_get_addr,NULL ,NULL ,NULL );crypto/secret_keyring.c +1
-1@@ -107,7 +107,7 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, const void *data)QCryptoSecretCommonClass *sic =QCRYPTO_SECRET_COMMON_CLASS (oc); sic->load_data = qcrypto_secret_keyring_load_data; -object_class_property_add (oc,"serial" ,"int32_t" , +object_class_property_add (oc,"serial" ,"int32_t" ,NULL , qcrypto_secret_prop_get_key, qcrypto_secret_prop_set_key,NULL ,NULL );event-loop-base.c +3
-3@@ -104,15 +104,15 @@ static void event_loop_base_class_init(ObjectClass *klass, ucc->complete = event_loop_base_complete; ucc->prepare_delete = event_loop_base_prepare_delete; -object_class_property_add (klass,"aio-max-batch" ,"int64" , +object_class_property_add (klass,"aio-max-batch" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &aio_max_batch_info); -object_class_property_add (klass,"thread-pool-min" ,"int64" , +object_class_property_add (klass,"thread-pool-min" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_min_info); -object_class_property_add (klass,"thread-pool-max" ,"int64" , +object_class_property_add (klass,"thread-pool-max" ,"int64" ,NULL , event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_max_info);hw/acpi/ich9.c +1
-1@@ -379,7 +379,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset)PM_REG_FIELD (acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); -object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" , +object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" ,NULL , ich9_pm_get_gpe0_blk,NULL ,NULL ,NULL ); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED,hw/acpi/pci.c +4
-4@@ -139,8 +139,8 @@ static void acpi_generic_initiator_class_init(ObjectClass *oc, const void *data) acpi_generic_initiator_set_pci_device);object_class_property_set_description (oc,"pci-dev" ,"PCI device to associate with the node" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL , - acpi_generic_initiator_set_node,NULL ,NULL ); +object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , + acpi_generic_initiator_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"NUMA node associated with the PCI device" ); }@@ -253,8 +253,8 @@ static void acpi_generic_port_class_init(ObjectClass *oc, const void *data) acpi_generic_port_set_pci_bus);object_class_property_set_description (oc,"pci-bus" ,"PCI Bus of the host bridge associated with this GP affinity structure" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL , - acpi_generic_port_set_node,NULL ,NULL ); +object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , + acpi_generic_port_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"The NUMA node like ID to index HMAT/SLIT NUMA properties involving GP" ); }hw/arm/virt.c +5
-5@@ -4207,9 +4207,9 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="mach-virt.ram" ; mc->default_nic ="virtio-net-pci" ; -object_class_property_add (oc,"acpi" ,"OnOffAuto" , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , + virt_get_acpi, virt_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); object_class_property_add_bool(oc, "secure", virt_get_secure,@@ -4260,7 +4260,7 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)"Set on/off to enable/disable high " "memory region for PCI MMIO"); -object_class_property_add (oc,"highmem-mmio-size" ,"size" , +object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , virt_get_highmem_mmio_size, virt_set_highmem_mmio_size,NULL ,NULL );@@ -4268,7 +4268,7 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)"Set the high memory region size " "for PCI MMIO"); -object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" , +object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" ,NULL , virt_get_virtio_transports, virt_set_virtio_transports,NULL ,NULL );hw/core/clock.c +1
-1@@ -185,7 +185,7 @@ static void clock_initfn(Object *obj)QLIST_INIT (&clk->children);if (qtest_enabled ()) { -object_property_add (obj,"qtest-clock-period" ,"uint64" , +object_property_add (obj,"qtest-clock-period" ,"uint64" ,NULL , clock_period_prop_get,NULL ,NULL ,NULL ); } }hw/core/machine.c +16
-13@@ -1118,26 +1118,29 @@ static void machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dumpdtb" ,"Dump current dtb to a file and quit" ); -object_class_property_add (oc,"boot" ,"BootConfiguration" , - machine_get_boot, machine_set_boot, -NULL ,NULL ); +object_class_property_add (oc,"boot" ,"BootConfiguration" ,NULL , + machine_get_boot, machine_set_boot, +NULL ,NULL );object_class_property_set_description (oc,"boot" ,"Boot configuration" ); -object_class_property_add (oc,"smp" ,"SMPConfiguration" , - machine_get_smp, machine_set_smp, -NULL ,NULL ); +object_class_property_add (oc,"smp" ,"SMPConfiguration" ,NULL , + machine_get_smp, machine_set_smp, +NULL ,NULL );object_class_property_set_description (oc,"smp" ,"CPU topology" );object_class_property_add (oc,"smp-cache" ,"SmpCachePropertiesWrapper" , - machine_get_smp_cache, machine_set_smp_cache,NULL ,NULL ); +NULL , + machine_get_smp_cache, machine_set_smp_cache, +NULL ,NULL );object_class_property_set_description (oc,"smp-cache" ,"Cache properties list for SMP machine" ); -object_class_property_add (oc,"phandle-start" ,"int" , - machine_get_phandle_start, machine_set_phandle_start, -NULL ,NULL ); +object_class_property_add (oc,"phandle-start" ,"int" ,NULL , + machine_get_phandle_start, + machine_set_phandle_start, +NULL ,NULL );object_class_property_set_description (oc,"phandle-start" ,"The first phandle ID we may generate dynamically" );@@ -1212,9 +1215,9 @@ static void machine_class_init(ObjectClass *oc, const void *data)"Set RAM backend" "Valid value is ID of hostmem based backend"); -object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" , - machine_get_mem, machine_set_mem, -NULL ,NULL ); +object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" ,NULL , + machine_get_mem, machine_set_mem, +NULL ,NULL );object_class_property_set_description (oc,"memory" ,"Memory size configuration" ); }hw/core/qdev-properties.c +2
-3@@ -1150,7 +1150,7 @@ void qdev_property_add_static(DeviceState *dev, const Property *prop)assert (!prop->info->create); - op = object_property_add(obj, prop->name, prop->info->type, + op = object_property_add(obj, prop->name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,@@ -1176,8 +1176,7 @@ static void qdev_class_add_property(DeviceClass *klass, const char *name,if (prop->info->create) { op = prop->info->create (oc, name, prop); }else { - op = object_class_property_add(oc, - name, prop->info->type, + op = object_class_property_add(oc, name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,hw/cpu/core.c +4
-2@@ -82,9 +82,11 @@ static void cpu_core_class_init(ObjectClass *oc, const void *data)DeviceClass *dc =DEVICE_CLASS (oc);set_bit (DEVICE_CATEGORY_CPU , dc->categories); -object_class_property_add (oc,"core-id" ,"int" , core_prop_get_core_id, +object_class_property_add (oc,"core-id" ,"int" ,NULL , + core_prop_get_core_id, core_prop_set_core_id,NULL ,NULL ); -object_class_property_add (oc,"nr-threads" ,"int" , core_prop_get_nr_threads, +object_class_property_add (oc,"nr-threads" ,"int" ,NULL , + core_prop_get_nr_threads, core_prop_set_nr_threads,NULL ,NULL ); }hw/cxl/cxl-host.c +2
-2@@ -610,13 +610,13 @@ static void machine_set_cfmw(Object *obj, Visitor *v, const char *name,void cxl_machine_init (Object *obj,CXLState *state) { -object_property_add (obj,"cxl" ,"bool" , machine_get_cxl, +object_property_add (obj,"cxl" ,"bool" ,NULL , machine_get_cxl, machine_set_cxl,NULL , state);object_property_set_description (obj,"cxl" ,"Set on/off to enable/disable " "CXL instantiation" ); -object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" , +object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" ,NULL , machine_get_cfmw, machine_set_cfmw,NULL , state); object_property_set_description(obj, "cxl-fmw",hw/gpio/aspeed_gpio.c +3
-3@@ -1481,7 +1481,7 @@ static void aspeed_gpio_init(Object *obj)int pin_idx = j %GPIOS_PER_GROUP ;const char *group = &props->group_label[group_idx][0 ];char *name =g_strdup_printf ("gpio%s%d" , group, pin_idx); -object_property_add (obj, name,"bool" , aspeed_gpio_get_pin, +object_property_add (obj, name,"bool" ,NULL , aspeed_gpio_get_pin, aspeed_gpio_set_pin,NULL ,NULL );g_free (name); }@@ -1489,8 +1489,8 @@ static void aspeed_gpio_init(Object *obj)for (int i =0 ; i < agc->nr_gpio_sets; i++) { g_autofree char *name = g_strdup_printf("gpio-set[%d]", i); -object_property_add (obj, name,"uint32" , aspeed_gpio_get_set, - aspeed_gpio_set_set,NULL ,NULL ); +object_property_add (obj, name,"uint32" ,NULL , aspeed_gpio_get_set, + aspeed_gpio_set_set,NULL ,NULL ); } }hw/gpio/aspeed_sgpio.c +1
-1@@ -300,7 +300,7 @@ static void aspeed_sgpio_init(Object *obj) {for (int i =0 ; i <ASPEED_SGPIO_MAX_PIN_PAIR *2 ; i++) { g_autofree char *name = g_strdup_printf("sgpio%03d", i); -object_property_add (obj, name,"bool" , aspeed_sgpio_get_pin, +object_property_add (obj, name,"bool" ,NULL , aspeed_sgpio_get_pin, aspeed_sgpio_set_pin,NULL ,NULL ); } }hw/gpio/pca9552.c +2
-2@@ -567,12 +567,12 @@ static void pca955x_initfn(Object *obj)if (k->has_led_support) {/* LED variant: expose the LED selector state as led%d. */ name =g_strdup_printf ("led%d" , ix); -object_property_add (obj, name,"bool" , +object_property_add (obj, name,"bool" ,NULL , pca955x_get_led, pca955x_set_led,NULL ,NULL ); }else {/* GPIO variant: expose the pin logic level as pin%d. */ name =g_strdup_printf ("pin%d" , ix); -object_property_add (obj, name,"str" , +object_property_add (obj, name,"str" ,NULL , pca955x_get_pin, pca955x_set_pin,NULL ,NULL ); }g_free (name);hw/gpio/pca9554.c +2
-1@@ -280,7 +280,8 @@ static void pca9554_initfn(Object *obj)char *name; name =g_strdup_printf ("pin%d" , pin); -object_property_add (obj, name,"str" , pca9554_get_pin, pca9554_set_pin, +object_property_add (obj, name,"str" ,NULL , pca9554_get_pin, + pca9554_set_pin,NULL ,NULL );g_free (name); }hw/gpio/stm32l4x5_gpio.c +2
-2@@ -409,10 +409,10 @@ static void stm32l4x5_gpio_init(Object *obj) s->clk =qdev_init_clock_in (DEVICE (s),"clk" ,NULL , s,0 ); -object_property_add (obj,"disconnected-pins" ,"uint16" , +object_property_add (obj,"disconnected-pins" ,"uint16" ,NULL , disconnected_pins_get, disconnected_pins_set,NULL , &s->disconnected_pins); -object_property_add (obj,"clock-freq-hz" ,"uint32" , +object_property_add (obj,"clock-freq-hz" ,"uint32" ,NULL , clock_freq_get,NULL ,NULL ,NULL ); }hw/hexagon/hexagon_dsp.c +1
-1@@ -153,7 +153,7 @@ static void hexagon_sim_set_subsystem_base(Object *obj, Visitor *v,static void add_dsp_properties (ObjectClass *oc) { -object_class_property_add (oc,"subsystem-base" ,"uint32" , +object_class_property_add (oc,"subsystem-base" ,"uint32" ,NULL , hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base,NULL ,NULL ); object_class_property_set_description(oc, "subsystem-base",hw/i386/microvm.c +3
-3@@ -673,21 +673,21 @@ static void microvm_class_init(ObjectClass *oc, const void *data) hc->unplug_request = microvm_device_unplug_request_cb; hc->unplug = microvm_device_unplug_cb; -object_class_property_add (oc,MICROVM_MACHINE_RTC ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_RTC ,"OnOffAuto" ,NULL , microvm_machine_get_rtc, microvm_machine_set_rtc,NULL ,NULL );object_class_property_set_description (oc,MICROVM_MACHINE_RTC ,"Enable MC146818 RTC" ); -object_class_property_add (oc,MICROVM_MACHINE_PCIE ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_PCIE ,"OnOffAuto" ,NULL , microvm_machine_get_pcie, microvm_machine_set_pcie,NULL ,NULL );object_class_property_set_description (oc,MICROVM_MACHINE_PCIE ,"Enable PCIe" ); -object_class_property_add (oc,MICROVM_MACHINE_IOAPIC2 ,"OnOffAuto" , +object_class_property_add (oc,MICROVM_MACHINE_IOAPIC2 ,"OnOffAuto" ,NULL , microvm_machine_get_ioapic2, microvm_machine_set_ioapic2,NULL ,NULL );hw/i386/pc.c +15
-12@@ -1722,15 +1722,16 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="pc.ram" ; pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_AUTO ; -object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" , - pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" ,NULL , + pc_machine_get_max_ram_below_4g, + pc_machine_set_max_ram_below_4g, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"Maximum ram below the 4G boundary (32bit boundary)" ); -object_class_property_add (oc,PC_MACHINE_VMPORT ,"OnOffAuto" , - pc_machine_get_vmport, pc_machine_set_vmport, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_VMPORT ,"OnOffAuto" ,NULL , + pc_machine_get_vmport, pc_machine_set_vmport, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_VMPORT ,"Enable vmport (pc & q35)" );@@ -1758,15 +1759,17 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); -object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" , - pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" ,NULL , + pc_machine_get_max_fw_size, + pc_machine_set_max_fw_size, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_MAX_FW_SIZE ,"Maximum combined firmware size" ); -object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" , - pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, -NULL ,NULL ); +object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" ,NULL , + pc_machine_get_smbios_ep, + pc_machine_set_smbios_ep, +NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_SMBIOS_EP ,"SMBIOS Entry Point type [32, 64]" );hw/i386/sgx-epc.c +1
-1@@ -159,7 +159,7 @@ static void sgx_epc_class_init(ObjectClass *oc, const void *data) mdc->get_memory_region = sgx_epc_md_get_memory_region; mdc->fill_device_info = sgx_epc_md_fill_device_info; -object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" , +object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" ,NULL , sgx_epc_get_size,NULL ,NULL ,NULL );hw/i386/x86.c +12
-11@@ -391,26 +391,26 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) mc->kvm_type = x86_kvm_type; nc->raise_nmi = x86_nmi; -object_class_property_add (oc,X86_MACHINE_SMM ,"OnOffAuto" , - x86_machine_get_smm, x86_machine_set_smm, -NULL ,NULL ); +object_class_property_add (oc,X86_MACHINE_SMM ,"OnOffAuto" ,NULL , + x86_machine_get_smm, x86_machine_set_smm, +NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_SMM ,"Enable SMM" ); -object_class_property_add (oc,X86_MACHINE_ACPI ,"OnOffAuto" , - x86_machine_get_acpi, x86_machine_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,X86_MACHINE_ACPI ,"OnOffAuto" ,NULL , + x86_machine_get_acpi, x86_machine_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_ACPI ,"Enable ACPI" ); -object_class_property_add (oc,X86_MACHINE_PIT ,"OnOffAuto" , +object_class_property_add (oc,X86_MACHINE_PIT ,"OnOffAuto" ,NULL , x86_machine_get_pit, x86_machine_set_pit,NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_PIT ,"Enable i8254 PIT" ); -object_class_property_add (oc,X86_MACHINE_PIC ,"OnOffAuto" , +object_class_property_add (oc,X86_MACHINE_PIC ,"OnOffAuto" ,NULL , x86_machine_get_pic, x86_machine_set_pic,NULL ,NULL );@@ -435,14 +435,15 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) "The string may be up to 8 bytes in size");object_class_property_add (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"uint64_t" , +NULL , x86_machine_get_bus_lock_ratelimit, x86_machine_set_bus_lock_ratelimit,NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"Set the ratelimit for the bus locks acquired in VMs" ); -object_class_property_add (oc,"sgx-epc" ,"SgxEPC" , - machine_get_sgx_epc, machine_set_sgx_epc, -NULL ,NULL ); +object_class_property_add (oc,"sgx-epc" ,"SgxEPC" ,NULL , + machine_get_sgx_epc, machine_set_sgx_epc, +NULL ,NULL );object_class_property_set_description (oc,"sgx-epc" ,"SGX EPC device" ); }hw/ide/ide-dev.c +1
-1@@ -174,7 +174,7 @@ out:static void ide_dev_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , ide_dev_get_bootindex, ide_dev_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );hw/intc/apic_common.c +1
-1@@ -442,7 +442,7 @@ static void apic_common_initfn(Object *obj)APICCommonState *s =APIC_COMMON (obj); s->id = s->initial_apic_id =-1 ; -object_property_add (obj,"id" ,"uint32" , +object_property_add (obj,"id" ,"uint32" ,NULL , apic_common_get_id, apic_common_set_id,NULL ,NULL ); }hw/loongarch/virt.c +9
-9@@ -1483,18 +1483,18 @@ static void virt_class_init(ObjectClass *oc, const void *data) hc->unplug_request = virt_device_unplug_request; hc->unplug = virt_device_unplug; -object_class_property_add (oc,"acpi" ,"OnOffAuto" , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , + virt_get_acpi, virt_set_acpi, +NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"v-eiointc" ,"OnOffAuto" , - virt_get_veiointc, virt_set_veiointc, -NULL ,NULL ); +object_class_property_add (oc,"v-eiointc" ,"OnOffAuto" ,NULL , + virt_get_veiointc, virt_set_veiointc, +NULL ,NULL );object_class_property_set_description (oc,"v-eiointc" ,"Enable Virt Extend I/O Interrupt Controller." ); -object_class_property_add (oc,"dmsi" ,"OnOffAuto" , - virt_get_dmsi, virt_set_dmsi,NULL ,NULL ); +object_class_property_add (oc,"dmsi" ,"OnOffAuto" ,NULL , + virt_get_dmsi, virt_set_dmsi,NULL ,NULL );object_class_property_set_description (oc,"dmsi" ,"Enable direct Message-interrupts Controller." );machine_class_allow_dynamic_sysbus_dev (mc,TYPE_RAMFB_DEVICE );@@ -1525,7 +1525,7 @@ static void virt_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"highmem-mmio" ,"Set on/off to enable/disable high " "memory region for PCI MMIO" ); -object_class_property_add (oc,"highmem-mmio-size" ,"size" , +object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , virt_get_highmem_mmio_size, virt_set_highmem_mmio_size,NULL ,NULL );hw/mem/nvdimm.c +3
-2@@ -99,11 +99,12 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,static void nvdimm_init (Object *obj) { -object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" , +object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" ,NULL , nvdimm_get_label_size, nvdimm_set_label_size,NULL ,NULL ); -object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" , nvdimm_get_uuid, +object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" ,NULL , + nvdimm_get_uuid, nvdimm_set_uuid,NULL ,NULL ); }hw/mem/pc-dimm.c +2
-1@@ -176,7 +176,8 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name,static void pc_dimm_init (Object *obj) { -object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" , pc_dimm_get_size, +object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" ,NULL , + pc_dimm_get_size,NULL ,NULL ,NULL ); }hw/misc/aspeed_lpc.c +24
-12@@ -417,29 +417,41 @@ static void aspeed_lpc_realize(DeviceState *dev, Error **errp)static void aspeed_lpc_init (Object *obj) { -object_property_add (obj,"idr1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str1" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str1" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str2" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str2" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str3" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str3" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"idr4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"odr4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str4" ,"uint32" , aspeed_kcs_get_register_property, +object_property_add (obj,"str4" ,"uint32" ,NULL , + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); }hw/misc/aspeed_sdmc.c +1
-1@@ -259,7 +259,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visitor *v, const char *name,static void aspeed_sdmc_initfn (Object *obj) { -object_property_add (obj,"ram-size" ,"int" , +object_property_add (obj,"ram-size" ,"int" ,NULL , aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size,NULL ,NULL ); }hw/misc/npcm7xx_mft.c +1
-1@@ -491,7 +491,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =qdev_init_clock_out (dev,"clock2" );for (int i =0 ; i <NPCM7XX_PWM_PER_MODULE ; ++i) { -object_property_add (obj,"max_rpm[*]" ,"uint32" , +object_property_add (obj,"max_rpm[*]" ,"uint32" ,NULL , npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm,NULL , &s->max_rpm[i]);hw/net/ne2000-isa.c +1
-1@@ -131,7 +131,7 @@ out:static void isa_ne2000_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , isa_ne2000_get_bootindex, isa_ne2000_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );hw/nvme/ctrl.c +1
-1@@ -10612,7 +10612,7 @@ static void nvme_instance_init(Object *obj)"bootindex" ,"/namespace@1,0" , DEVICE(obj)); -object_property_add (obj,"smart_critical_warning" ,"uint8" , +object_property_add (obj,"smart_critical_warning" ,"uint8" ,NULL , nvme_get_smart_warning, nvme_set_smart_warning,NULL ,NULL ); }hw/pci-bridge/pci_expander_bridge.c +1
-1@@ -103,7 +103,7 @@ static void pxb_bus_class_init(ObjectClass *class, const void *data) pbc->bus_num = pxb_bus_num; pbc->numa_node = pxb_bus_numa_node; -object_class_property_add (class,"acpi_uid" ,"uint32" , +object_class_property_add (class,"acpi_uid" ,"uint32" ,NULL , prop_pxb_uid_get,NULL ,NULL ,NULL );object_class_property_set_description (class,"acpi_uid" ,"ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI00016" );hw/pci-host/i440fx.c +4
-0@@ -388,18 +388,22 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, const void *data) dc->user_creatable = false;object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , +NULL , i440fx_pcihost_get_pci_hole_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , +NULL , i440fx_pcihost_get_pci_hole_end,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , +NULL , i440fx_pcihost_get_pci_hole64_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , +NULL , i440fx_pcihost_get_pci_hole64_end,NULL ,NULL ,NULL ); }hw/pci-host/pnv_phb3.c +2
-2@@ -1164,12 +1164,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" , +object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" , +object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL );hw/pci-host/pnv_phb4.c +2
-2@@ -1761,12 +1761,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" , +object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" , +object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL );hw/pci-host/q35.c +4
-4@@ -226,19 +226,19 @@ static void q35_host_initfn(Object *obj)qdev_prop_set_uint64 (DEVICE (s),PCI_HOST_PROP_PCI_HOLE64_SIZE ,Q35_PCI_HOST_HOLE64_SIZE_DEFAULT ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" ,NULL , q35_host_get_pci_hole_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" ,NULL , q35_host_get_pci_hole_end,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" ,NULL , q35_host_get_pci_hole64_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" ,NULL , q35_host_get_pci_hole64_end,NULL ,NULL ,NULL );hw/ppc/spapr_caps.c +1
-1@@ -1069,7 +1069,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name = g_strdup_printf("cap-%s", cap->name); g_autofree char *desc = g_strdup(cap->description); -object_class_property_add (klass, name, cap->type, +object_class_property_add (klass, name, cap->type,NULL , cap->get, cap->set,NULL , cap);hw/ppc/spapr_drc.c +2
-2@@ -584,9 +584,9 @@ static void spapr_dr_connector_instance_init(Object *obj)SpaprDrcClass *drck =SPAPR_DR_CONNECTOR_GET_CLASS (drc);object_property_add_uint32_ptr (obj,"id" , &drc->id,OBJ_PROP_FLAG_READ ); -object_property_add (obj,"index" ,"uint32" , prop_get_index, +object_property_add (obj,"index" ,"uint32" ,NULL , prop_get_index,NULL ,NULL ,NULL ); -object_property_add (obj,"fdt" ,"struct" , prop_get_fdt, +object_property_add (obj,"fdt" ,"struct" ,NULL , prop_get_fdt,NULL ,NULL ,NULL ); drc->state = drck->empty_state; }hw/remote/vfio-user-obj.c +1
-1@@ -931,7 +931,7 @@ static void vfu_object_class_init(ObjectClass *klass, const void *data) k->nr_devs =0 ; -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL , +object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , vfu_object_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" , "SocketAddress "hw/riscv/microchip_pfsoc.c +1
-0@@ -744,6 +744,7 @@ static void microchip_icicle_kit_machine_class_init(ObjectClass *oc, mc->default_ram_size =1537 * MiB;object_class_property_add (oc,"clint-timebase-frequency" ,"uint32_t" , +NULL , microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq,NULL ,NULL );hw/riscv/virt.c +2
-2@@ -1184,13 +1184,13 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"aia-guests" , str); } -object_class_property_add (oc,"acpi" ,"OnOffAuto" , +object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , virt_get_acpi, virt_set_acpi,NULL ,NULL );object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"iommu-sys" ,"OnOffAuto" , +object_class_property_add (oc,"iommu-sys" ,"OnOffAuto" ,NULL , virt_get_iommu_sys, virt_set_iommu_sys,NULL ,NULL ); object_class_property_set_description(oc, "iommu-sys",hw/s390x/s390-virtio-ccw.c +2
-2@@ -908,7 +908,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dea-key-wrap" ,"enable/disable DEA key wrapping using the CPACF wrapping key" ); -object_class_property_add (oc,"loadparm" ,"loadparm" , +object_class_property_add (oc,"loadparm" ,"loadparm" ,NULL , machine_get_loadparm, machine_set_loadparm,NULL ,NULL ); object_class_property_set_description(oc, "loadparm",@@ -916,7 +916,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)" to upper case) to pass to machine loader, boot manager," " and guest kernel"); -object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" , +object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" ,NULL , machine_get_boot_certs, machine_set_boot_certs,NULL ,NULL );object_class_property_set_description (oc,"boot-certs" ,"provide paths to a directory and/or a certificate file for secure boot" );hw/s390x/sclpcpi.c +4
-2@@ -195,12 +195,14 @@ static void cpi_class_init(ObjectClass *klass, const void *data)"name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); -object_class_property_add (klass,"system_level" ,"uint64" , get_system_level, +object_class_property_add (klass,"system_level" ,"uint64" ,NULL , + get_system_level,NULL ,NULL ,NULL );object_class_property_set_description (klass,"system_level" ,"distribution and kernel version in Linux e.g. 74872343805430528" ); -object_class_property_add (klass,"timestamp" ,"uint64" , get_timestamp, +object_class_property_add (klass,"timestamp" ,"uint64" ,NULL , + get_timestamp,NULL ,NULL ,NULL );object_class_property_set_description (klass,"timestamp" ,"latest update of CPI data in nanoseconds since the UNIX EPOCH" );hw/s390x/virtio-ccw-mem.c +1
-1@@ -205,7 +205,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size,NULL ,NULL ); }hw/sensor/adc128d818.c +5
-3@@ -642,14 +642,16 @@ static void adc128d818_initfn(Object *obj)for (unsigned ch =0u ; ch <ADC128D818_NUM_CHANNELS ; ch++) {char *name =g_strdup_printf ("ain%u" , ch); -object_property_add (obj, name,"int" , adc128d818_get_ain, +object_property_add (obj, name,"int" ,NULL , adc128d818_get_ain, adc128d818_set_ain,NULL ,NULL );g_free (name); } -object_property_add (obj,"temperature" ,"int" , adc128d818_get_temperature, +object_property_add (obj,"temperature" ,"int" ,NULL , + adc128d818_get_temperature, adc128d818_set_temperature,NULL ,NULL ); -object_property_add (obj,"ext-vref-mv" ,"int" , adc128d818_get_ext_vref, +object_property_add (obj,"ext-vref-mv" ,"int" ,NULL , + adc128d818_get_ext_vref, adc128d818_set_ext_vref,NULL ,NULL ); }hw/sensor/adm1266.c +1
-1@@ -217,7 +217,7 @@ static void adm1266_init(Object *obj)for (int i =0 ; i <ADM1266_NUM_PAGES ; i++) {pmbus_page_config (pmdev, i, flags); -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , adm1266_get, adm1266_set,NULL , &pmdev->pages[i].read_vout); }hw/sensor/adm1272.c +4
-4@@ -493,19 +493,19 @@ static void adm1272_init(Object *obj)pmbus_page_config (pmdev,0 , flags); -object_property_add (obj,"vin" ,"uint16" , +object_property_add (obj,"vin" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vin); -object_property_add (obj,"vout" ,"uint16" , +object_property_add (obj,"vout" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vout); -object_property_add (obj,"iout" ,"uint16" , +object_property_add (obj,"iout" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_iout); -object_property_add (obj,"pin" ,"uint16" , +object_property_add (obj,"pin" ,"uint16" ,NULL , adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_pin);hw/sensor/emc141x.c +4
-4@@ -251,16 +251,16 @@ static void emc141x_reset(DeviceState *dev)static void emc141x_initfn (Object *obj) { -object_property_add (obj,"temperature0" ,"int" , +object_property_add (obj,"temperature0" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature1" ,"int" , +object_property_add (obj,"temperature1" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature2" ,"int" , +object_property_add (obj,"temperature2" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature3" ,"int" , +object_property_add (obj,"temperature3" ,"int" ,NULL , emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); }hw/sensor/isl_pmbus_vr.c +9
-9@@ -136,63 +136,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)PMBusDevice *pmdev =PMBUS_DEVICE (obj);for (int i =0 ; i < pages; i++) {if (flags[i] &PB_HAS_VIN ) { -object_property_add (obj,"vin[*]" ,"uint16" , +object_property_add (obj,"vin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vin); }if (flags[i] &PB_HAS_VOUT ) { -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vout); }if (flags[i] &PB_HAS_IIN ) { -object_property_add (obj,"iin[*]" ,"uint16" , +object_property_add (obj,"iin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iin); }if (flags[i] &PB_HAS_IOUT ) { -object_property_add (obj,"iout[*]" ,"uint16" , +object_property_add (obj,"iout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iout); }if (flags[i] &PB_HAS_PIN ) { -object_property_add (obj,"pin[*]" ,"uint16" , +object_property_add (obj,"pin[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pin); }if (flags[i] &PB_HAS_POUT ) { -object_property_add (obj,"pout[*]" ,"uint16" , +object_property_add (obj,"pout[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pout); }if (flags[i] &PB_HAS_TEMPERATURE ) { -object_property_add (obj,"temp1[*]" ,"uint16" , +object_property_add (obj,"temp1[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_1); }if (flags[i] &PB_HAS_TEMP2 ) { -object_property_add (obj,"temp2[*]" ,"uint16" , +object_property_add (obj,"temp2[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_2); }if (flags[i] &PB_HAS_TEMP3 ) { -object_property_add (obj,"temp3[*]" ,"uint16" , +object_property_add (obj,"temp3[*]" ,"uint16" ,NULL , isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_3);hw/sensor/lsm303dlhc_mag.c +12
-12@@ -509,21 +509,21 @@ static void lsm303dlhc_mag_reset(DeviceState *dev)*/ static void lsm303dlhc_mag_initfn (Object *obj) { -object_property_add (obj,"mag-x" ,"int" , - lsm303dlhc_mag_get_x, - lsm303dlhc_mag_set_x,NULL ,NULL ); +object_property_add (obj,"mag-x" ,"int" ,NULL , + lsm303dlhc_mag_get_x, + lsm303dlhc_mag_set_x,NULL ,NULL ); -object_property_add (obj,"mag-y" ,"int" , - lsm303dlhc_mag_get_y, - lsm303dlhc_mag_set_y,NULL ,NULL ); +object_property_add (obj,"mag-y" ,"int" ,NULL , + lsm303dlhc_mag_get_y, + lsm303dlhc_mag_set_y,NULL ,NULL ); -object_property_add (obj,"mag-z" ,"int" , - lsm303dlhc_mag_get_z, - lsm303dlhc_mag_set_z,NULL ,NULL ); +object_property_add (obj,"mag-z" ,"int" ,NULL , + lsm303dlhc_mag_get_z, + lsm303dlhc_mag_set_z,NULL ,NULL ); -object_property_add (obj,"temperature" ,"int" , - lsm303dlhc_mag_get_temperature, - lsm303dlhc_mag_set_temperature,NULL ,NULL ); +object_property_add (obj,"temperature" ,"int" ,NULL , + lsm303dlhc_mag_get_temperature, + lsm303dlhc_mag_set_temperature,NULL ,NULL ); }/* hw/sensor/max34451.c +2
-2@@ -727,7 +727,7 @@ static void max34451_init(Object *obj)/* get and set the voltage in millivolts, max is 32767 mV */ for (int i =0 ; i <MAX34451_NUM_PWR_DEVICES ; i++) { -object_property_add (obj,"vout[*]" ,"uint16" , +object_property_add (obj,"vout[*]" ,"uint16" ,NULL , max34451_get, max34451_set,NULL , &pmdev->pages[i].read_vout); }@@ -737,7 +737,7 @@ static void max34451_init(Object *obj)* centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =0 ; i <MAX34451_NUM_TEMP_DEVICES ; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add(obj, "temperature[*]", "uint16", NULL, max34451_get, max34451_set, NULL,hw/sensor/tmp105.c +1
-1@@ -408,7 +408,7 @@ static void tmp105_realize(DeviceState *dev, Error **errp)static void tmp105_initfn (Object *obj) { -object_property_add (obj,"temperature" ,"int" , +object_property_add (obj,"temperature" ,"int" ,NULL , tmp105_get_temperature, tmp105_set_temperature,NULL ,NULL ); object_property_set_description(obj, "temperature",hw/sensor/tmp421.c +4
-4@@ -350,16 +350,16 @@ static void tmp421_class_init(ObjectClass *klass, const void *data) dc->vmsd = &vmstate_tmp421; sc->dev = (DeviceInfo *) data; -object_class_property_add (klass,"temperature0" ,"int" , +object_class_property_add (klass,"temperature0" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature1" ,"int" , +object_class_property_add (klass,"temperature1" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature2" ,"int" , +object_class_property_add (klass,"temperature2" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature3" ,"int" , +object_class_property_add (klass,"temperature3" ,"int" ,NULL , tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); }hw/usb/dev-storage-classic.c +1
-1@@ -122,7 +122,7 @@ out:static void usb_msd_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" , +object_property_add (obj,"bootindex" ,"int32" ,NULL , usb_msd_get_bootindex, usb_msd_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );hw/vfio-user/pci.c +1
-1@@ -471,7 +471,7 @@ static void vfio_user_pci_class_init(ObjectClass *klass, const void *data)device_class_set_legacy_reset (dc, vfio_user_pci_reset);device_class_set_props (dc, vfio_user_pci_properties); -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL , +object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , vfio_user_pci_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" ,"SocketAddress (UNIX sockets only)" );hw/virtio/virtio-balloon.c +2
-2@@ -1036,10 +1036,10 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN ; s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify; -object_property_add (obj,"guest-stats" ,"guest statistics" , +object_property_add (obj,"guest-stats" ,"guest statistics" ,NULL , balloon_stats_get_all,NULL ,NULL ,NULL ); -object_property_add (obj,"guest-stats-polling-interval" ,"int" , +object_property_add (obj,"guest-stats-polling-interval" ,"int" ,NULL , balloon_stats_get_poll_interval, balloon_stats_set_poll_interval,NULL ,NULL );hw/virtio/virtio-mem-pci.c +1
-1@@ -211,7 +211,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size,NULL ,NULL ); }hw/virtio/virtio-mem.c +4
-3@@ -1533,12 +1533,13 @@ static void virtio_mem_instance_init(Object *obj)notifier_list_init (&vmem->size_change_notifiers); -object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" , virtio_mem_get_size, +object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" ,NULL , + virtio_mem_get_size,NULL ,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , virtio_mem_get_requested_size, virtio_mem_set_requested_size,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" , +object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" ,NULL , virtio_mem_get_block_size, virtio_mem_set_block_size,NULL ,NULL ); }hw/xen/xen-pvh-common.c +4
-4@@ -413,7 +413,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)#define OC_MEMMAP_PROP_BASE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add(c, prop_name "-base", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \@@ -422,7 +422,7 @@ do { \#define OC_MEMMAP_PROP_SIZE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \@@ -458,7 +458,7 @@ do { \OC_MEMMAP_PROP (oc,"pci-mmio" , pci_mmio);OC_MEMMAP_PROP (oc,"pci-mmio-high" , pci_mmio_high); -object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" , +object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" ,NULL , xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base,NULL ,NULL );@@ -468,7 +468,7 @@ do { \#ifdef CONFIG_TPM if (xpc->has_tpm) { -object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" , +object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" ,NULL , xen_pvh_get_tpm_base, xen_pvh_set_tpm_base,NULL ,NULL );include/qom/object.h +1
-0@@ -1163,6 +1163,7 @@ void object_unref(void *obj);* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL,
include/qom/object.h void object_unref(void *obj); · line 1192
Quoted 4 lines
include/qom/object.h +1
-0@@ -1188,6 +1189,7 @@ void object_unref(void *obj);*/ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type,
should be const QAPITypeInfo *
Quoted 118 lines
include/qom/object.h +3
-0ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1203,6 +1205,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL, @@ -1220,6 +1223,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,*/ ObjectProperty *object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1237,6 +1241,7 @@ void object_property_del(Object *obj, const char *name); ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,iothread.c +4
-4@@ -315,19 +315,19 @@ static void iothread_class_init(ObjectClass *klass, const void *class_data) bc->init = iothread_init; bc->update_params = iothread_set_aio_context_params; -object_class_property_add (klass,"poll-max-ns" ,"int64" , +object_class_property_add (klass,"poll-max-ns" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_max_ns_info); -object_class_property_add (klass,"poll-grow" ,"int64" , +object_class_property_add (klass,"poll-grow" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_grow_info); -object_class_property_add (klass,"poll-shrink" ,"int64" , +object_class_property_add (klass,"poll-shrink" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_shrink_info); -object_class_property_add (klass,"poll-weight" ,"int64" , +object_class_property_add (klass,"poll-weight" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_weight_info);net/colo-compare.c +3
-3@@ -1373,15 +1373,15 @@ static void colo_compare_init(Object *obj)object_property_add_str (obj,"notify_dev" , compare_get_notify_dev, compare_set_notify_dev); -object_property_add (obj,"compare_timeout" ,"uint64" , +object_property_add (obj,"compare_timeout" ,"uint64" ,NULL , compare_get_timeout, compare_set_timeout,NULL ,NULL ); -object_property_add (obj,"expired_scan_cycle" ,"uint32" , +object_property_add (obj,"expired_scan_cycle" ,"uint32" ,NULL , compare_get_expired_scan_cycle, compare_set_expired_scan_cycle,NULL ,NULL ); -object_property_add (obj,"max_queue_size" ,"uint32" , +object_property_add (obj,"max_queue_size" ,"uint32" ,NULL , get_max_queue_size, set_max_queue_size,NULL ,NULL );net/dump.c +2
-1@@ -238,7 +238,8 @@ static void filter_dump_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"maxlen" ,"uint32" , filter_dump_get_maxlen, +object_class_property_add (oc,"maxlen" ,"uint32" ,NULL , + filter_dump_get_maxlen, filter_dump_set_maxlen,NULL ,NULL );object_class_property_add_str (oc,"file" , file_dump_get_filename, file_dump_set_filename);net/filter-buffer.c +1
-1@@ -182,7 +182,7 @@ static void filter_buffer_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"interval" ,"uint32" , +object_class_property_add (oc,"interval" ,"uint32" ,NULL , filter_buffer_get_interval, filter_buffer_set_interval,NULL ,NULL );qom/object.c +1
-0@@ -1340,6 +1340,7 @@ void object_unref(void *objptr)ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
qom/object.c object_property_try_add(Object *obj, const char *name, const char *type, · line 1361
Quoted 6 lines
qom/object.c +1
-2@@ -1357,8 +1358,8 @@ object_property_try_add(Object *obj, const char *name, const char *type,for (i =0 ; i <INT16_MAX ; ++i) {char *full_name =g_strdup_printf ("%s[%d]" , name_no_array, i); - ret =object_property_try_add (obj, full_name, type, get, set, - release, opaque,NULL ); + ret = object_property_try_add(obj, full_name, type, NULL,
Propagate @qapi_type to the generated name[i] properties.
Quoted 14 lines
qom/object.c +2
-0+ get, set, release, opaque, NULL);g_free (full_name);if (ret) {break ;@@ -1379,6 +1380,7 @@ object_property_try_add(Object *obj, const char *name, const char *type, prop->name =g_strdup (name); prop->type =g_strdup (type); + prop->qapi_type = qapi_type; prop->get = get; prop->set = set;@@ -1393,12 +1395,13 @@ object_property_try_add(Object *obj, const char *name, const char *type,
qom/object.c object_property_try_add(Object *obj, const char *name, const char *type, · line 1404
Quoted 10 lines
qom/object.c +2
-1ObjectProperty *object_property_add (Object *obj,const char *name,const char *type, +const QAPITypeInfo *qapi_type,ObjectPropertyAccessor *get,ObjectPropertyAccessor *set,ObjectPropertyRelease *release,void *opaque) { - return object_property_try_add(obj, name, type, get, set, release, + return object_property_try_add(obj, name, type, NULL, get, set, release,
This should pass @qapi_type also
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH v8 14/56] qom: New object_property_add() etc. parameter @qapi_type
Quoted 15 lines · [email protected] writes:
Quoted 15 lines
This permits setting ObjectProperty's optional @qapi_type. For now, all callers pass null. Callers updated with this Coccinelle script:
@@
identifier fun = {
object_property_try_add,object_property_add,object_class_property_add
};
expression obj, name, type;
@@(quoted diff) +1
-1- fun(obj, name, type, + fun(obj, name, type, NULL, ...)Signed-off-by Markus Armbruster <[email protected]>Message-ID: <[email protected]>
[...]
Quoted 11 lines
Quoted 11 lines
include/qom/object.h +1
-0@@ -1163,6 +1163,7 @@ void object_unref(void *obj);* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read.
Quoted 8 lines
include/qom/object.h void object_unref(void *obj); · line 1192
Quoted 6 lines
include/qom/object.h +1
-0* @set: the setter to be called to write a property. If this is NULL, @@ -1188,6 +1189,7 @@ void object_unref(void *obj);*/ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type,should be const QAPITypeInfo *
Yes. Not caught by the compiler, because there are just three calls, and I messed up the two of them that should pass something, as you noted below. Not caught by my testing probably because pretty much nothing uses them.
Quoted 121 lines
Quoted 121 lines
include/qom/object.h +3
-0ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1203,6 +1205,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,* defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link<virtio-net-pci>'. +* @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL, @@ -1220,6 +1223,7 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,*/ ObjectProperty *object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1237,6 +1241,7 @@ void object_property_del(Object *obj, const char *name); ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,iothread.c +4
-4@@ -315,19 +315,19 @@ static void iothread_class_init(ObjectClass *klass, const void *class_data) bc->init = iothread_init; bc->update_params = iothread_set_aio_context_params; -object_class_property_add (klass,"poll-max-ns" ,"int64" , +object_class_property_add (klass,"poll-max-ns" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_max_ns_info); -object_class_property_add (klass,"poll-grow" ,"int64" , +object_class_property_add (klass,"poll-grow" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_grow_info); -object_class_property_add (klass,"poll-shrink" ,"int64" , +object_class_property_add (klass,"poll-shrink" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_shrink_info); -object_class_property_add (klass,"poll-weight" ,"int64" , +object_class_property_add (klass,"poll-weight" ,"int64" ,NULL , iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_weight_info);net/colo-compare.c +3
-3@@ -1373,15 +1373,15 @@ static void colo_compare_init(Object *obj)object_property_add_str (obj,"notify_dev" , compare_get_notify_dev, compare_set_notify_dev); -object_property_add (obj,"compare_timeout" ,"uint64" , +object_property_add (obj,"compare_timeout" ,"uint64" ,NULL , compare_get_timeout, compare_set_timeout,NULL ,NULL ); -object_property_add (obj,"expired_scan_cycle" ,"uint32" , +object_property_add (obj,"expired_scan_cycle" ,"uint32" ,NULL , compare_get_expired_scan_cycle, compare_set_expired_scan_cycle,NULL ,NULL ); -object_property_add (obj,"max_queue_size" ,"uint32" , +object_property_add (obj,"max_queue_size" ,"uint32" ,NULL , get_max_queue_size, set_max_queue_size,NULL ,NULL );net/dump.c +2
-1@@ -238,7 +238,8 @@ static void filter_dump_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"maxlen" ,"uint32" , filter_dump_get_maxlen, +object_class_property_add (oc,"maxlen" ,"uint32" ,NULL , + filter_dump_get_maxlen, filter_dump_set_maxlen,NULL ,NULL );object_class_property_add_str (oc,"file" , file_dump_get_filename, file_dump_set_filename);net/filter-buffer.c +1
-1@@ -182,7 +182,7 @@ static void filter_buffer_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"interval" ,"uint32" , +object_class_property_add (oc,"interval" ,"uint32" ,NULL , filter_buffer_get_interval, filter_buffer_set_interval,NULL ,NULL );qom/object.c +1
-0@@ -1340,6 +1340,7 @@ void object_unref(void *objptr)ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1357,8 +1358,8 @@ object_property_try_add(Object *obj, const char *name, const char *type,for (i =0 ; i <INT16_MAX ; ++i) {char *full_name =g_strdup_printf ("%s[%d]" , name_no_array, i);
Quoted 5 lines
qom/object.c object_property_try_add(Object *obj, const char *name, const char *type, · line 1361
Quoted 3 lines
qom/object.c +1
-2- ret =object_property_try_add (obj, full_name, type, get, set, - release, opaque,NULL ); + ret = object_property_try_add(obj, full_name, type, NULL,Propagate @qapi_type to the generated name[i] properties.
Yes, this is #1, and ...
Quoted 14 lines
Quoted 14 lines
qom/object.c +2
-0+ get, set, release, opaque, NULL);g_free (full_name);if (ret) {break ;@@ -1379,6 +1380,7 @@ object_property_try_add(Object *obj, const char *name, const char *type, prop->name =g_strdup (name); prop->type =g_strdup (type); + prop->qapi_type = qapi_type; prop->get = get; prop->set = set;@@ -1393,12 +1395,13 @@ object_property_try_add(Object *obj, const char *name, const char *type,
Quoted 12 lines
qom/object.c object_property_try_add(Object *obj, const char *name, const char *type, · line 1404
Quoted 10 lines
qom/object.c +2
-1ObjectProperty *object_property_add (Object *obj,const char *name,const char *type, +const QAPITypeInfo *qapi_type,ObjectPropertyAccessor *get,ObjectPropertyAccessor *set,ObjectPropertyRelease *release,void *opaque) { - return object_property_try_add(obj, name, type, get, set, release, + return object_property_try_add(obj, name, type, NULL, get, set, release,This should pass @qapi_type also
... this is #2.
Thanks!
Re: [PATCH v8 14/56] qom: New object_property_add() etc. parameter @qapi_type
Marc-André, may I have your R-by with the appended fixup?
include/qom/object.h +1 -1
@@ -1189,7 +1189,7 @@ void object_unref(void *obj);*/ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, - QAPITypeInfo *qapi_type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
qom/object.c +4 -4
@@ -1340,7 +1340,7 @@ void object_unref(void *objptr)ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, - QAPITypeInfo *qapi_type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,
@@ -1358,7 +1358,7 @@ object_property_try_add(Object *obj, const char *name, const char *type,for (i =0 ; i <INT16_MAX ; ++i) {char *full_name =g_strdup_printf ("%s[%d]" , name_no_array, i); - ret =object_property_try_add (obj, full_name, type,NULL , + ret =object_property_try_add (obj, full_name, type, qapi_type, get, set, release, opaque,NULL );g_free (full_name);if (ret) {
@@ -1401,8 +1401,8 @@ object_property_add(Object *obj, const char *name, const char *type, ObjectPropertyRelease *release, void *opaque) { -return object_property_try_add (obj, name, type,NULL , get, set, release, - opaque, &error_abort); +return object_property_try_add (obj, name, type, qapi_type, + get, set, release, opaque, &error_abort); } ObjectProperty *
Marc-André Lureau
Reviewed-byRe: [PATCH v8 14/56] qom: New object_property_add() etc. parameter @qapi_type
Quoted 39 lines · Markus Armbruster
Marc-André, may I have your R-by with the appended fixup?
include/qom/object.h +1
-1@@ -1189,7 +1189,7 @@ void object_unref(void *obj);*/ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, - QAPITypeInfo *qapi_type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,qom/object.c +2
-2@@ -1340,7 +1340,7 @@ void object_unref(void *objptr)ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, - QAPITypeInfo *qapi_type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release,@@ -1358,7 +1358,7 @@ object_property_try_add(Object *obj, const char *name, const char *type,for (i =0 ; i <INT16_MAX ; ++i) {char *full_name =g_strdup_printf ("%s[%d]" , name_no_array, i); - ret =object_property_try_add (obj, full_name, type,NULL , + ret =object_property_try_add (obj, full_name, type, qapi_type, get, set, release, opaque,NULL );g_free (full_name);if (ret) {
qom/object.c object_property_add(Object *obj, const char *name, const char *type, · line 1408
Quoted 10 lines
qom/object.c +2
-2@@ -1401,8 +1401,8 @@ object_property_add(Object *obj, const char *name, const char *type, ObjectPropertyRelease *release, void *opaque) { -return object_property_try_add (obj, name, type,NULL , get, set, release, - opaque, &error_abort); +return object_property_try_add (obj, name, type, qapi_type, + get, set, release, opaque, &error_abort); } ObjectProperty *
PATCH v8 15/56 qom/object: Move enum property code so it is together
In reply to Markus Armbruster--- qom/object.c | 76 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-)
qom/object.c +38 -38
@@ -1770,44 +1770,6 @@ uint64_t object_property_get_uint(Object *obj, const char *name,return retval; } -typedef struct EnumProperty { -const QEnumLookup *lookup; -int (*get)(Object *,Error **); -void (*set)(Object *,int ,Error **); -}EnumProperty ; - -int object_property_get_enum (Object *obj,const char *name, -const char *typename,Error **errp) -{ -char *str; -int ret; -ObjectProperty *prop =object_property_find_err (obj, name, errp); -EnumProperty *enumprop; - -if (prop ==NULL ) { -return -1 ; - } - -if (!g_str_equal (prop->type, typename)) { -error_setg (errp,"Property %s on %s is not '%s' enum type" , - name,object_class_get_name ( -object_get_class (obj)), typename); -return -1 ; - } - - enumprop = prop->opaque; - - str =object_property_get_str (obj, name, errp); -if (!str) { -return -1 ; - } - - ret =qapi_enum_parse (enumprop->lookup, str,-1 , errp); -g_free (str); - -return ret; -} -bool object_property_parse (Object *obj,const char *name,const char *string,Error **errp) {
@@ -2538,6 +2500,12 @@ object_class_property_add_bool(ObjectClass *klass, const char *name, prop); } +typedef struct EnumProperty { +const QEnumLookup *lookup; +int (*get)(Object *,Error **); +void (*set)(Object *,int ,Error **); +}EnumProperty ; +static void property_get_enum (Object *obj,Visitor *v,const char *name,void *opaque,Error **errp) {
@@ -2606,6 +2574,38 @@ object_class_property_add_enum(ObjectClass *klass, const char *name, prop); } +int object_property_get_enum (Object *obj,const char *name, +const char *typename,Error **errp) +{ +char *str; +int ret; +ObjectProperty *prop =object_property_find_err (obj, name, errp); +EnumProperty *enumprop; + +if (prop ==NULL ) { +return -1 ; + } + +if (!g_str_equal (prop->type, typename)) { +error_setg (errp,"Property %s on %s is not '%s' enum type" , + name,object_class_get_name ( +object_get_class (obj)), typename); +return -1 ; + } + + enumprop = prop->opaque; + + str =object_property_get_str (obj, name, errp); +if (!str) { +return -1 ; + } + + ret =qapi_enum_parse (enumprop->lookup, str,-1 , errp); +g_free (str); + +return ret; +} +typedef struct TMProperty {void (*get)(Object *,struct tm *,Error **); }TMProperty ;
Signature · 1 line
2.55.0
Re: [PATCH v8 15/56] qom/object: Move enum property code so it is together
Quoted 1 line · Markus Armbruster
Signature · 1 line
Marc-André Lureau <[email protected]>
PATCH v8 16/56 qom: New object_property_add_enum() etc. parameter @qapi_type
In reply to Markus ArmbrusterCallers may either pass a non-null @lookup, or a non-null @qapi_type. For now, all pass a non-null @lookup and a null @qapi_type. Callers updated with this Coccinelle script:
@@
identifier fun = {
object_property_add_enum, object_class_property_add_enum
};
expression obj, name, type;
@@
- fun(obj, name, type,
+ fun(obj, name, type, NULL,
...)
Future patches will eliminate non-null @lookup and drop the parameter.
--- include/chardev/char.h | 2 +- include/qom/object.h | 4 ++++ authz/list.c | 3 +-- backends/hostmem.c | 8 ++++---- crypto/secret_common.c | 3 +-- crypto/tlscreds.c | 4 ++-- hw/i386/pc_piix.c | 3 ++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + monitor/qmp.c | 2 +- net/filter.c | 2 +- qom/object.c | 15 +++++++++++---- target/i386/kvm/kvm.c | 3 ++- tests/unit/check-qom-proplist.c | 3 +-- ui/dbus.c | 4 ++-- ui/input-linux.c | 2 +- 15 files changed, 35 insertions(+), 24 deletions(-)
include/chardev/char.h +1 -1
@@ -356,7 +356,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectClass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NULL, &ChardevVCEncoding_lookup, get, set); }
include/qom/object.h +4 -0
@@ -1987,6 +1987,7 @@ ObjectProperty *object_class_property_add_bool(ObjectClass *klass,* @obj: the object to add a property to * @name: the name of the property * @typename: the name of the enum data type +* @qapi_type: QAPI type info descriptor * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only
@@ -1998,6 +1999,7 @@ ObjectProperty *object_class_property_add_bool(ObjectClass *klass,*/ ObjectProperty *object_property_add_enum (Object *obj,const char *name,const char *typename, +const QAPITypeInfo *qapi_type,const QEnumLookup *lookup,int (*get)(Object *,Error **),void (*set)(Object *,int ,Error **));
@@ -2007,6 +2009,7 @@ ObjectProperty *object_property_add_enum(Object *obj, const char *name,* @klass: the object class to add a property to * @name: the name of the property * @typename: the name of the enum data type +* @qapi_type: QAPI type info descriptor * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only
@@ -2019,6 +2022,7 @@ ObjectProperty *object_property_add_enum(Object *obj, const char *name,ObjectProperty *object_class_property_add_enum (ObjectClass *klass,const char *name,const char *typename, +const QAPITypeInfo *qapi_type,const QEnumLookup *lookup,int (*get)(Object *,Error **),void (*set)(Object *,int ,Error **));
authz/list.c +1 -2
@@ -120,8 +120,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *data) {QAuthZClass *authz =QAUTHZ_CLASS (oc); -object_class_property_add_enum (oc,"policy" , -"QAuthZListPolicy" , +object_class_property_add_enum (oc,"policy" ,"QAuthZListPolicy" ,NULL , &QAuthZListPolicy_lookup, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy);
backends/hostmem.c +4 -4
@@ -551,10 +551,10 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) NULL, NULL);object_class_property_set_description (oc,"host-nodes" ,"Binds memory to the list of NUMA host nodes" ); -object_class_property_add_enum (oc,"policy" ,"HostMemPolicy" , - &HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy); +object_class_property_add_enum (oc,"policy" ,"HostMemPolicy" ,NULL , + &HostMemPolicy_lookup, + host_memory_backend_get_policy, + host_memory_backend_set_policy);object_class_property_set_description (oc,"policy" ,"Set the NUMA policy" ); object_class_property_add_bool(oc, "share",
crypto/secret_common.c +1 -2
@@ -269,8 +269,7 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *data) ucc->complete = qcrypto_secret_complete; -object_class_property_add_enum (oc,"format" , -"QCryptoSecretFormat" , +object_class_property_add_enum (oc,"format" ,"QCryptoSecretFormat" ,NULL , &QCryptoSecretFormat_lookup, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format);
crypto/tlscreds.c +2 -2
@@ -221,8 +221,8 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const void *data)object_class_property_add_str (oc,"dir" , qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); -object_class_property_add_enum (oc,"endpoint" , -"QCryptoTLSCredsEndpoint" , +object_class_property_add_enum (oc,"endpoint" ,"QCryptoTLSCredsEndpoint" , +NULL , &QCryptoTLSCredsEndpoint_lookup, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint);
hw/i386/pc_piix.c +2 -1
@@ -413,7 +413,8 @@ static void pc_i440fx_machine_options(MachineClass *m)machine_class_allow_dynamic_sysbus_dev (m,TYPE_VMBUS_BRIDGE );machine_class_allow_dynamic_sysbus_dev (m,TYPE_UEFI_VARS_X64 ); -object_class_property_add_enum (oc,"x-south-bridge" ,"PCSouthBridgeOption" , +object_class_property_add_enum (oc,"x-south-bridge" , +"PCSouthBridgeOption" ,NULL , &PCSouthBridgeOption_lookup, pc_get_south_bridge, pc_set_south_bridge);
hw/microblaze/petalogix_s3adsp1800_mmu.c +1 -0
@@ -175,6 +175,7 @@ static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc, mc->is_default = true; prop =object_class_property_add_enum (oc,"endianness" ,"EndianMode" , +NULL , &EndianMode_lookup, machine_get_endianness, machine_set_endianness);
monitor/qmp.c +1 -1
@@ -134,7 +134,7 @@ static void monitor_qmp_class_init(ObjectClass *cls, const void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty);object_class_property_add_enum (cls,"close-action" , -"MonitorQMPCloseAction" , +"MonitorQMPCloseAction" ,NULL , &MonitorQMPCloseAction_lookup, monitor_qmp_get_close_action, monitor_qmp_set_close_action);
net/filter.c +1 -1
@@ -342,7 +342,7 @@ static void netfilter_class_init(ObjectClass *oc, const void *data)object_class_property_add_str (oc,"netdev" , netfilter_get_netdev_id, netfilter_set_netdev_id); -object_class_property_add_enum (oc,"queue" ,"NetFilterDirection" , +object_class_property_add_enum (oc,"queue" ,"NetFilterDirection" ,NULL , &NetFilterDirection_lookup, netfilter_get_direction, netfilter_set_direction); object_class_property_add_str(oc, "status",
qom/object.c +11 -4
@@ -2501,6 +2501,7 @@ object_class_property_add_bool(ObjectClass *klass, const char *name, } typedef struct EnumProperty { + const QAPITypeInfo *qapi_type; /* non-null for QAPI enums */ const QEnumLookup *lookup; int (*get)(Object *, Error **); void (*set)(Object *, int, Error **);
@@ -2537,17 +2538,20 @@ static void property_set_enum(Object *obj, Visitor *v, const char *name,ObjectProperty *object_property_add_enum (Object *obj,const char *name,const char *typename, +const QAPITypeInfo *qapi_type,const QEnumLookup *lookup,int (*get)(Object *,Error **),void (*set)(Object *,int ,Error **)) {EnumProperty *prop =g_malloc (sizeof (*prop)); - prop->lookup = lookup; +assert (!qapi_type != !lookup); + prop->qapi_type = qapi_type; + prop->lookup = lookup ?: qapi_type->lookup; prop->get = get; prop->set = set; - return object_property_add(obj, name, typename, NULL, + return object_property_add(obj, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_data,
@@ -2557,17 +2561,20 @@ object_property_add_enum(Object *obj, const char *name,ObjectProperty *object_class_property_add_enum (ObjectClass *klass,const char *name,const char *typename, +const QAPITypeInfo *qapi_type,const QEnumLookup *lookup,int (*get)(Object *,Error **),void (*set)(Object *,int ,Error **)) {EnumProperty *prop =g_malloc (sizeof (*prop)); - prop->lookup = lookup; +assert (!qapi_type != !lookup); + prop->qapi_type = qapi_type; + prop->lookup = lookup ?: qapi_type->lookup; prop->get = get; prop->set = set; - return object_class_property_add(klass, name, typename, NULL, + return object_class_property_add(klass, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, NULL,
target/i386/kvm/kvm.c +2 -1
@@ -7090,6 +7090,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj, int value, Error **errp)void kvm_arch_accel_class_init (ObjectClass *oc) {object_class_property_add_enum (oc,"notify-vmexit" ,"NotifyVMexitOption" , +NULL , &NotifyVmexitOption_lookup, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit);
@@ -7127,7 +7128,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc)object_class_property_set_description (oc,"xen-evtchn-max-pirq" ,"Maximum number of Xen PIRQs" ); -object_class_property_add_enum (oc,"honor-guest-pat" ,"OnOffAuto" , +object_class_property_add_enum (oc,"honor-guest-pat" ,"OnOffAuto" ,NULL , &OnOffAuto_lookup, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat);
tests/unit/check-qom-proplist.c +1 -2
@@ -140,8 +140,7 @@ static void dummy_class_init(ObjectClass *cls, const void *data)object_class_property_add_str (cls,"sv" , dummy_get_sv, dummy_set_sv); -object_class_property_add_enum (cls,"av" , -"DummyAnimal" , +object_class_property_add_enum (cls,"av" ,"DummyAnimal" ,NULL , &dummy_animal_map, dummy_get_av, dummy_set_av);
ui/dbus.c +2 -2
@@ -508,8 +508,8 @@ dbus_display_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"p2p" , get_dbus_p2p, set_dbus_p2p);object_class_property_add_str (oc,"addr" , get_dbus_addr, set_dbus_addr);object_class_property_add_str (oc,"audiodev" , get_audiodev, set_audiodev); -object_class_property_add_enum (oc,"gl-mode" , -"DisplayGLMode" , &DisplayGLMode_lookup, +object_class_property_add_enum (oc,"gl-mode" ,"DisplayGLMode" ,NULL , + &DisplayGLMode_lookup, get_gl_mode, set_gl_mode); }
ui/input-linux.c +1 -1
@@ -506,7 +506,7 @@ static void input_linux_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"repeat" , input_linux_get_repeat, input_linux_set_repeat); -object_class_property_add_enum (oc,"grab-toggle" ,"GrabToggleKeys" , +object_class_property_add_enum (oc,"grab-toggle" ,"GrabToggleKeys" ,NULL , &GrabToggleKeys_lookup, input_linux_get_grab_toggle, input_linux_set_grab_toggle);
Signature · 1 line
2.55.0
Re: [PATCH v8 16/56] qom: New object_property_add_enum() etc. parameter @qapi_type
Quoted 10 lines · Markus Armbruster
Callers may either pass a non-null @lookup, or a non-null @qapi_type. For now, all pass a non-null @lookup and a null @qapi_type. Callers updated with this Coccinelle script:
@@
identifier fun = {
object_property_add_enum,object_class_property_add_enum
};
expression obj, name, type;
@@
Review
Quoted 5 lines
(quoted diff) +1
-1- fun(obj, name, type, + fun(obj, name, type, NULL, ...)
Signature · 1 line
Marc-André Lureau <[email protected]>
PATCH v8 17/56 tests: update check-qom-proplist for QAPI-aware property registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Migrate the dummy object's string and enum properties from the legacy object_class_property_add_str/enum() helpers to the new QAPI-aware object_class_property_add_qapi/qapi_enum() registration.
Add test cases verifying that the qapi_type metadata is correctly populated on properties registered through the new API, and that it remains NULL for properties using the old-style registration.
--- tests/unit/check-qom-proplist.c | 87 ++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 13 deletions(-)
tests/unit/check-qom-proplist.c +74 -13
@@ -108,22 +108,21 @@ static int dummy_get_av(Object *obj, } -static void dummy_set_sv (Object *obj, -const char *value, -Error **errp) +static void dummy_set_sv (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {DummyObject *dobj =DUMMY_OBJECT (obj); -g_free (dobj->sv); - dobj->sv =g_strdup (value); +g_clear_pointer (&dobj->sv, g_free); +visit_type_str (v, name, &dobj->sv, errp); } -static char *dummy_get_sv (Object *obj, -Error **errp) +static void dummy_get_sv (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {DummyObject *dobj =DUMMY_OBJECT (obj); -return g_strdup (dobj->sv); +visit_type_str (v, name, &dobj->sv, errp); }
@@ -135,13 +134,25 @@ static void dummy_init(Object *obj) } +static const QAPITypeInfo dummy_animal_qapi_type_info = { + .name ="DummyAnimal" , + .masked_name ="DummyAnimalSchema" , + .lookup = &dummy_animal_map, +}; + +static const QAPITypeInfo dummy_str_qapi_type_info = { + .name ="str" , + .masked_name ="StrSchema" , +}; +static void dummy_class_init (ObjectClass *cls,const void *data) { -object_class_property_add_str (cls,"sv" , - dummy_get_sv, - dummy_set_sv); -object_class_property_add_enum (cls,"av" ,"DummyAnimal" ,NULL , - &dummy_animal_map, +object_class_property_add (cls,"sv" ,"str" , + &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, +NULL ,NULL ); +object_class_property_add_enum (cls,"av" ,"DummyAnimal" , + &dummy_animal_qapi_type_info,NULL , dummy_get_av, dummy_set_av); }
@@ -702,6 +713,54 @@ static void test_qom_partial_path(void)object_unparent (cont1); } +static void test_dummy_qapi_enum (void ) +{ +ObjectProperty *prop; +Object *parent =object_get_objects_root (); +DummyObject *dobj =DUMMY_OBJECT ( +object_new_with_props (TYPE_DUMMY , + parent, +"dummy0" , + &error_abort, +"av" ,"platypus" , +NULL )); + +g_assert (dobj->av ==DUMMY_PLATYPUS ); + + prop =object_property_find (OBJECT (dobj),"av" ); +g_assert (prop); +g_assert (prop->qapi_type == &dummy_animal_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, ==, "DummyAnimal"); + g_assert_cmpstr(prop->qapi_type->masked_name, ==, "DummyAnimalSchema"); +g_assert (prop->qapi_type->lookup == &dummy_animal_map); + +object_unparent (OBJECT (dobj)); +} + +static void test_dummy_qapi_prop (void ) +{ +ObjectProperty *prop; +Object *parent =object_get_objects_root (); +DummyObject *dobj =DUMMY_OBJECT ( +object_new_with_props (TYPE_DUMMY , + parent, +"dummy0" , + &error_abort, +"sv" ,"hello" , +NULL )); + + g_assert_cmpstr(dobj->sv, ==, "hello"); + + prop =object_property_find (OBJECT (dobj),"sv" ); +g_assert (prop); +g_assert (prop->qapi_type == &dummy_str_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, ==, "str"); + g_assert_cmpstr(prop->qapi_type->masked_name, ==, "StrSchema"); +g_assert (prop->qapi_type->lookup ==NULL ); + +object_unparent (OBJECT (dobj)); +} +int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL );
@@ -726,6 +785,8 @@ int main(int argc, char **argv)g_test_add_func ("/qom/proplist/iterator" , test_dummy_iterator);g_test_add_func ("/qom/proplist/class_iterator" , test_dummy_class_iterator);g_test_add_func ("/qom/proplist/delchild" , test_dummy_delchild); +g_test_add_func ("/qom/proplist/qapi_enum" , test_dummy_qapi_enum); +g_test_add_func ("/qom/proplist/qapi_prop" , test_dummy_qapi_prop);g_test_add_func ("/qom/resolve/partial" , test_qom_partial_path);return g_test_run ();
Signature · 1 line
2.55.0
PATCH v8 18/56 qom: convert QAPI enum properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert all callers of object_class_property_add_enum() but one to pass QAPITypeInfo instead of QEnumLookup.
This enables QMP QOM introspection to report accurate QAPI type names for enum properties in member @qapi-type.
Leave pc_i440fx_machine_options() for later, because enum PCSouthBridgeOption is a handmade QAPI-like enum instead of a real one.
--- include/chardev/char.h | 6 ++++-- authz/list.c | 6 ++++-- backends/hostmem.c | 5 +++-- crypto/secret_common.c | 5 +++-- crypto/tlscreds.c | 4 ++-- hw/microblaze/petalogix_s3adsp1800_mmu.c | 4 ++-- monitor/qmp.c | 5 +++-- net/filter.c | 5 +++-- target/i386/kvm/kvm.c | 9 +++++---- ui/console-vc.c | 1 + ui/dbus.c | 6 ++++-- ui/input-linux.c | 5 +++-- 12 files changed, 37 insertions(+), 24 deletions(-)
include/chardev/char.h +4 -2
@@ -1,6 +1,7 @@#ifndef QEMU_CHAR_H #define QEMU_CHAR_H +#include "qapi/qapi-type-infos-char.h" #include "qapi/qapi-types-char.h" #include "qemu/bitmap.h" #include "qemu/thread.h"
@@ -356,8 +357,9 @@ static inline void chardev_vc_add_encoding_prop(ObjectClass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NULL, - &ChardevVCEncoding_lookup, get, set); + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + &ChardevVCEncoding_type_info, NULL, + get, set); }#endif
authz/list.c +4 -2
@@ -22,6 +22,7 @@#include "authz/list.h" #include "trace.h" #include "qom/object_interfaces.h" +#include "qapi/qapi-type-infos-authz.h" #include "qapi/qapi-visit-authz.h" #include "qemu/module.h"
@@ -120,8 +121,9 @@ qauthz_list_class_init(ObjectClass *oc, const void *data) {QAuthZClass *authz =QAUTHZ_CLASS (oc); -object_class_property_add_enum (oc,"policy" ,"QAuthZListPolicy" ,NULL , - &QAuthZListPolicy_lookup, +object_class_property_add_enum (oc,"policy" ,"QAuthZListPolicy" , + &QAuthZListPolicy_type_info, +NULL , qauthz_list_prop_get_policy, qauthz_list_prop_set_policy);
backends/hostmem.c +3 -2
@@ -16,6 +16,7 @@#include "hw/core/boards.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/visitor.h" #include "qemu/config-file.h" #include "qom/compat-properties.h"
@@ -551,8 +552,8 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) NULL, NULL);object_class_property_set_description (oc,"host-nodes" ,"Binds memory to the list of NUMA host nodes" ); -object_class_property_add_enum (oc,"policy" ,"HostMemPolicy" ,NULL , - &HostMemPolicy_lookup, +object_class_property_add_enum (oc,"policy" ,"HostMemPolicy" , + &HostMemPolicy_type_info,NULL , host_memory_backend_get_policy, host_memory_backend_set_policy); object_class_property_set_description(oc, "policy",
crypto/secret_common.c +3 -2
@@ -22,6 +22,7 @@#include "crypto/secret_common.h" #include "crypto/cipher.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h"
@@ -269,8 +270,8 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *data) ucc->complete = qcrypto_secret_complete; -object_class_property_add_enum (oc,"format" ,"QCryptoSecretFormat" ,NULL , - &QCryptoSecretFormat_lookup, +object_class_property_add_enum (oc,"format" ,"QCryptoSecretFormat" , + &QCryptoSecretFormat_type_info,NULL , qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); object_class_property_add_str(oc, "keyid",
crypto/tlscreds.c +2 -2
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qapi-types-crypto.h" #include "qemu/module.h" #include "qemu/error-report.h"
@@ -222,8 +223,7 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const void *data) qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir);object_class_property_add_enum (oc,"endpoint" ,"QCryptoTLSCredsEndpoint" , -NULL , - &QCryptoTLSCredsEndpoint_lookup, + &QCryptoTLSCredsEndpoint_type_info,NULL , qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); object_class_property_add_str(oc, "priority",
hw/microblaze/petalogix_s3adsp1800_mmu.c +2 -2
@@ -27,6 +27,7 @@#include "qemu/target-info.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "target/microblaze/cpu.h" #include "hw/core/sysbus.h" #include "net/net.h"
@@ -175,8 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc, mc->is_default = true; prop =object_class_property_add_enum (oc,"endianness" ,"EndianMode" , -NULL , - &EndianMode_lookup, + &EndianMode_type_info,NULL , machine_get_endianness, machine_set_endianness); object_property_set_default_str(prop, target_big_endian() ? "big"
monitor/qmp.c +3 -2
@@ -30,6 +30,7 @@#include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-char.h" +#include "qapi/qapi-type-infos-qom.h" #include "qobject/qdict.h" #include "qobject/qjson.h" #include "qobject/qlist.h"
@@ -134,8 +135,8 @@ static void monitor_qmp_class_init(ObjectClass *cls, const void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty);object_class_property_add_enum (cls,"close-action" , -"MonitorQMPCloseAction" ,NULL , - &MonitorQMPCloseAction_lookup, +"MonitorQMPCloseAction" , + &MonitorQMPCloseAction_type_info,NULL , monitor_qmp_get_close_action, monitor_qmp_set_close_action);
net/filter.c +3 -2
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h"
@@ -342,8 +343,8 @@ static void netfilter_class_init(ObjectClass *oc, const void *data)object_class_property_add_str (oc,"netdev" , netfilter_get_netdev_id, netfilter_set_netdev_id); -object_class_property_add_enum (oc,"queue" ,"NetFilterDirection" ,NULL , - &NetFilterDirection_lookup, +object_class_property_add_enum (oc,"queue" ,"NetFilterDirection" , + &NetFilterDirection_type_info,NULL , netfilter_get_direction, netfilter_set_direction);object_class_property_add_str (oc,"status" , netfilter_get_status, netfilter_set_status);
target/i386/kvm/kvm.c +5 -4
@@ -14,6 +14,8 @@#include "qemu/osdep.h" #include "qapi/qapi-events-run-state.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/error.h" #include "qapi/visitor.h" #include <math.h>
@@ -7090,8 +7092,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj, int value, Error **errp)void kvm_arch_accel_class_init (ObjectClass *oc) {object_class_property_add_enum (oc,"notify-vmexit" ,"NotifyVMexitOption" , -NULL , - &NotifyVmexitOption_lookup, + &NotifyVmexitOption_type_info,NULL , kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); object_class_property_set_description(oc, "notify-vmexit",
@@ -7128,8 +7129,8 @@ void kvm_arch_accel_class_init(ObjectClass *oc)object_class_property_set_description (oc,"xen-evtchn-max-pirq" ,"Maximum number of Xen PIRQs" ); -object_class_property_add_enum (oc,"honor-guest-pat" ,"OnOffAuto" ,NULL , - &OnOffAuto_lookup, +object_class_property_add_enum (oc,"honor-guest-pat" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); object_class_property_set_description(oc, "honor-guest-pat",
ui/console-vc.c +1 -0
@@ -6,6 +6,7 @@#include "chardev/char.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" #include "qemu/option.h" #include "qemu/queue.h" #include "qom/compat-properties.h"
ui/dbus.c +4 -2
@@ -38,6 +38,8 @@#include "qemu/audio.h" #include "audio/audio_int.h" /* FIXME: use QOM dynamic cast instead of drv->name */ #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" +#include "qapi/qapi-type-infos-ui.h" #include "trace.h" #include "dbus.h"
@@ -508,8 +510,8 @@ dbus_display_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"p2p" , get_dbus_p2p, set_dbus_p2p);object_class_property_add_str (oc,"addr" , get_dbus_addr, set_dbus_addr);object_class_property_add_str (oc,"audiodev" , get_audiodev, set_audiodev); -object_class_property_add_enum (oc,"gl-mode" ,"DisplayGLMode" ,NULL , - &DisplayGLMode_lookup, +object_class_property_add_enum (oc,"gl-mode" ,"DisplayGLMode" , + &DisplayGLMode_type_info,NULL , get_gl_mode, set_gl_mode); }
ui/input-linux.c +3 -2
@@ -6,6 +6,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qemu/config-file.h" #include "qemu/main-loop.h" #include "qemu/module.h"
@@ -506,8 +507,8 @@ static void input_linux_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"repeat" , input_linux_get_repeat, input_linux_set_repeat); -object_class_property_add_enum (oc,"grab-toggle" ,"GrabToggleKeys" ,NULL , - &GrabToggleKeys_lookup, +object_class_property_add_enum (oc,"grab-toggle" ,"GrabToggleKeys" , + &GrabToggleKeys_type_info,NULL , input_linux_get_grab_toggle, input_linux_set_grab_toggle); }
Signature · 1 line
2.55.0
PATCH v8 19/56 qom: convert struct properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to pass QAPITypeInfo.
This enables QMP QOM introspection to report accurate QAPI type information for struct properties in member @qapi-type. Existing getters/setters are preserved unchanged.
--- authz/list.c | 3 ++- block/throttle-groups.c | 4 +++- chardev/char-socket.c | 4 +++- hw/core/machine.c | 12 ++++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 6 ++++-- hw/vfio-user/pci.c | 4 +++- target/i386/cpu.c | 10 +++++++--- target/i386/kvm/tdx.c | 10 ++++++---- target/s390x/cpu-system.c | 3 ++- 10 files changed, 41 insertions(+), 19 deletions(-)
authz/list.c +2 -1
@@ -127,7 +127,8 @@ qauthz_list_class_init(ObjectClass *oc, const void *data) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); -object_class_property_add (oc,"rules" ,"QAuthZListRule" ,NULL , +object_class_property_add (oc,"rules" ,"QAuthZListRule" , + &QAuthZListRuleList_type_info, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules,NULL ,NULL );
block/throttle-groups.c +3 -1
@@ -31,6 +31,7 @@#include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h" #include "qom/object_interfaces.h"
@@ -991,7 +992,8 @@ static void throttle_group_obj_class_init(ObjectClass *klass, }/* ThrottleLimits */ -object_class_property_add (klass,"limits" ,"ThrottleLimits" ,NULL , +object_class_property_add (klass,"limits" ,"ThrottleLimits" , + &ThrottleLimits_type_info, throttle_group_get_limits, throttle_group_set_limits,NULL ,NULL );
chardev/char-socket.c +3 -1
@@ -31,6 +31,7 @@#include "qemu/option.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qemu/yank.h" #include "trace.h"
@@ -1568,7 +1569,8 @@ static void char_socket_class_init(ObjectClass *oc, const void *data) cc->chr_listener_cleanup = tcp_chr_listener_cleanup; cc->chr_get_filename = tcp_chr_get_filename; -object_class_property_add (oc,"addr" ,"SocketAddress" ,NULL , +object_class_property_add (oc,"addr" ,"SocketAddress" , + &SocketAddress_type_info, char_socket_get_addr,NULL ,NULL ,NULL );
hw/core/machine.c +8 -4
@@ -18,6 +18,7 @@#include "hw/core/loader.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-commands-machine.h" #include "qemu/madvise.h"
@@ -1118,20 +1119,22 @@ static void machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dumpdtb" ,"Dump current dtb to a file and quit" ); -object_class_property_add (oc,"boot" ,"BootConfiguration" ,NULL , +object_class_property_add (oc,"boot" ,"BootConfiguration" , + &BootConfiguration_type_info, machine_get_boot, machine_set_boot,NULL ,NULL );object_class_property_set_description (oc,"boot" ,"Boot configuration" ); -object_class_property_add (oc,"smp" ,"SMPConfiguration" ,NULL , +object_class_property_add (oc,"smp" ,"SMPConfiguration" , + &SMPConfiguration_type_info, machine_get_smp, machine_set_smp,NULL ,NULL );object_class_property_set_description (oc,"smp" ,"CPU topology" );object_class_property_add (oc,"smp-cache" ,"SmpCachePropertiesWrapper" , -NULL , + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache,NULL ,NULL ); object_class_property_set_description(oc, "smp-cache",
@@ -1215,7 +1218,8 @@ static void machine_class_init(ObjectClass *oc, const void *data)"Set RAM backend" "Valid value is ID of hostmem based backend"); -object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" ,NULL , +object_class_property_add (oc,"memory" ,"MemorySizeConfiguration" , + &MemorySizeConfiguration_type_info, machine_get_mem, machine_set_mem,NULL ,NULL ); object_class_property_set_description(oc, "memory",
hw/cxl/cxl-host.c +3 -1
@@ -13,6 +13,7 @@#include "system/qtest.h" #include "hw/core/boards.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "hw/cxl/cxl.h" #include "hw/cxl/cxl_host.h"
@@ -616,7 +617,8 @@ void cxl_machine_init(Object *obj, CXLState *state)"Set on/off to enable/disable " "CXL instantiation"); -object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" ,NULL , +object_property_add (obj,"cxl-fmw" ,"CXLFixedMemoryWindow" , + &CXLFixedMemoryWindowOptionsList_type_info, machine_get_cfmw, machine_set_cfmw,NULL , state); object_property_set_description(obj, "cxl-fmw",
hw/remote/vfio-user-obj.c +4 -2
@@ -47,6 +47,7 @@#include "hw/core/boards.h" #include "hw/remote/machine.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" #include "qemu/notify.h"
@@ -931,8 +932,9 @@ static void vfu_object_class_init(ObjectClass *klass, const void *data) k->nr_devs =0 ; -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , - vfu_object_set_socket,NULL ,NULL ); +object_class_property_add (klass,"socket" ,"SocketAddress" , + &SocketAddress_type_info, +NULL , vfu_object_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" ,"SocketAddress " "(ex: type=unix,path=/tmp/sock). "
hw/vfio-user/pci.c +3 -1
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include <sys/ioctl.h> +#include "qapi/qapi-type-infos-sockets.h" #include "qapi-visit-sockets.h" #include "qemu/error-report.h"
@@ -471,7 +472,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass, const void *data)device_class_set_legacy_reset (dc, vfio_user_pci_reset);device_class_set_props (dc, vfio_user_pci_properties); -object_class_property_add (klass,"socket" ,"SocketAddress" ,NULL ,NULL , +object_class_property_add (klass,"socket" ,"SocketAddress" , + &SocketAddress_type_info,NULL , vfio_user_pci_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" ,"SocketAddress (UNIX sockets only)" );
target/i386/cpu.c +7 -3
@@ -35,6 +35,8 @@#include "sev.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-machine.h" #include "standard-headers/asm-x86/kvm_para.h" #include "hw/core/qdev-properties.h"
@@ -10569,11 +10571,12 @@ static void x86_cpu_initfn(Object *obj)x86_cpu_init_default_topo (cpu); -object_property_add (obj,"feature-words" ,"X86CPUFeatureWordInfo" ,NULL , +object_property_add (obj,"feature-words" ,"X86CPUFeatureWordInfo" , + &X86CPUFeatureWordInfoList_type_info, x86_cpu_get_feature_words,NULL ,NULL , (void *)env->features);object_property_add (obj,"filtered-features" ,"X86CPUFeatureWordInfo" , -NULL , + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words,NULL ,NULL , (void *)cpu->filtered_features);
@@ -11041,7 +11044,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data)#if !defined(CONFIG_USER_ONLY )object_class_property_add (oc,"crash-information" , -"GuestPanicInformation" ,NULL , +"GuestPanicInformation" , + &GuestPanicInformation_type_info, x86_cpu_get_crash_info_qom,NULL ,NULL ,NULL );#endif
target/i386/kvm/tdx.c +6 -4
@@ -14,6 +14,7 @@#include "qemu/base64.h" #include "qemu/mmap-alloc.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qom/object_interfaces.h" #include "crypto/hash.h"
@@ -1586,10 +1587,11 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); -object_property_add (obj,"quote-generation-socket" ,"SocketAddress" ,NULL , - tdx_guest_get_qgs, - tdx_guest_set_qgs, -NULL ,NULL ); +object_property_add (obj,"quote-generation-socket" ,"SocketAddress" , + &SocketAddress_type_info, + tdx_guest_get_qgs, + tdx_guest_set_qgs, +NULL ,NULL ); tdx->event_notify_vector =-1 ; tdx->event_notify_apicid =-1 ;
target/s390x/cpu-system.c +2 -1
@@ -30,6 +30,7 @@#include "system/reset.h" #include "qemu/timer.h" #include "trace.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-run-state.h" #include "system/hw_accel.h"
@@ -138,7 +139,7 @@ void s390_cpu_system_init(Object *obj) cs->start_powered_off = true;object_property_add (obj,"crash-information" ,"GuestPanicInformation" , -NULL , + &GuestPanicInformation_type_info, s390_cpu_get_crash_info_qom,NULL ,NULL ,NULL ); cpu->env.tod_timer =timer_new_ns (QEMU_CLOCK_VIRTUAL , s390x_tod_timer, cpu);
Signature · 1 line
2.55.0
PATCH v8 20/56 x86: convert OnOffAuto properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/i386/x86.c | 84 ++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 51 deletions(-)
hw/i386/x86.c +33 -51
@@ -24,7 +24,7 @@#include "qemu/error-report.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h"
@@ -188,21 +188,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState *x86ms)return false; } -static void x86_machine_get_smm (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int x86_machine_get_smm (Object *obj,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); -OnOffAuto smm = x86ms->smm; - -visit_type_OnOffAuto (v, name, &smm, errp); +return x86ms->smm; } -static void x86_machine_set_smm (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void x86_machine_set_smm (Object *obj,int value,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &x86ms->smm, errp); + x86ms->smm = value; }bool x86_machine_is_acpi_enabled (const X86MachineState *x86ms)
@@ -213,55 +208,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)return true; } -static void x86_machine_get_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int x86_machine_get_acpi (Object *obj,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); -OnOffAuto acpi = x86ms->acpi; - -visit_type_OnOffAuto (v, name, &acpi, errp); +return x86ms->acpi; } -static void x86_machine_set_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void x86_machine_set_acpi (Object *obj,int value,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &x86ms->acpi, errp); + x86ms->acpi = value; } -static void x86_machine_get_pit (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int x86_machine_get_pit (Object *obj,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); -OnOffAuto pit = x86ms->pit; - -visit_type_OnOffAuto (v, name, &pit, errp); +return x86ms->pit; } -static void x86_machine_set_pit (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void x86_machine_set_pit (Object *obj,int value,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &x86ms->pit, errp); + x86ms->pit = value; } -static void x86_machine_get_pic (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int x86_machine_get_pic (Object *obj,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); -OnOffAuto pic = x86ms->pic; - -visit_type_OnOffAuto (v, name, &pic, errp); +return x86ms->pic; } -static void x86_machine_set_pic (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void x86_machine_set_pic (Object *obj,int value,Error **errp) {X86MachineState *x86ms =X86_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &x86ms->pic, errp); + x86ms->pic = value; }static char *x86_machine_get_oem_id (Object *obj,Error **errp)
@@ -391,29 +371,31 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) mc->kvm_type = x86_kvm_type; nc->raise_nmi = x86_nmi; -object_class_property_add (oc,X86_MACHINE_SMM ,"OnOffAuto" ,NULL , - x86_machine_get_smm, x86_machine_set_smm, -NULL ,NULL ); +object_class_property_add_enum (oc,X86_MACHINE_SMM ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + x86_machine_get_smm, + x86_machine_set_smm);object_class_property_set_description (oc,X86_MACHINE_SMM ,"Enable SMM" ); -object_class_property_add (oc,X86_MACHINE_ACPI ,"OnOffAuto" ,NULL , - x86_machine_get_acpi, x86_machine_set_acpi, -NULL ,NULL ); +object_class_property_add_enum (oc,X86_MACHINE_ACPI ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + x86_machine_get_acpi, + x86_machine_set_acpi);object_class_property_set_description (oc,X86_MACHINE_ACPI ,"Enable ACPI" ); -object_class_property_add (oc,X86_MACHINE_PIT ,"OnOffAuto" ,NULL , - x86_machine_get_pit, - x86_machine_set_pit, -NULL ,NULL ); +object_class_property_add_enum (oc,X86_MACHINE_PIT ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + x86_machine_get_pit, + x86_machine_set_pit);object_class_property_set_description (oc,X86_MACHINE_PIT ,"Enable i8254 PIT" ); -object_class_property_add (oc,X86_MACHINE_PIC ,"OnOffAuto" ,NULL , - x86_machine_get_pic, - x86_machine_set_pic, -NULL ,NULL ); +object_class_property_add_enum (oc,X86_MACHINE_PIC ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + x86_machine_get_pic, + x86_machine_set_pic);object_class_property_set_description (oc,X86_MACHINE_PIC ,"Enable i8259 PIC" );
Signature · 1 line
2.55.0
PATCH v8 21/56 microvm: convert OnOffAuto properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/i386/microvm.c | 68 +++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 40 deletions(-)
hw/i386/microvm.c +28 -40
@@ -21,7 +21,7 @@#include "qemu/units.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/system.h" #include "system/cpus.h" #include "system/numa.h"
@@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machine, ResetType type) } } -static void microvm_machine_get_rtc (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int microvm_machine_get_rtc (Object *obj,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); -OnOffAuto rtc = mms->rtc; - -visit_type_OnOffAuto (v, name, &rtc, errp); +return mms->rtc; } -static void microvm_machine_set_rtc (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void microvm_machine_set_rtc (Object *obj,int value,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &mms->rtc, errp); + mms->rtc = value; } -static void microvm_machine_get_pcie (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int microvm_machine_get_pcie (Object *obj,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); -OnOffAuto pcie = mms->pcie; - -visit_type_OnOffAuto (v, name, &pcie, errp); +return mms->pcie; } -static void microvm_machine_set_pcie (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void microvm_machine_set_pcie (Object *obj,int value,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &mms->pcie, errp); + mms->pcie = value; } -static void microvm_machine_get_ioapic2 (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int microvm_machine_get_ioapic2 (Object *obj,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); -OnOffAuto ioapic2 = mms->ioapic2; - -visit_type_OnOffAuto (v, name, &ioapic2, errp); +return mms->ioapic2; } -static void microvm_machine_set_ioapic2 (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void microvm_machine_set_ioapic2 (Object *obj,int value,Error **errp) {MicrovmMachineState *mms =MICROVM_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &mms->ioapic2, errp); + mms->ioapic2 = value; }static bool microvm_machine_get_isa_serial (Object *obj,Error **errp)
@@ -673,24 +658,27 @@ static void microvm_class_init(ObjectClass *oc, const void *data) hc->unplug_request = microvm_device_unplug_request_cb; hc->unplug = microvm_device_unplug_cb; -object_class_property_add (oc,MICROVM_MACHINE_RTC ,"OnOffAuto" ,NULL , - microvm_machine_get_rtc, - microvm_machine_set_rtc, -NULL ,NULL ); +object_class_property_add_enum (oc,MICROVM_MACHINE_RTC , +"OnOffAuto" , + &OnOffAuto_type_info,NULL , + microvm_machine_get_rtc, + microvm_machine_set_rtc);object_class_property_set_description (oc,MICROVM_MACHINE_RTC ,"Enable MC146818 RTC" ); -object_class_property_add (oc,MICROVM_MACHINE_PCIE ,"OnOffAuto" ,NULL , - microvm_machine_get_pcie, - microvm_machine_set_pcie, -NULL ,NULL ); +object_class_property_add_enum (oc,MICROVM_MACHINE_PCIE , +"OnOffAuto" , + &OnOffAuto_type_info,NULL , + microvm_machine_get_pcie, + microvm_machine_set_pcie);object_class_property_set_description (oc,MICROVM_MACHINE_PCIE ,"Enable PCIe" ); -object_class_property_add (oc,MICROVM_MACHINE_IOAPIC2 ,"OnOffAuto" ,NULL , - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, -NULL ,NULL ); +object_class_property_add_enum (oc,MICROVM_MACHINE_IOAPIC2 , +"OnOffAuto" , + &OnOffAuto_type_info,NULL , + microvm_machine_get_ioapic2, + microvm_machine_set_ioapic2);object_class_property_set_description (oc,MICROVM_MACHINE_IOAPIC2 ,"Enable second IO-APIC" );
Signature · 1 line
2.55.0
PATCH v8 22/56 pc: convert OnOffAuto vmport property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the vmport OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/i386/pc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
hw/i386/pc.c +10 -12
@@ -46,6 +46,7 @@#include "kvm/kvm_i386.h" #include "kvm/tdx.h" #include "hw/xen/xen.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "qemu/error-report.h" #include "hw/acpi/acpi.h"
@@ -1417,21 +1418,16 @@ static const HotplugHandler *pc_get_hotplug_handler(MachineState *machine,return NULL ; } -static void pc_machine_get_vmport (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int pc_machine_get_vmport (Object *obj,Error **errp) {PCMachineState *pcms =PC_MACHINE (obj); -OnOffAuto vmport = pcms->vmport; - -visit_type_OnOffAuto (v, name, &vmport, errp); +return pcms->vmport; } -static void pc_machine_set_vmport (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void pc_machine_set_vmport (Object *obj,int value,Error **errp) {PCMachineState *pcms =PC_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &pcms->vmport, errp); + pcms->vmport = value; }static bool pc_machine_get_fd_bootchk (Object *obj,Error **errp)
@@ -1729,9 +1725,11 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"Maximum ram below the 4G boundary (32bit boundary)" ); -object_class_property_add (oc,PC_MACHINE_VMPORT ,"OnOffAuto" ,NULL , - pc_machine_get_vmport, pc_machine_set_vmport, -NULL ,NULL ); +object_class_property_add_enum (oc,PC_MACHINE_VMPORT , +"OnOffAuto" , + &OnOffAuto_type_info,NULL , + pc_machine_get_vmport, + pc_machine_set_vmport);object_class_property_set_description (oc,PC_MACHINE_VMPORT ,"Enable vmport (pc & q35)" );
Signature · 1 line
2.55.0
PATCH v8 23/56 arm/virt: convert OnOffAuto acpi property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the acpi OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/arm/virt.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
hw/arm/virt.c +8 -13
@@ -72,7 +72,7 @@#include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h"
@@ -3564,21 +3564,16 @@ bool virt_is_acpi_enabled(const VirtMachineState *vms)return true; } -static void virt_get_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_acpi (Object *obj,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (obj); -OnOffAuto acpi = vms->acpi; - -visit_type_OnOffAuto (v, name, &acpi, errp); +return vms->acpi; } -static void virt_set_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void virt_set_acpi (Object *obj,int value,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &vms->acpi, errp); + vms->acpi = value; }static bool virt_get_ras (Object *obj,Error **errp)
@@ -4206,9 +4201,9 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="mach-virt.ram" ; mc->default_nic ="virtio-net-pci" ; -object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add_enum (oc,"acpi" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_acpi, virt_set_acpi);object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); object_class_property_add_bool(oc, "secure", virt_get_secure,
Signature · 1 line
2.55.0
PATCH v8 24/56 riscv/virt: convert OnOffAuto properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/riscv/virt.c | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
hw/riscv/virt.c +15 -25
@@ -58,7 +58,7 @@#include "hw/pci-host/gpex.h" #include "hw/display/ramfb.h" #include "hw/acpi/aml-build.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h"
@@ -1055,38 +1055,28 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s)return s->iommu_sys ==ON_OFF_AUTO_ON ; } -static void virt_get_iommu_sys (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_iommu_sys (Object *obj,Error **errp) {RISCVVirtState *s =RISCV_VIRT_MACHINE (obj); -OnOffAuto iommu_sys = s->iommu_sys; - -visit_type_OnOffAuto (v, name, &iommu_sys, errp); +return s->iommu_sys; } -static void virt_set_iommu_sys (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void virt_set_iommu_sys (Object *obj,int value,Error **errp) {RISCVVirtState *s =RISCV_VIRT_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &s->iommu_sys, errp); + s->iommu_sys = value; } -static void virt_get_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_acpi (Object *obj,Error **errp) {RISCVVirtState *s =RISCV_VIRT_MACHINE (obj); -OnOffAuto acpi = s->acpi; - -visit_type_OnOffAuto (v, name, &acpi, errp); +return s->acpi; } -static void virt_set_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void virt_set_acpi (Object *obj,int value,Error **errp) {RISCVVirtState *s =RISCV_VIRT_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &s->acpi, errp); + s->acpi = value; } static const HotplugHandler *
@@ -1184,15 +1174,15 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"aia-guests" , str); } -object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add_enum (oc,"acpi" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_acpi, virt_set_acpi);object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"iommu-sys" ,"OnOffAuto" ,NULL , - virt_get_iommu_sys, virt_set_iommu_sys, -NULL ,NULL ); +object_class_property_add_enum (oc,"iommu-sys" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_iommu_sys, virt_set_iommu_sys);object_class_property_set_description (oc,"iommu-sys" ,"Enable IOMMU platform device" ); }
Signature · 1 line
2.55.0
PATCH v8 25/56 loongarch/virt: convert OnOffAuto properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum().
--- hw/loongarch/virt.c | 65 ++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 39 deletions(-)
hw/loongarch/virt.c +26 -39
@@ -36,7 +36,8 @@#include "target/loongarch/cpu.h" #include "target/loongarch/cpu-mmu.h" #include "hw/firmware/smbios.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/visitor.h" #include "hw/acpi/generic_event_device.h" #include "hw/mem/nvdimm.h" #include "hw/core/platform-bus.h"
@@ -51,26 +52,21 @@#include "qemu/log.h" #include "kvm/kvm_loongarch.h" -static void virt_get_dmsi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_dmsi (Object *obj,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); -OnOffAuto dmsi = lvms->dmsi; - -visit_type_OnOffAuto (v, name, &dmsi, errp); - +return lvms->dmsi; } -static void virt_set_dmsi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) + +static void virt_set_dmsi (Object *obj,int value,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); + lvms->dmsi = value; -visit_type_OnOffAuto (v, name, &lvms->dmsi, errp); - -if (lvms->dmsi ==ON_OFF_AUTO_OFF ) { +if (value ==ON_OFF_AUTO_OFF ) { lvms->misc_feature &= ~BIT (IOCSRF_DMSI ); lvms->misc_status &= ~BIT_ULL (IOCSRM_DMSI_EN ); - }else if (lvms->dmsi ==ON_OFF_AUTO_ON ) { + }else if (value ==ON_OFF_AUTO_ON ) { lvms->misc_feature =BIT (IOCSRF_DMSI ); } }
@@ -78,21 +74,16 @@ static void virt_set_dmsi(Object *obj, Visitor *v, const char *name,#define DEFAULT_HIGH_PCIE_MMIO_SIZE_GB 64#define DEFAULT_HIGH_PCIE_MMIO_SIZE (DEFAULT_HIGH_PCIE_MMIO_SIZE_GB * GiB) -static void virt_get_veiointc (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_veiointc (Object *obj,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); -OnOffAuto veiointc = lvms->veiointc; - -visit_type_OnOffAuto (v, name, &veiointc, errp); +return lvms->veiointc; } -static void virt_set_veiointc (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void virt_set_veiointc (Object *obj,int value,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &lvms->veiointc, errp); + lvms->veiointc = value; }static bool virt_get_highmem_mmio (Object *obj,Error **errp)
@@ -1025,21 +1016,16 @@ static void virt_init(MachineState *machine)loongarch_load_kernel (machine, &lvms->bootinfo, phys_addr_mask); } -static void virt_get_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static int virt_get_acpi (Object *obj,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); -OnOffAuto acpi = lvms->acpi; - -visit_type_OnOffAuto (v, name, &acpi, errp); +return lvms->acpi; } -static void virt_set_acpi (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void virt_set_acpi (Object *obj,int value,Error **errp) {LoongArchVirtMachineState *lvms =LOONGARCH_VIRT_MACHINE (obj); - -visit_type_OnOffAuto (v, name, &lvms->acpi, errp); + lvms->acpi = value; }static char *virt_get_oem_id (Object *obj,Error **errp)
@@ -1483,18 +1469,19 @@ static void virt_class_init(ObjectClass *oc, const void *data) hc->unplug_request = virt_device_unplug_request; hc->unplug = virt_device_unplug; -object_class_property_add (oc,"acpi" ,"OnOffAuto" ,NULL , - virt_get_acpi, virt_set_acpi, -NULL ,NULL ); +object_class_property_add_enum (oc,"acpi" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_acpi, virt_set_acpi);object_class_property_set_description (oc,"acpi" ,"Enable ACPI" ); -object_class_property_add (oc,"v-eiointc" ,"OnOffAuto" ,NULL , - virt_get_veiointc, virt_set_veiointc, -NULL ,NULL ); +object_class_property_add_enum (oc,"v-eiointc" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_veiointc, virt_set_veiointc);object_class_property_set_description (oc,"v-eiointc" ,"Enable Virt Extend I/O Interrupt Controller." ); -object_class_property_add (oc,"dmsi" ,"OnOffAuto" ,NULL , - virt_get_dmsi, virt_set_dmsi,NULL ,NULL ); +object_class_property_add_enum (oc,"dmsi" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + virt_get_dmsi, virt_set_dmsi);object_class_property_set_description (oc,"dmsi" ,"Enable direct Message-interrupts Controller." );machine_class_allow_dynamic_sysbus_dev (mc,TYPE_RAMFB_DEVICE );
Signature · 1 line
2.55.0
PATCH v8 26/56 hostmem: convert OnOffAuto rom property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the hostmem-file's rom property and hostmem-memfd's guest-memfd property from manual visitor-based callbacks to object_class_property_add_enum().
--- backends/hostmem-file.c | 25 ++++++++++--------------- backends/hostmem-memfd.c | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 28 deletions(-)
backends/hostmem-file.c +10 -15
@@ -19,7 +19,7 @@#include "qom/object_interfaces.h" #include "qom/object.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" OBJECT_DECLARE_SIMPLE_TYPE (HostMemoryBackendFile,MEMORY_BACKEND_FILE )
@@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *obj, bool value, fb->readonly = value; } -static void file_memory_backend_get_rom (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static int file_memory_backend_get_rom (Object *obj,Error **errp) {HostMemoryBackendFile *fb =MEMORY_BACKEND_FILE (obj); -OnOffAuto rom = fb->rom; - -visit_type_OnOffAuto (v, name, &rom, errp); +return fb->rom; } -static void file_memory_backend_set_rom (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void file_memory_backend_set_rom (Object *obj,int value,Error **errp) {HostMemoryBackend *backend =MEMORY_BACKEND (obj);HostMemoryBackendFile *fb =MEMORY_BACKEND_FILE (obj);if (host_memory_backend_mr_inited (backend)) { -error_setg (errp,"cannot change property '%s' of %s." , name, +error_setg (errp,"cannot change property 'rom' of %s." ,object_get_typename (obj));return ; } -visit_type_OnOffAuto (v, name, &fb->rom, errp); + fb->rom = value; }static void file_backend_unparent (Object *obj)
@@ -298,9 +292,10 @@ file_backend_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"readonly" , file_memory_backend_get_readonly, file_memory_backend_set_readonly); -object_class_property_add (oc,"rom" ,"OnOffAuto" ,NULL , - file_memory_backend_get_rom, - file_memory_backend_set_rom,NULL ,NULL ); +object_class_property_add_enum (oc,"rom" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + file_memory_backend_get_rom, + file_memory_backend_set_rom);object_class_property_set_description (oc,"rom" ,"Whether to create Read Only Memory (ROM)" ); }
backends/hostmem-memfd.c +10 -13
@@ -20,7 +20,7 @@#include "migration/cpr.h" #include "system/kvm.h" #include <linux/kvm.h> -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" OBJECT_DECLARE_SIMPLE_TYPE (HostMemoryBackendMemfd,MEMORY_BACKEND_MEMFD )
@@ -95,24 +95,20 @@ have_fd: backend->size, ram_flags, fd, 0, errp); } -static void -memfd_backend_get_guest_memfd (Object *o,Visitor *v, -const char *value,void *opaque, -Error **errp) +static int +memfd_backend_get_guest_memfd (Object *o,Error **errp) {HostMemoryBackendMemfd *m =MEMORY_BACKEND_MEMFD (o); -visit_type_OnOffAuto (v, value, &m->guest_memfd, errp); +return m->guest_memfd; }static void -memfd_backend_set_guest_memfd (Object *o,Visitor *v, -const char *value,void *opaque, -Error **errp) +memfd_backend_set_guest_memfd (Object *o,int value,Error **errp) {HostMemoryBackendMemfd *m =MEMORY_BACKEND_MEMFD (o); -visit_type_OnOffAuto (v, value, &m->guest_memfd, errp); + m->guest_memfd = value; } static bool
@@ -203,9 +199,10 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) "Huge pages size (ex: 2M, 1G)"); } -object_class_property_add (oc,"guest-memfd" ,"OnOffAuto" ,NULL , - memfd_backend_get_guest_memfd, - memfd_backend_set_guest_memfd,NULL ,NULL ); +object_class_property_add_enum (oc,"guest-memfd" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + memfd_backend_get_guest_memfd, + memfd_backend_set_guest_memfd);object_class_property_set_description (oc,"guest-memfd" ,"Use guest memfd" );
Signature · 1 line
2.55.0
PATCH v8 27/56 sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum().
--- target/i386/sev.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
target/i386/sev.c +9 -14
@@ -20,6 +20,7 @@#include <sys/ioctl.h> #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h"
@@ -2982,23 +2983,16 @@ sev_guest_set_session_file(Object *obj, const char *value, Error **errp)SEV_GUEST (obj)->session_file =g_strdup (value); } -static void sev_guest_get_legacy_vm_type (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static int sev_guest_get_legacy_vm_type (Object *obj,Error **errp) {SevGuestState *sev_guest =SEV_GUEST (obj); -OnOffAuto legacy_vm_type = sev_guest->legacy_vm_type; - -visit_type_OnOffAuto (v, name, &legacy_vm_type, errp); +return sev_guest->legacy_vm_type; } -static void sev_guest_set_legacy_vm_type (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void sev_guest_set_legacy_vm_type (Object *obj,int value,Error **errp) {SevGuestState *sev_guest =SEV_GUEST (obj); - -visit_type_OnOffAuto (v, name, &sev_guest->legacy_vm_type, errp); + sev_guest->legacy_vm_type = value; } static void
@@ -3024,9 +3018,10 @@ sev_guest_class_init(ObjectClass *oc, const void *data) sev_guest_set_session_file);object_class_property_set_description (oc,"session-file" ,"guest owners session parameters (encoded with base64)" ); -object_class_property_add (oc,"legacy-vm-type" ,"OnOffAuto" ,NULL , - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type,NULL ,NULL ); +object_class_property_add_enum (oc,"legacy-vm-type" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , + sev_guest_get_legacy_vm_type, + sev_guest_set_legacy_vm_type);object_class_property_set_description (oc,"legacy-vm-type" ,"use legacy VM type to maintain measurement compatibility with older QEMU or kernel versions." ); }
Signature · 1 line
2.55.0
PATCH v8 28/56 whpx: convert OnOffAuto hyperv property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the hyperv OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum().
--- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
accel/whpx/whpx-common.c +7 -17
@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "migration/blocker.h" #include "accel/accel-cpu-target.h"
@@ -470,18 +471,11 @@ static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, } } -static void whpx_set_hyperv (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void whpx_set_hyperv (Object *obj,int value,Error **errp) {struct whpx_state *whpx = &whpx_global; -OnOffAuto mode; -if (!visit_type_OnOffAuto (v, name, &mode, errp)) { -return ; - } - -switch (mode) { +switch (value) {case ON_OFF_AUTO_ON : whpx->hyperv_enlightenments_allowed = true; whpx->hyperv_enlightenments_required = true;
@@ -497,11 +491,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v, whpx->hyperv_enlightenments_required = false;break ;default : -/* -* The value was checked in visit_type_OnOffAuto() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } }
@@ -533,9 +523,9 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data) NULL, NULL);object_class_property_set_description (oc,"kernel-irqchip" ,"Configure WHPX in-kernel irqchip" ); -object_class_property_add (oc,"hyperv" ,"OnOffAuto" ,NULL , -NULL , whpx_set_hyperv, -NULL ,NULL ); +object_class_property_add_enum (oc,"hyperv" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , +NULL , whpx_set_hyperv);object_class_property_set_description (oc,"hyperv" ,"Configure Hyper-V enlightenments" );
Signature · 1 line
2.55.0
PATCH v8 29/56 whpx: convert OnOffAuto arch properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum().
--- target/i386/whpx/whpx-all.c | 84 ++++++++++--------------------------- 1 file changed, 23 insertions(+), 61 deletions(-)
target/i386/whpx/whpx-all.c +23 -61
@@ -30,7 +30,7 @@#include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "migration/blocker.h" #include "host-cpu.h" #include "accel/accel-cpu-target.h"
@@ -1875,6 +1875,7 @@ void whpx_apply_breakpoints( } } +void whpx_arch_destroy_vcpu (CPUState *cpu) {X86CPU *x86cpu =X86_CPU (cpu);
@@ -1955,7 +1956,7 @@ static int whpx_handle_hyperv_guestidle(CPUState *cpu)return whpx_handle_halt (cpu); } -static void whpx_vcpu_kick_out_of_hlt (CPUState *cpu) +static void whpx_vcpu_kick_out_of_hlt (CPUState *cpu) {WHV_REGISTER_VALUE reg;whpx_get_reg (cpu, WHvRegisterInternalActivityState, ®);
@@ -2059,7 +2060,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) .Vector = irq, }; reg_count +=1 ; -/* +/* * When the Hyper-V APIC is enabled, to get out of HLT we * either have to request an interrupt or manually get it away * from HLT.
@@ -2359,7 +2360,7 @@ int whpx_vcpu_run(CPUState *cpu)WHV_REGISTER_VALUE reg_values[3 ] = {0 };WHV_REGISTER_NAME reg_names[3 ];UINT32 reg_count; -bool is_known_msr =0 ; +bool is_known_msr =0 ;bool raises_gpf = false;uint64_t val;
@@ -2911,118 +2912,79 @@ void whpx_cpu_instance_init(CPUState *cs)* Partition support */ -static void whpx_set_unknown_msr (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void whpx_set_unknown_msr (Object *obj,int value,Error **errp) {struct whpx_state *whpx = &whpx_global; -OnOffAuto mode; -if (!visit_type_OnOffAuto (v, name, &mode, errp)) { -return ; - } - -switch (mode) { +switch (value) {case ON_OFF_AUTO_ON : whpx->ignore_unknown_msr = true;break ; -case ON_OFF_AUTO_OFF : whpx->ignore_unknown_msr = false;break ; -case ON_OFF_AUTO_AUTO : whpx->ignore_unknown_msr = true;break ;default : -/* -* The value was checked in visit_type_OnOffAuto() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } } -static void whpx_set_intercept_msr_gp (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void whpx_set_intercept_msr_gp (Object *obj,int value,Error **errp) {struct whpx_state *whpx = &whpx_global; -OnOffAuto mode; -if (!visit_type_OnOffAuto (v, name, &mode, errp)) { -return ; - } - -switch (mode) { +switch (value) {case ON_OFF_AUTO_ON : whpx->intercept_msr_gp = true;break ; -case ON_OFF_AUTO_OFF : whpx->intercept_msr_gp = false;break ; -case ON_OFF_AUTO_AUTO : whpx->intercept_msr_gp = false;break ;default : -/* -* The value was checked in visit_type_OnOffAuto() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } } -static void whpx_set_ssd (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void whpx_set_ssd (Object *obj,int value,Error **errp) {struct whpx_state *whpx = &whpx_global; -OnOffAuto mode; -if (!visit_type_OnOffAuto (v, name, &mode, errp)) { -return ; - } - -switch (mode) { +switch (value) {case ON_OFF_AUTO_ON : whpx->separate_security_domain = true;break ; -case ON_OFF_AUTO_OFF : whpx->separate_security_domain = false;break ; -case ON_OFF_AUTO_AUTO : whpx->separate_security_domain = true;break ;default : -/* -* The value was checked in visit_type_OnOffAuto() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } }void whpx_arch_accel_class_init (ObjectClass *oc) { -object_class_property_add (oc,"ignore-unknown-msr" ,"OnOffAuto" ,NULL , -NULL , whpx_set_unknown_msr, -NULL ,NULL ); +object_class_property_add_enum (oc,"ignore-unknown-msr" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , +NULL , whpx_set_unknown_msr);object_class_property_set_description (oc,"ignore-unknown-msr" ,"Configure unknown MSR behavior" ); -object_class_property_add (oc,"intercept-msr-gp" ,"OnOffAuto" ,NULL , -NULL , whpx_set_intercept_msr_gp, -NULL ,NULL ); +object_class_property_add_enum (oc,"intercept-msr-gp" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , +NULL , whpx_set_intercept_msr_gp);object_class_property_set_description (oc,"intercept-msr-gp" ,"Intercept #GP to log erroring MSR accesses." ); -object_class_property_add (oc,"ssd" ,"OnOffAuto" ,NULL , -NULL , whpx_set_ssd, -NULL ,NULL ); +object_class_property_add_enum (oc,"ssd" ,"OnOffAuto" , + &OnOffAuto_type_info,NULL , +NULL , whpx_set_ssd);object_class_property_set_description (oc,"ssd" ,"Separate security domain" ); }
Signature · 1 line
2.55.0
PATCH v8 30/56 accel/kvm: convert OnOffSplit property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum().
--- accel/kvm/kvm-all.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
accel/kvm/kvm-all.c +7 -14
@@ -46,6 +46,7 @@#include "qapi/visitor.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/reset.h" #include "qemu/guest-random.h" #include "system/hw_accel.h"
@@ -4151,22 +4152,17 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v, s->kvm_shadow_mem = value; } -static void kvm_set_kernel_irqchip (Object *obj,Visitor *v, -const char *name,void *opaque, +static void kvm_set_kernel_irqchip (Object *obj,int value,Error **errp) {KVMState *s =KVM_STATE (obj); -OnOffSplit mode;if (s->fd !=-1 ) {error_setg (errp,"Cannot set properties after the accelerator has been initialized" );return ; } -if (!visit_type_OnOffSplit (v, name, &mode, errp)) { -return ; - } -switch (mode) { +switch (value) {case ON_OFF_SPLIT_ON : s->kernel_irqchip_allowed = true; s->kernel_irqchip_required = true;
@@ -4183,10 +4179,7 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v, s->kernel_irqchip_split =ON_OFF_AUTO_ON ;break ;default : -/* The value was checked in visit_type_OnOffSplit() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } }
@@ -4303,9 +4296,9 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data) ac->has_memory = kvm_accel_has_memory; ac->allowed = &kvm_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , -NULL , kvm_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add_enum (oc,"kernel-irqchip" ,"on|off|split" , + &OnOffSplit_type_info,NULL , +NULL , kvm_set_kernel_irqchip);object_class_property_set_description (oc,"kernel-irqchip" ,"Configure KVM in-kernel irqchip" );
Signature · 1 line
2.55.0
PATCH v8 31/56 whpx: convert OnOffSplit property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum().
--- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
accel/whpx/whpx-common.c +7 -17
@@ -434,18 +434,12 @@ error:return false; } -static void whpx_set_kernel_irqchip (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +static void whpx_set_kernel_irqchip (Object *obj,int value, +Error **errp) {struct whpx_state *whpx = &whpx_global; -OnOffSplit mode; -if (!visit_type_OnOffSplit (v, name, &mode, errp)) { -return ; - } - -switch (mode) { +switch (value) {case ON_OFF_SPLIT_ON : whpx->kernel_irqchip_allowed = true; whpx->kernel_irqchip_required = true;
@@ -463,11 +457,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visitor *v,break ;default : -/* -* The value was checked in visit_type_OnOffSplit() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } }
@@ -518,9 +508,9 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data) ac->pre_resume_vm = whpx_pre_resume_vm; ac->allowed = &whpx_allowed; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , -NULL , whpx_set_kernel_irqchip, -NULL ,NULL ); +object_class_property_add_enum (oc,"kernel-irqchip" ,"on|off|split" , + &OnOffSplit_type_info,NULL , +NULL , whpx_set_kernel_irqchip);object_class_property_set_description (oc,"kernel-irqchip" ,"Configure WHPX in-kernel irqchip" ); object_class_property_add_enum(oc, "hyperv", "OnOffAuto",
Signature · 1 line
2.55.0
PATCH v8 32/56 ppc/spapr-caps: convert to QAPI-aware property registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Add QAPITypeInfo to SpaprCapabilityInfo, and make spapr_caps_add_properties() pass it to object_class_property_add().
--- hw/ppc/spapr_caps.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
hw/ppc/spapr_caps.c +18 -1
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h"
@@ -60,6 +61,7 @@ typedef struct SpaprCapabilityInfo {ObjectPropertyAccessor *get;ObjectPropertyAccessor *set;const char *type; +const QAPITypeInfo *qapi_type;/* Possible values if this is a custom string type */ SpaprCapPossible *possible;/* Make sure the virtual hardware can support this capability */
@@ -726,6 +728,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_htm_apply, }, [SPAPR_CAP_VSX] = {
@@ -735,6 +738,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_vsx_apply, }, [SPAPR_CAP_DFP] = {
@@ -744,6 +748,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_dfp_apply, }, [SPAPR_CAP_CFPC] = {
@@ -753,6 +758,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_string, .set = spapr_cap_set_string, .type = "string", + .qapi_type = &str_type_info, .possible = &cap_cfpc_possible, .apply = cap_safe_cache_apply, },
@@ -763,6 +769,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_string, .set = spapr_cap_set_string, .type = "string", + .qapi_type = &str_type_info, .possible = &cap_sbbc_possible, .apply = cap_safe_bounds_check_apply, },
@@ -775,6 +782,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_string, .set = spapr_cap_set_string, .type = "string", + .qapi_type = &str_type_info, .possible = &cap_ibs_possible, .apply = cap_safe_indirect_branch_apply, },
@@ -785,6 +793,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_pagesize, .set = spapr_cap_set_pagesize, .type = "int", + .qapi_type = &size_type_info, .apply = cap_hpt_maxpagesize_apply, .cpu_apply = cap_hpt_maxpagesize_cpu_apply, },
@@ -795,6 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] = {
@@ -804,6 +814,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] = {
@@ -813,6 +824,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_large_decr_apply, .cpu_apply = cap_large_decr_cpu_apply, },
@@ -823,6 +835,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] = {
@@ -832,6 +845,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] = {
@@ -841,6 +855,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] = {
@@ -850,6 +865,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] = {
@@ -859,6 +875,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = { .get = spapr_cap_get_bool, .set = spapr_cap_set_bool, .type = "bool", + .qapi_type = &bool_type_info, .apply = cap_dawr1_apply, }, };
@@ -1069,7 +1086,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name = g_strdup_printf("cap-%s", cap->name); g_autofree char *desc = g_strdup(cap->description); -object_class_property_add (klass, name, cap->type,NULL , +object_class_property_add (klass, name, cap->type, cap->qapi_type, cap->get, cap->set,NULL , cap);
Signature · 1 line
2.55.0
PATCH v8 33/56 net/colo-compare: fix compare_timeout setter visitor type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
The setter was using visit_type_uint32, truncating the value, while the getter and typename use uint64. Use visit_type_uint64 consistently.
--- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/colo-compare.c +2 -2
@@ -1075,9 +1075,9 @@ static void compare_set_timeout(Object *obj, Visitor *v, Error **errp) {CompareState *s =COLO_COMPARE (obj); -uint32_t value; +uint64_t value; -if (!visit_type_uint32 (v, name, &value, errp)) { +if (!visit_type_uint64 (v, name, &value, errp)) {return ; }if (!value) {
Signature · 1 line
2.55.0
PATCH v8 34/56 net/colo-compare: fix max_queue_size setter visitor type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
The setter was using visit_type_uint64, accepting values wider than the uint32_t field. Use visit_type_uint32 to match the getter, field, and typename.
--- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/colo-compare.c +2 -2
@@ -1129,9 +1129,9 @@ static void set_max_queue_size(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - uint64_t value; + uint32_t value; -if (!visit_type_uint64 (v, name, &value, errp)) { +if (!visit_type_uint32 (v, name, &value, errp)) {return ; }if (!value) {
Signature · 1 line
2.55.0
PATCH v8 35/56 hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
--- hw/misc/xlnx-versal-trng.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
hw/misc/xlnx-versal-trng.c +12 -0
@@ -650,10 +650,22 @@ static void trng_prop_fault_event_set(Object *obj, Visitor *v,trng_fault_event_set (XLNX_VERSAL_TRNG (obj), *events); } +static void trng_prop_fault_event_get (Object *obj,Visitor *v, +const char *name, +void *opaque, +Error **errp) +{ +const Property *prop = opaque; +uint32_t *events =object_field_prop_ptr (obj, prop); + +visit_type_uint32 (v, name, events, errp); +} +static const PropertyInfo trng_prop_fault_events = { .type ="uint32" , .description ="Set to trigger TRNG fault events" , .set = trng_prop_fault_event_set, + .get = trng_prop_fault_event_get, .realized_set_allowed = true, };
Signature · 1 line
2.55.0
PATCH v8 36/56 qom: convert scalar properties to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_class_property_add() and object_property_add().
--- accel/kvm/kvm-all.c | 9 ++++---- accel/nitro/nitro-accel.c | 4 +++- accel/tcg/tcg-all.c | 3 ++- backends/cryptodev.c | 7 +++--- backends/hostmem-file.c | 4 ++-- backends/hostmem-memfd.c | 4 +++- backends/hostmem.c | 7 +++--- block/throttle-groups.c | 4 +++- crypto/secret_keyring.c | 9 ++++---- event-loop-base.c | 10 +++++--- hw/acpi/ich9.c | 4 +++- hw/acpi/pci.c | 5 ++-- hw/arm/virt.c | 18 ++++++++------- hw/core/clock.c | 4 +++- hw/core/machine.c | 2 +- hw/cpu/core.c | 5 ++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 7 ++++-- hw/gpio/aspeed_sgpio.c | 4 +++- hw/gpio/stm32l4x5_gpio.c | 5 ++-- hw/hexagon/hexagon_dsp.c | 4 +++- hw/i386/pc.c | 9 +++++--- hw/i386/sgx-epc.c | 4 +++- hw/i386/x86.c | 6 ++--- hw/ide/ide-dev.c | 3 ++- hw/intc/apic_common.c | 3 ++- hw/loongarch/virt.c | 8 +++---- hw/mem/nvdimm.c | 3 ++- hw/mem/pc-dimm.c | 3 ++- hw/misc/aspeed_lpc.c | 25 ++++++++++---------- hw/misc/aspeed_sdmc.c | 3 ++- hw/misc/npcm7xx_mft.c | 3 ++- hw/net/ne2000-isa.c | 3 ++- hw/nvme/ctrl.c | 4 +++- hw/pci-bridge/pci_expander_bridge.c | 3 ++- hw/pci-host/i440fx.c | 9 ++++---- hw/pci-host/pnv_phb3.c | 5 ++-- hw/pci-host/pnv_phb4.c | 5 ++-- hw/pci-host/q35.c | 13 +++++++---- hw/ppc/spapr_drc.c | 5 ++-- hw/remote/vfio-user-obj.c | 4 ++-- hw/riscv/microchip_pfsoc.c | 3 ++- hw/s390x/sclpcpi.c | 6 +++-- hw/s390x/virtio-ccw-mem.c | 4 +++- hw/sensor/adc128d818.c | 8 ++++--- hw/sensor/adm1266.c | 3 ++- hw/sensor/adm1272.c | 9 ++++---- hw/sensor/emc141x.c | 9 ++++---- hw/sensor/isl_pmbus_vr.c | 19 +++++++-------- hw/sensor/lsm303dlhc_mag.c | 9 ++++---- hw/sensor/max34451.c | 5 ++-- hw/sensor/tmp105.c | 3 ++- hw/sensor/tmp421.c | 9 ++++---- hw/usb/dev-storage-classic.c | 3 ++- hw/virtio/virtio-balloon.c | 4 +++- hw/virtio/virtio-mem-pci.c | 4 +++- hw/virtio/virtio-mem.c | 10 +++++--- hw/xen/xen-pvh-common.c | 13 +++++++---- iothread.c | 9 ++++---- net/colo-compare.c | 7 +++--- net/dump.c | 3 ++- net/filter-buffer.c | 3 ++- qom/object.c | 36 ++++++++++++++--------------- system/bootdevice.c | 3 ++- system/memory.c | 5 ++-- target/arm/cpu64.c | 16 +++++++++---- target/arm/kvm.c | 3 ++- target/arm/tcg/cpu64.c | 6 +++-- target/i386/cpu.c | 13 ++++++----- target/i386/kvm/kvm.c | 10 ++++---- target/i386/sev.c | 7 +++--- target/ppc/compat.c | 3 ++- target/riscv/cpu.c | 19 ++++++++++----- target/riscv/kvm/kvm-cpu.c | 7 +++--- target/riscv/tcg/tcg-cpu.c | 7 +++--- target/s390x/cpu_models.c | 6 +++-- tests/unit/test-qdev-global-props.c | 9 ++++---- ui/console.c | 3 ++- util/thread-context.c | 10 +++++--- 79 files changed, 335 insertions(+), 213 deletions(-)
accel/kvm/kvm-all.c +5 -4
@@ -24,6 +24,7 @@#include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/s390x/adapter.h"
@@ -4302,15 +4303,15 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"kernel-irqchip" ,"Configure KVM in-kernel irqchip" ); -object_class_property_add (oc,"kvm-shadow-mem" ,"int" ,NULL , +object_class_property_add (oc,"kvm-shadow-mem" ,"int" , &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem,NULL ,NULL );object_class_property_set_description (oc,"kvm-shadow-mem" ,"KVM shadow MMU size" ); -object_class_property_add (oc,"dirty-ring-size" ,"uint32" ,NULL , - kvm_get_dirty_ring_size, - kvm_set_dirty_ring_size, +object_class_property_add (oc,"dirty-ring-size" ,"uint32" , + &uint32_type_info, + kvm_get_dirty_ring_size, kvm_set_dirty_ring_size,NULL ,NULL );object_class_property_set_description (oc,"dirty-ring-size" ,"Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)" );
accel/nitro/nitro-accel.c +3 -1
@@ -29,6 +29,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/rcu.h"
@@ -238,7 +239,8 @@ static void nitro_accel_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"debug-mode" ,"Start enclave in debug mode (enables console output)" ); -object_class_property_add (oc,"enclave-cid" ,"uint64" ,NULL , +object_class_property_add (oc,"enclave-cid" ,"uint64" , + &uint64_type_info, nitro_get_enclave_cid, nitro_set_enclave_cid,NULL ,NULL );
accel/tcg/tcg-all.c +2 -1
@@ -29,6 +29,7 @@#include "exec/icount.h" #include "tcg/startup.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/accel.h" #include "qemu/atomic.h"
@@ -270,7 +271,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const void *data) tcg_get_thread, tcg_set_thread); -object_class_property_add (oc,"tb-size" ,"uint32" ,NULL , +object_class_property_add (oc,"tb-size" ,"uint32" , &uint32_type_info, tcg_get_tb_size, tcg_set_tb_size,NULL ,NULL ); object_class_property_set_description(oc, "tb-size",
backends/cryptodev.c +4 -3
@@ -25,6 +25,7 @@#include "system/cryptodev.h" #include "system/stats.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-cryptodev.h" #include "qapi/qapi-types-stats.h" #include "qapi/visitor.h"
@@ -622,15 +623,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const void *data) ucc->prepare_delete = cryptodev_backend_prepare_delete;QTAILQ_INIT (&crypto_clients); -object_class_property_add (oc,"queues" ,"uint32" ,NULL , +object_class_property_add (oc,"queues" ,"uint32" , &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues,NULL ,NULL ); -object_class_property_add (oc,"throttle-bps" ,"uint64" ,NULL , +object_class_property_add (oc,"throttle-bps" ,"uint64" , &uint64_type_info, cryptodev_backend_get_bps, cryptodev_backend_set_bps,NULL ,NULL ); -object_class_property_add (oc,"throttle-ops" ,"uint64" ,NULL , +object_class_property_add (oc,"throttle-ops" ,"uint64" , &uint64_type_info, cryptodev_backend_get_ops, cryptodev_backend_set_ops,NULL ,NULL );
backends/hostmem-file.c +2 -2
@@ -275,11 +275,11 @@ file_backend_class_init(ObjectClass *oc, const void *data) file_memory_backend_get_discard_data, file_memory_backend_set_discard_data);object_class_property_add_str (oc,"mem-path" , get_mem_path, set_mem_path); -object_class_property_add (oc,"align" ,"uint64" ,NULL , +object_class_property_add (oc,"align" ,"uint64" , &uint64_type_info, file_memory_backend_get_align, file_memory_backend_set_align,NULL ,NULL ); -object_class_property_add (oc,"offset" ,"int" ,NULL , +object_class_property_add (oc,"offset" ,"int" , &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset,NULL ,NULL );
backends/hostmem-memfd.c +3 -1
@@ -16,6 +16,7 @@#include "qemu/memfd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qom/object.h" #include "migration/cpr.h" #include "system/kvm.h"
@@ -191,7 +192,8 @@ memfd_backend_class_init(ObjectClass *oc, const void *data) memfd_backend_set_hugetlb);object_class_property_set_description (oc,"hugetlb" ,"Use huge pages" ); -object_class_property_add (oc,"hugetlbsize" ,"uint64" ,NULL , +object_class_property_add (oc,"hugetlbsize" ,"uint64" , + &uint64_type_info, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize,NULL ,NULL );
backends/hostmem.c +4 -3
@@ -529,7 +529,7 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) host_memory_backend_set_prealloc);object_class_property_set_description (oc,"prealloc" ,"Preallocate memory" ); -object_class_property_add (oc,"prealloc-threads" ,"int" ,NULL , +object_class_property_add (oc,"prealloc-threads" ,"int" , &int_type_info, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads,NULL ,NULL );
@@ -540,13 +540,14 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG);object_class_property_set_description (oc,"prealloc-context" ,"Context to use for creating CPU threads for preallocation" ); -object_class_property_add (oc,"size" ,"size" ,NULL , +object_class_property_add (oc,"size" ,"size" , &size_type_info, host_memory_backend_get_size, host_memory_backend_set_size,NULL ,NULL );object_class_property_set_description (oc,"size" ,"Size of the memory region (ex: 500M)" ); -object_class_property_add (oc,"host-nodes" ,"[uint16]" ,NULL , +object_class_property_add (oc,"host-nodes" ,"[uint16]" , + &uint16List_type_info, host_memory_backend_get_host_nodes, host_memory_backend_set_host_nodes,NULL ,NULL );
block/throttle-groups.c +3 -1
@@ -31,6 +31,7 @@#include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h"
@@ -985,7 +986,8 @@ static void throttle_group_obj_class_init(ObjectClass *klass,/* individual properties */ for (i =0 ; i <sizeof (properties) /sizeof (ThrottleParamInfo); i++) { -object_class_property_add (klass, properties[i].name,"int64" ,NULL , +object_class_property_add (klass, properties[i].name,"int64" , + &int64_type_info, throttle_group_get, throttle_group_set,NULL , &properties[i]);
crypto/secret_keyring.c +5 -4
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include <asm/unistd.h> #include <linux/keyctl.h> +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qom/object_interfaces.h" #include "trace.h"
@@ -107,10 +108,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, const void *data)QCryptoSecretCommonClass *sic =QCRYPTO_SECRET_COMMON_CLASS (oc); sic->load_data = qcrypto_secret_keyring_load_data; -object_class_property_add (oc,"serial" ,"int32_t" ,NULL , - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, -NULL ,NULL ); +object_class_property_add (oc,"serial" ,"int32_t" , &int32_type_info, + qcrypto_secret_prop_get_key, + qcrypto_secret_prop_set_key, +NULL ,NULL ); }
event-loop-base.c +7 -3
@@ -14,6 +14,7 @@#include "qemu/osdep.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "block/thread-pool.h" #include "system/event-loop-base.h"
@@ -104,15 +105,18 @@ static void event_loop_base_class_init(ObjectClass *klass, ucc->complete = event_loop_base_complete; ucc->prepare_delete = event_loop_base_prepare_delete; -object_class_property_add (klass,"aio-max-batch" ,"int64" ,NULL , +object_class_property_add (klass,"aio-max-batch" ,"int64" , + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param,NULL , &aio_max_batch_info); -object_class_property_add (klass,"thread-pool-min" ,"int64" ,NULL , +object_class_property_add (klass,"thread-pool-min" ,"int64" , + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_min_info); -object_class_property_add (klass,"thread-pool-max" ,"int64" ,NULL , +object_class_property_add (klass,"thread-pool-max" ,"int64" , + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param,NULL , &thread_pool_max_info);
hw/acpi/ich9.c +3 -1
@@ -26,6 +26,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/pci/pci.h" #include "migration/vmstate.h"
@@ -379,7 +380,8 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset)PM_REG_FIELD (acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); -object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" ,NULL , +object_class_property_add (oc,ACPI_PM_PROP_GPE0_BLK ,"uint32" , + &uint32_type_info, ich9_pm_get_gpe0_blk,NULL ,NULL ,NULL ); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED,
hw/acpi/pci.c +3 -2
@@ -27,6 +27,7 @@#include "qemu/error-report.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/core/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h"
@@ -139,7 +140,7 @@ static void acpi_generic_initiator_class_init(ObjectClass *oc, const void *data) acpi_generic_initiator_set_pci_device);object_class_property_set_description (oc,"pci-dev" ,"PCI device to associate with the node" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , +object_class_property_add (oc,"node" ,"uint32" , &uint32_type_info,NULL , acpi_generic_initiator_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"NUMA node associated with the PCI device" );
@@ -253,7 +254,7 @@ static void acpi_generic_port_class_init(ObjectClass *oc, const void *data) acpi_generic_port_set_pci_bus);object_class_property_set_description (oc,"pci-bus" ,"PCI Bus of the host bridge associated with this GP affinity structure" ); -object_class_property_add (oc,"node" ,"uint32" ,NULL ,NULL , +object_class_property_add (oc,"node" ,"uint32" , &uint32_type_info,NULL , acpi_generic_port_set_node,NULL ,NULL );object_class_property_set_description (oc,"node" ,"The NUMA node like ID to index HMAT/SLIT NUMA properties involving GP" );
hw/arm/virt.c +10 -8
@@ -4254,18 +4254,20 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)"Set on/off to enable/disable high " "memory region for PCI MMIO"); -object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, -NULL ,NULL ); +object_class_property_add (oc,"highmem-mmio-size" ,"size" , + &size_type_info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, +NULL ,NULL );object_class_property_set_description (oc,"highmem-mmio-size" ,"Set the high memory region size " "for PCI MMIO" ); -object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" ,NULL , - virt_get_virtio_transports, - virt_set_virtio_transports, -NULL ,NULL ); +object_class_property_add (oc,"virtio-mmio-transports" ,"uint8" , + &uint8_type_info, + virt_get_virtio_transports, + virt_set_virtio_transports, +NULL ,NULL );object_class_property_set_description (oc,"virtio-mmio-transports" ,"Set the number of virtio-mmio transports to instantiate" );
hw/core/clock.c +3 -1
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/qtest.h" #include "hw/core/clock.h"
@@ -185,7 +186,8 @@ static void clock_initfn(Object *obj)QLIST_INIT (&clk->children);if (qtest_enabled ()) { -object_property_add (obj,"qtest-clock-period" ,"uint64" ,NULL , +object_property_add (obj,"qtest-clock-period" ,"uint64" , + &uint64_type_info, clock_period_prop_get,NULL ,NULL ,NULL ); } }
hw/core/machine.c +1 -1
@@ -1140,7 +1140,7 @@ static void machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"smp-cache" ,"Cache properties list for SMP machine" ); -object_class_property_add (oc,"phandle-start" ,"int" ,NULL , +object_class_property_add (oc,"phandle-start" ,"int" , &int_type_info, machine_get_phandle_start, machine_set_phandle_start,NULL ,NULL );
hw/cpu/core.c +3 -2
@@ -12,6 +12,7 @@#include "hw/core/boards.h" #include "hw/cpu/core.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" static void core_prop_get_core_id(Object *obj, Visitor *v, const char *name,
@@ -82,10 +83,10 @@ static void cpu_core_class_init(ObjectClass *oc, const void *data)DeviceClass *dc =DEVICE_CLASS (oc);set_bit (DEVICE_CATEGORY_CPU , dc->categories); -object_class_property_add (oc,"core-id" ,"int" ,NULL , +object_class_property_add (oc,"core-id" ,"int" , &int_type_info, core_prop_get_core_id, core_prop_set_core_id,NULL ,NULL ); -object_class_property_add (oc,"nr-threads" ,"int" ,NULL , +object_class_property_add (oc,"nr-threads" ,"int" , &int_type_info, core_prop_get_nr_threads, core_prop_set_nr_threads,NULL ,NULL ); }
hw/cxl/cxl-host.c +1 -1
@@ -611,7 +611,7 @@ static void machine_set_cfmw(Object *obj, Visitor *v, const char *name,void cxl_machine_init (Object *obj,CXLState *state) { -object_property_add (obj,"cxl" ,"bool" ,NULL , machine_get_cxl, +object_property_add (obj,"cxl" ,"bool" , &bool_type_info, machine_get_cxl, machine_set_cxl,NULL , state);object_property_set_description (obj,"cxl" , "Set on/off to enable/disable "
hw/gpio/aspeed_gpio.c +5 -2
@@ -12,6 +12,7 @@#include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_scu.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "migration/vmstate.h"
@@ -1481,7 +1482,8 @@ static void aspeed_gpio_init(Object *obj)int pin_idx = j %GPIOS_PER_GROUP ;const char *group = &props->group_label[group_idx][0 ];char *name =g_strdup_printf ("gpio%s%d" , group, pin_idx); -object_property_add (obj, name,"bool" ,NULL , aspeed_gpio_get_pin, +object_property_add (obj, name,"bool" , &bool_type_info, + aspeed_gpio_get_pin, aspeed_gpio_set_pin,NULL ,NULL );g_free (name); }
@@ -1489,7 +1491,8 @@ static void aspeed_gpio_init(Object *obj)for (int i =0 ; i < agc->nr_gpio_sets; i++) { g_autofree char *name = g_strdup_printf("gpio-set[%d]", i); -object_property_add (obj, name,"uint32" ,NULL , aspeed_gpio_get_set, +object_property_add (obj, name,"uint32" , &uint32_type_info, + aspeed_gpio_get_set, aspeed_gpio_set_set,NULL ,NULL ); } }
hw/gpio/aspeed_sgpio.c +3 -1
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h"
@@ -300,7 +301,8 @@ static void aspeed_sgpio_init(Object *obj) {for (int i =0 ; i <ASPEED_SGPIO_MAX_PIN_PAIR *2 ; i++) { g_autofree char *name = g_strdup_printf("sgpio%03d", i); -object_property_add (obj, name,"bool" ,NULL , aspeed_sgpio_get_pin, +object_property_add (obj, name,"bool" , &bool_type_info, + aspeed_sgpio_get_pin, aspeed_sgpio_set_pin,NULL ,NULL ); } }
hw/gpio/stm32l4x5_gpio.c +3 -2
@@ -25,6 +25,7 @@#include "hw/core/qdev-properties.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "trace.h"
@@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj) s->clk =qdev_init_clock_in (DEVICE (s),"clk" ,NULL , s,0 ); -object_property_add (obj,"disconnected-pins" ,"uint16" ,NULL , +object_property_add (obj,"disconnected-pins" ,"uint16" , &uint16_type_info, disconnected_pins_get, disconnected_pins_set,NULL , &s->disconnected_pins); -object_property_add (obj,"clock-freq-hz" ,"uint32" ,NULL , +object_property_add (obj,"clock-freq-hz" ,"uint32" , &uint32_type_info, clock_freq_get,NULL ,NULL ,NULL ); }
hw/hexagon/hexagon_dsp.c +3 -1
@@ -17,6 +17,7 @@#include "hw/hexagon/hex-subsys.h" #include "hw/core/loader.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/log.h"
@@ -153,7 +154,8 @@ static void hexagon_sim_set_subsystem_base(Object *obj, Visitor *v,static void add_dsp_properties (ObjectClass *oc) { -object_class_property_add (oc,"subsystem-base" ,"uint32" ,NULL , +object_class_property_add (oc,"subsystem-base" ,"uint32" , + &uint32_type_info, hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base,NULL ,NULL ); object_class_property_set_description(oc, "subsystem-base",
hw/i386/pc.c +6 -3
@@ -1718,7 +1718,8 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) mc->default_ram_id ="pc.ram" ; pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_AUTO ; -object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" ,NULL , +object_class_property_add (oc,PC_MACHINE_MAX_RAM_BELOW_4G ,"size" , + &size_type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g,NULL ,NULL );
@@ -1757,14 +1758,16 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); -object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" ,NULL , +object_class_property_add (oc,PC_MACHINE_MAX_FW_SIZE ,"size" , + &size_type_info, pc_machine_get_max_fw_size, pc_machine_set_max_fw_size,NULL ,NULL );object_class_property_set_description (oc,PC_MACHINE_MAX_FW_SIZE ,"Maximum combined firmware size" ); -object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" ,NULL , +object_class_property_add (oc,PC_MACHINE_SMBIOS_EP ,"str" , + &str_type_info, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep,NULL ,NULL );
hw/i386/sgx-epc.c +3 -1
@@ -15,6 +15,7 @@#include "hw/mem/memory-device.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "target/i386/cpu.h" #include "system/address-spaces.h"
@@ -159,7 +160,8 @@ static void sgx_epc_class_init(ObjectClass *oc, const void *data) mdc->get_memory_region = sgx_epc_md_get_memory_region; mdc->fill_device_info = sgx_epc_md_fill_device_info; -object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" ,NULL , +object_class_property_add (oc,SGX_EPC_SIZE_PROP ,"uint64" , + &uint64_type_info, sgx_epc_get_size,NULL ,NULL ,NULL );
hw/i386/x86.c +3 -3
@@ -417,9 +417,9 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) "The string may be up to 8 bytes in size");object_class_property_add (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"uint64_t" , -NULL , - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit,NULL ,NULL ); + &uint64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit,NULL ,NULL );object_class_property_set_description (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"Set the ratelimit for the bus locks acquired in VMs" );
hw/ide/ide-dev.c +2 -1
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h"
@@ -174,7 +175,7 @@ out:static void ide_dev_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" ,NULL , +object_property_add (obj,"bootindex" ,"int32" , &int32_type_info, ide_dev_get_bootindex, ide_dev_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/intc/apic_common.c +2 -1
@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h"
@@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj)APICCommonState *s =APIC_COMMON (obj); s->id = s->initial_apic_id =-1 ; -object_property_add (obj,"id" ,"uint32" ,NULL , +object_property_add (obj,"id" ,"uint32" , &uint32_type_info, apic_common_get_id, apic_common_set_id,NULL ,NULL ); }
hw/loongarch/virt.c +4 -4
@@ -1512,10 +1512,10 @@ static void virt_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"highmem-mmio" ,"Set on/off to enable/disable high " "memory region for PCI MMIO" ); -object_class_property_add (oc,"highmem-mmio-size" ,"size" ,NULL , - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, -NULL ,NULL ); +object_class_property_add (oc,"highmem-mmio-size" ,"size" , &size_type_info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, +NULL ,NULL );object_class_property_set_description (oc,"highmem-mmio-size" ,"Set the high memory region size " "for PCI MMIO" );
hw/mem/nvdimm.c +2 -1
@@ -26,6 +26,7 @@#include "qemu/module.h" #include "qemu/pmem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/mem/nvdimm.h" #include "hw/core/qdev-properties.h"
@@ -99,7 +100,7 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,static void nvdimm_init (Object *obj) { -object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,NVDIMM_LABEL_SIZE_PROP ,"size" , &size_type_info, nvdimm_get_label_size, nvdimm_set_label_size,NULL ,NULL );
hw/mem/pc-dimm.c +2 -1
@@ -26,6 +26,7 @@#include "hw/mem/nvdimm.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "system/hostmem.h"
@@ -176,7 +177,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name,static void pc_dimm_init (Object *obj) { -object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" ,NULL , +object_property_add (obj,PC_DIMM_SIZE_PROP ,"uint64" , &uint64_type_info, pc_dimm_get_size,NULL ,NULL ,NULL ); }
hw/misc/aspeed_lpc.c +13 -12
@@ -12,6 +12,7 @@#include "qemu/error-report.h" #include "hw/misc/aspeed_lpc.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h"
@@ -417,40 +418,40 @@ static void aspeed_lpc_realize(DeviceState *dev, Error **errp)static void aspeed_lpc_init (Object *obj) { -object_property_add (obj,"idr1" ,"uint32" ,NULL , +object_property_add (obj,"idr1" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr1" ,"uint32" ,NULL , +object_property_add (obj,"odr1" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str1" ,"uint32" ,NULL , +object_property_add (obj,"str1" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr2" ,"uint32" ,NULL , +object_property_add (obj,"idr2" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr2" ,"uint32" ,NULL , +object_property_add (obj,"odr2" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str2" ,"uint32" ,NULL , +object_property_add (obj,"str2" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr3" ,"uint32" ,NULL , +object_property_add (obj,"idr3" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr3" ,"uint32" ,NULL , +object_property_add (obj,"odr3" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str3" ,"uint32" ,NULL , +object_property_add (obj,"str3" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"idr4" ,"uint32" ,NULL , +object_property_add (obj,"idr4" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"odr4" ,"uint32" ,NULL , +object_property_add (obj,"odr4" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); -object_property_add (obj,"str4" ,"uint32" ,NULL , +object_property_add (obj,"str4" ,"uint32" , &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property,NULL ,NULL ); }
hw/misc/aspeed_sdmc.c +2 -1
@@ -15,6 +15,7 @@#include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "trace.h" #include "qemu/units.h" #include "qemu/cutils.h"
@@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visitor *v, const char *name,static void aspeed_sdmc_initfn (Object *obj) { -object_property_add (obj,"ram-size" ,"int" ,NULL , +object_property_add (obj,"ram-size" ,"int" , &int_type_info, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size,NULL ,NULL ); }
hw/misc/npcm7xx_mft.c +2 -1
@@ -23,6 +23,7 @@#include "hw/core/registerfields.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/bitops.h" #include "qemu/error-report.h"
@@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =qdev_init_clock_out (dev,"clock2" );for (int i =0 ; i <NPCM7XX_PWM_PER_MODULE ; ++i) { -object_property_add (obj,"max_rpm[*]" ,"uint32" ,NULL , +object_property_add (obj,"max_rpm[*]" ,"uint32" , &uint32_type_info, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm,NULL , &s->max_rpm[i]);
hw/net/ne2000-isa.c +2 -1
@@ -29,6 +29,7 @@#include "ne2000.h" #include "system/system.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h"
@@ -131,7 +132,7 @@ out:static void isa_ne2000_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" ,NULL , +object_property_add (obj,"bootindex" ,"int32" , &int32_type_info, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/nvme/ctrl.c +3 -1
@@ -203,6 +203,7 @@#include "qemu/units.h" #include "qemu/range.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/system.h" #include "system/block-backend.h"
@@ -10612,7 +10613,8 @@ static void nvme_instance_init(Object *obj)"bootindex" ,"/namespace@1,0" , DEVICE(obj)); -object_property_add (obj,"smart_critical_warning" ,"uint8" ,NULL , +object_property_add (obj,"smart_critical_warning" ,"uint8" , + &uint8_type_info, nvme_get_smart_warning, nvme_set_smart_warning,NULL ,NULL ); }
hw/pci-bridge/pci_expander_bridge.c +2 -1
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h"
@@ -103,7 +104,7 @@ static void pxb_bus_class_init(ObjectClass *class, const void *data) pbc->bus_num = pxb_bus_num; pbc->numa_node = pxb_bus_numa_node; -object_class_property_add (class,"acpi_uid" ,"uint32" ,NULL , +object_class_property_add (class,"acpi_uid" ,"uint32" , &uint32_type_info, prop_pxb_uid_get,NULL ,NULL ,NULL );object_class_property_set_description (class,"acpi_uid" ,"ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI00016" );
hw/pci-host/i440fx.c +5 -4
@@ -32,6 +32,7 @@#include "hw/core/qdev-properties.h" #include "hw/core/sysbus.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h"
@@ -388,22 +389,22 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, const void *data) dc->user_creatable = false;object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , -NULL , + &uint32_type_info, i440fx_pcihost_get_pci_hole_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , -NULL , + &uint32_type_info, i440fx_pcihost_get_pci_hole_end,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , -NULL , + &uint64_type_info, i440fx_pcihost_get_pci_hole64_start,NULL ,NULL ,NULL );object_class_property_add (klass,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , -NULL , + &uint64_type_info, i440fx_pcihost_get_pci_hole64_end,NULL ,NULL ,NULL ); }
hw/pci-host/pnv_phb3.c +3 -2
@@ -11,6 +11,7 @@#include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci-host/pnv_phb3_regs.h" #include "hw/pci-host/pnv_phb.h" #include "hw/pci-host/pnv_phb3.h"
@@ -1164,12 +1165,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , +object_class_property_add (klass,"phb-id" ,"uint32" , &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , +object_class_property_add (klass,"chip-id" ,"uint32" , &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop,NULL ,NULL );
hw/pci-host/pnv_phb4.c +3 -2
@@ -11,6 +11,7 @@#include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h"
@@ -1775,12 +1776,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClass *klass, const void *data) {BusClass *k =BUS_CLASS (klass); -object_class_property_add (klass,"phb-id" ,"uint32" ,NULL , +object_class_property_add (klass,"phb-id" ,"uint32" , &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL ); -object_class_property_add (klass,"chip-id" ,"uint32" ,NULL , +object_class_property_add (klass,"chip-id" ,"uint32" , &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop,NULL ,NULL );
hw/pci-host/q35.c +9 -4
@@ -35,6 +35,7 @@#include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h"
@@ -226,19 +227,23 @@ static void q35_host_initfn(Object *obj)qdev_prop_set_uint64 (DEVICE (s),PCI_HOST_PROP_PCI_HOLE64_SIZE ,Q35_PCI_HOST_HOLE64_SIZE_DEFAULT ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" ,NULL , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"uint32" , + &uint32_type_info, q35_host_get_pci_hole_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" ,NULL , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"uint32" , + &uint32_type_info, q35_host_get_pci_hole_end,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" ,NULL , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"uint64" , + &uint64_type_info, q35_host_get_pci_hole64_start,NULL ,NULL ,NULL ); -object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" ,NULL , +object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"uint64" , + &uint64_type_info, q35_host_get_pci_hole64_end,NULL ,NULL ,NULL );
hw/ppc/spapr_drc.c +3 -2
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qobject/qnull.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h"
@@ -584,8 +585,8 @@ static void spapr_dr_connector_instance_init(Object *obj)SpaprDrcClass *drck =SPAPR_DR_CONNECTOR_GET_CLASS (drc);object_property_add_uint32_ptr (obj,"id" , &drc->id,OBJ_PROP_FLAG_READ ); -object_property_add (obj,"index" ,"uint32" ,NULL , prop_get_index, -NULL ,NULL ,NULL ); +object_property_add (obj,"index" ,"uint32" , &uint32_type_info, + prop_get_index,NULL ,NULL ,NULL );object_property_add (obj,"fdt" ,"struct" ,NULL , prop_get_fdt,NULL ,NULL ,NULL ); drc->state = drck->empty_state;
hw/remote/vfio-user-obj.c +2 -2
@@ -933,8 +933,8 @@ static void vfu_object_class_init(ObjectClass *klass, const void *data) k->nr_devs =0 ;object_class_property_add (klass,"socket" ,"SocketAddress" , - &SocketAddress_type_info, -NULL , vfu_object_set_socket,NULL ,NULL ); + &SocketAddress_type_info,NULL , + vfu_object_set_socket,NULL ,NULL );object_class_property_set_description (klass,"socket" ,"SocketAddress " "(ex: type=unix,path=/tmp/sock). "
hw/riscv/microchip_pfsoc.c +2 -1
@@ -39,6 +39,7 @@#include "qemu/units.h" #include "qemu/cutils.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/loader.h"
@@ -744,7 +745,7 @@ static void microchip_icicle_kit_machine_class_init(ObjectClass *oc, mc->default_ram_size =1537 * MiB;object_class_property_add (oc,"clint-timebase-frequency" ,"uint32_t" , -NULL , + &uint32_type_info, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq,NULL ,NULL );
hw/s390x/sclpcpi.c +4 -2
@@ -53,6 +53,7 @@#include "qemu/timer.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h"
@@ -195,13 +196,14 @@ static void cpi_class_init(ObjectClass *klass, const void *data)"name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); -object_class_property_add (klass,"system_level" ,"uint64" ,NULL , +object_class_property_add (klass,"system_level" ,"uint64" , + &uint64_type_info, get_system_level,NULL ,NULL ,NULL );object_class_property_set_description (klass,"system_level" ,"distribution and kernel version in Linux e.g. 74872343805430528" ); -object_class_property_add (klass,"timestamp" ,"uint64" ,NULL , +object_class_property_add (klass,"timestamp" ,"uint64" , &uint64_type_info, get_timestamp,NULL ,NULL ,NULL ); object_class_property_set_description(klass, "timestamp",
hw/s390x/virtio-ccw-mem.c +3 -1
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/module.h" #include "virtio-ccw-mem.h" #include "hw/mem/memory-device.h"
@@ -205,7 +206,8 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , + &size_type_info, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size,NULL ,NULL ); }
hw/sensor/adc128d818.c +5 -3
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "qom/object.h"
@@ -642,15 +643,16 @@ static void adc128d818_initfn(Object *obj)for (unsigned ch =0u ; ch <ADC128D818_NUM_CHANNELS ; ch++) {char *name =g_strdup_printf ("ain%u" , ch); -object_property_add (obj, name,"int" ,NULL , adc128d818_get_ain, +object_property_add (obj, name,"int" , &int_type_info, + adc128d818_get_ain, adc128d818_set_ain,NULL ,NULL );g_free (name); } -object_property_add (obj,"temperature" ,"int" ,NULL , +object_property_add (obj,"temperature" ,"int" , &int_type_info, adc128d818_get_temperature, adc128d818_set_temperature,NULL ,NULL ); -object_property_add (obj,"ext-vref-mv" ,"int" ,NULL , +object_property_add (obj,"ext-vref-mv" ,"int" , &int_type_info, adc128d818_get_ext_vref, adc128d818_set_ext_vref,NULL ,NULL ); }
hw/sensor/adm1266.c +2 -1
@@ -14,6 +14,7 @@#include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h"
@@ -217,7 +218,7 @@ static void adm1266_init(Object *obj)for (int i =0 ; i <ADM1266_NUM_PAGES ; i++) {pmbus_page_config (pmdev, i, flags); -object_property_add (obj,"vout[*]" ,"uint16" ,NULL , +object_property_add (obj,"vout[*]" ,"uint16" , &uint16_type_info, adm1266_get, adm1266_set,NULL , &pmdev->pages[i].read_vout); }
hw/sensor/adm1272.c +5 -4
@@ -12,6 +12,7 @@#include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h"
@@ -493,19 +494,19 @@ static void adm1272_init(Object *obj)pmbus_page_config (pmdev,0 , flags); -object_property_add (obj,"vin" ,"uint16" ,NULL , +object_property_add (obj,"vin" ,"uint16" , &uint16_type_info, adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vin); -object_property_add (obj,"vout" ,"uint16" ,NULL , +object_property_add (obj,"vout" ,"uint16" , &uint16_type_info, adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_vout); -object_property_add (obj,"iout" ,"uint16" ,NULL , +object_property_add (obj,"iout" ,"uint16" , &uint16_type_info, adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_iout); -object_property_add (obj,"pin" ,"uint16" ,NULL , +object_property_add (obj,"pin" ,"uint16" , &uint16_type_info, adm1272_get, adm1272_set,NULL , &pmdev->pages[0 ].read_pin);
hw/sensor/emc141x.c +5 -4
@@ -22,6 +22,7 @@#include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h"
@@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev)static void emc141x_initfn (Object *obj) { -object_property_add (obj,"temperature0" ,"int" ,NULL , +object_property_add (obj,"temperature0" ,"int" , &int_type_info, emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature1" ,"int" ,NULL , +object_property_add (obj,"temperature1" ,"int" , &int_type_info, emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature2" ,"int" ,NULL , +object_property_add (obj,"temperature2" ,"int" , &int_type_info, emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); -object_property_add (obj,"temperature3" ,"int" ,NULL , +object_property_add (obj,"temperature3" ,"int" , &int_type_info, emc141x_get_temperature, emc141x_set_temperature,NULL ,NULL ); }
hw/sensor/isl_pmbus_vr.c +10 -9
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "hw/sensor/isl_pmbus_vr.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h"
@@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)PMBusDevice *pmdev =PMBUS_DEVICE (obj);for (int i =0 ; i < pages; i++) {if (flags[i] &PB_HAS_VIN ) { -object_property_add (obj,"vin[*]" ,"uint16" ,NULL , +object_property_add (obj,"vin[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vin); }if (flags[i] &PB_HAS_VOUT ) { -object_property_add (obj,"vout[*]" ,"uint16" ,NULL , +object_property_add (obj,"vout[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_vout); }if (flags[i] &PB_HAS_IIN ) { -object_property_add (obj,"iin[*]" ,"uint16" ,NULL , +object_property_add (obj,"iin[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iin); }if (flags[i] &PB_HAS_IOUT ) { -object_property_add (obj,"iout[*]" ,"uint16" ,NULL , +object_property_add (obj,"iout[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_iout); }if (flags[i] &PB_HAS_PIN ) { -object_property_add (obj,"pin[*]" ,"uint16" ,NULL , +object_property_add (obj,"pin[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pin); }if (flags[i] &PB_HAS_POUT ) { -object_property_add (obj,"pout[*]" ,"uint16" ,NULL , +object_property_add (obj,"pout[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_pout); }if (flags[i] &PB_HAS_TEMPERATURE ) { -object_property_add (obj,"temp1[*]" ,"uint16" ,NULL , +object_property_add (obj,"temp1[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_1); }if (flags[i] &PB_HAS_TEMP2 ) { -object_property_add (obj,"temp2[*]" ,"uint16" ,NULL , +object_property_add (obj,"temp2[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_2); }if (flags[i] &PB_HAS_TEMP3 ) { -object_property_add (obj,"temp3[*]" ,"uint16" ,NULL , +object_property_add (obj,"temp3[*]" ,"uint16" , &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set,NULL , &pmdev->pages[i].read_temperature_3);
hw/sensor/lsm303dlhc_mag.c +5 -4
@@ -25,6 +25,7 @@#include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h"
@@ -509,19 +510,19 @@ static void lsm303dlhc_mag_reset(DeviceState *dev)*/ static void lsm303dlhc_mag_initfn (Object *obj) { -object_property_add (obj,"mag-x" ,"int" ,NULL , +object_property_add (obj,"mag-x" ,"int" , &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x,NULL ,NULL ); -object_property_add (obj,"mag-y" ,"int" ,NULL , +object_property_add (obj,"mag-y" ,"int" , &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y,NULL ,NULL ); -object_property_add (obj,"mag-z" ,"int" ,NULL , +object_property_add (obj,"mag-z" ,"int" , &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z,NULL ,NULL ); -object_property_add (obj,"temperature" ,"int" ,NULL , +object_property_add (obj,"temperature" ,"int" , &int_type_info, lsm303dlhc_mag_get_temperature, lsm303dlhc_mag_set_temperature,NULL ,NULL ); }
hw/sensor/max34451.c +3 -2
@@ -11,6 +11,7 @@#include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h"
@@ -727,7 +728,7 @@ static void max34451_init(Object *obj)/* get and set the voltage in millivolts, max is 32767 mV */ for (int i =0 ; i <MAX34451_NUM_PWR_DEVICES ; i++) { -object_property_add (obj,"vout[*]" ,"uint16" ,NULL , +object_property_add (obj,"vout[*]" ,"uint16" , &uint16_type_info, max34451_get, max34451_set,NULL , &pmdev->pages[i].read_vout); }
@@ -737,7 +738,7 @@ static void max34451_init(Object *obj)* centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =0 ; i <MAX34451_NUM_TEMP_DEVICES ; i++) { - object_property_add(obj, "temperature[*]", "uint16", NULL, + object_property_add(obj, "temperature[*]", "uint16", &uint16_type_info, max34451_get, max34451_set, NULL,
hw/sensor/tmp105.c +2 -1
@@ -28,6 +28,7 @@#include "qemu/osdep.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qom/object.h" #include "hw/sensor/tmp105.h"
@@ -408,7 +409,7 @@ static void tmp105_realize(DeviceState *dev, Error **errp)static void tmp105_initfn (Object *obj) { -object_property_add (obj,"temperature" ,"int" ,NULL , +object_property_add (obj,"temperature" ,"int" , &int_type_info, tmp105_get_temperature, tmp105_set_temperature,NULL ,NULL ); object_property_set_description(obj, "temperature",
hw/sensor/tmp421.c +5 -4
@@ -28,6 +28,7 @@#include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h"
@@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, const void *data) dc->vmsd = &vmstate_tmp421; sc->dev = (DeviceInfo *) data; -object_class_property_add (klass,"temperature0" ,"int" ,NULL , +object_class_property_add (klass,"temperature0" ,"int" , &int_type_info, tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature1" ,"int" ,NULL , +object_class_property_add (klass,"temperature1" ,"int" , &int_type_info, tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature2" ,"int" ,NULL , +object_class_property_add (klass,"temperature2" ,"int" , &int_type_info, tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); -object_class_property_add (klass,"temperature3" ,"int" ,NULL , +object_class_property_add (klass,"temperature3" ,"int" , &int_type_info, tmp421_get_temperature, tmp421_set_temperature,NULL ,NULL ); }
hw/usb/dev-storage-classic.c +2 -1
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/usb/usb.h" #include "hw/usb/desc.h"
@@ -122,7 +123,7 @@ out:static void usb_msd_instance_init (Object *obj) { -object_property_add (obj,"bootindex" ,"int32" ,NULL , +object_property_add (obj,"bootindex" ,"int32" , &int32_type_info, usb_msd_get_bootindex, usb_msd_set_bootindex,NULL ,NULL );object_property_set_int (obj,"bootindex" ,-1 ,NULL );
hw/virtio/virtio-balloon.c +3 -1
@@ -27,6 +27,7 @@#include "hw/virtio/virtio-balloon.h" #include "system/address-spaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h"
@@ -1039,7 +1040,8 @@ static void virtio_balloon_instance_init(Object *obj)object_property_add (obj,"guest-stats" ,"guest statistics" ,NULL , balloon_stats_get_all,NULL ,NULL ,NULL ); -object_property_add (obj,"guest-stats-polling-interval" ,"int" ,NULL , +object_property_add (obj,"guest-stats-polling-interval" ,"int" , + &int_type_info, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval,NULL ,NULL );
hw/virtio/virtio-mem-pci.c +3 -1
@@ -14,6 +14,7 @@#include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h"
@@ -211,7 +212,8 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PROP);object_property_add_alias (obj,VIRTIO_MEM_SIZE_PROP ,OBJECT (&dev->vdev),VIRTIO_MEM_SIZE_PROP ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , + &size_type_info, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size,NULL ,NULL ); }
hw/virtio/virtio-mem.c +7 -3
@@ -26,6 +26,7 @@#include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-mem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "migration/misc.h" #include "hw/core/boards.h"
@@ -1533,13 +1534,16 @@ static void virtio_mem_instance_init(Object *obj)notifier_list_init (&vmem->size_change_notifiers); -object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,VIRTIO_MEM_SIZE_PROP ,"size" , + &size_type_info, virtio_mem_get_size,NULL ,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,VIRTIO_MEM_REQUESTED_SIZE_PROP ,"size" , + &size_type_info, virtio_mem_get_requested_size, virtio_mem_set_requested_size,NULL ,NULL ); -object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" ,NULL , +object_property_add (obj,VIRTIO_MEM_BLOCK_SIZE_PROP ,"size" , + &size_type_info, virtio_mem_get_block_size, virtio_mem_set_block_size,NULL ,NULL ); }
hw/xen/xen-pvh-common.c +9 -4
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/irq.h"
@@ -413,7 +414,8 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)#define OC_MEMMAP_PROP_BASE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", NULL, \ + object_class_property_add(c, prop_name "-base", "uint64_t", \ + &uint64_type_info, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \
@@ -422,7 +424,8 @@ do { \#define OC_MEMMAP_PROP_SIZE (c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ + object_class_property_add(c, prop_name "-size", "uint64_t", \ + &uint64_type_info, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \
@@ -458,7 +461,8 @@ do { \OC_MEMMAP_PROP (oc,"pci-mmio" , pci_mmio);OC_MEMMAP_PROP (oc,"pci-mmio-high" , pci_mmio_high); -object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" ,NULL , +object_class_property_add (oc,"pci-intx-irq-base" ,"uint32_t" , + &uint32_type_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base,NULL ,NULL );
@@ -468,7 +472,8 @@ do { \#ifdef CONFIG_TPM if (xpc->has_tpm) { -object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" ,NULL , +object_class_property_add (oc,"tpm-base-addr" ,"uint64_t" , + &uint64_type_info, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base,NULL ,NULL );
iothread.c +5 -4
@@ -20,6 +20,7 @@#include "system/event-loop-base.h" #include "system/iothread.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" #include "qemu/rcu.h"
@@ -315,19 +316,19 @@ static void iothread_class_init(ObjectClass *klass, const void *class_data) bc->init = iothread_init; bc->update_params = iothread_set_aio_context_params; -object_class_property_add (klass,"poll-max-ns" ,"int64" ,NULL , +object_class_property_add (klass,"poll-max-ns" ,"int64" , &int64_type_info, iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_max_ns_info); -object_class_property_add (klass,"poll-grow" ,"int64" ,NULL , +object_class_property_add (klass,"poll-grow" ,"int64" , &int64_type_info, iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_grow_info); -object_class_property_add (klass,"poll-shrink" ,"int64" ,NULL , +object_class_property_add (klass,"poll-shrink" ,"int64" , &int64_type_info, iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_shrink_info); -object_class_property_add (klass,"poll-weight" ,"int64" ,NULL , +object_class_property_add (klass,"poll-weight" ,"int64" , &int64_type_info, iothread_get_poll_param, iothread_set_poll_param,NULL , &poll_weight_info);
net/colo-compare.c +4 -3
@@ -16,6 +16,7 @@#include "qemu/error-report.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "net/net.h" #include "net/eth.h" #include "qom/object_interfaces.h"
@@ -1373,15 +1374,15 @@ static void colo_compare_init(Object *obj)object_property_add_str (obj,"notify_dev" , compare_get_notify_dev, compare_set_notify_dev); -object_property_add (obj,"compare_timeout" ,"uint64" ,NULL , +object_property_add (obj,"compare_timeout" ,"uint64" , &uint64_type_info, compare_get_timeout, compare_set_timeout,NULL ,NULL ); -object_property_add (obj,"expired_scan_cycle" ,"uint32" ,NULL , +object_property_add (obj,"expired_scan_cycle" ,"uint32" , &uint32_type_info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle,NULL ,NULL ); -object_property_add (obj,"max_queue_size" ,"uint32" ,NULL , +object_property_add (obj,"max_queue_size" ,"uint32" , &uint32_type_info, get_max_queue_size, set_max_queue_size,NULL ,NULL );
net/dump.c +2 -1
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include "clients.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h"
@@ -238,7 +239,7 @@ static void filter_dump_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"maxlen" ,"uint32" ,NULL , +object_class_property_add (oc,"maxlen" ,"uint32" , &uint32_type_info, filter_dump_get_maxlen, filter_dump_set_maxlen,NULL ,NULL ); object_class_property_add_str(oc, "file", file_dump_get_filename,
net/filter-buffer.c +2 -1
@@ -10,6 +10,7 @@#include "net/filter.h" #include "net/queue.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h"
@@ -182,7 +183,7 @@ static void filter_buffer_class_init(ObjectClass *oc, const void *data) {NetFilterClass *nfc =NETFILTER_CLASS (oc); -object_class_property_add (oc,"interval" ,"uint32" ,NULL , +object_class_property_add (oc,"interval" ,"uint32" , &uint32_type_info, filter_buffer_get_interval, filter_buffer_set_interval,NULL ,NULL );
qom/object.c +18 -18
@@ -22,10 +22,10 @@#include "qapi/string-output-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/compat-policy.h" #include "qobject/qdict.h" -#include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" #include "trace.h"
@@ -2406,7 +2406,7 @@ object_property_add_str(Object *obj, const char *name, prop->get = get; prop->set = set; - return object_property_add(obj, name, "string", NULL, + return object_property_add(obj, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data,
@@ -2424,7 +2424,7 @@ object_class_property_add_str(ObjectClass *klass, const char *name, prop->get = get; prop->set = set; - return object_class_property_add(klass, name, "string", NULL, + return object_class_property_add(klass, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL,
@@ -2476,7 +2476,7 @@ object_property_add_bool(Object *obj, const char *name, prop->get = get; prop->set = set; - return object_property_add(obj, name, "bool", NULL, + return object_property_add(obj, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data,
@@ -2493,7 +2493,7 @@ object_class_property_add_bool(ObjectClass *klass, const char *name, prop->get = get; prop->set = set; - return object_class_property_add(klass, name, "bool", NULL, + return object_class_property_add(klass, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL,
@@ -2817,7 +2817,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass, const char *name, setter = property_class_set_bool_ptr; } -return object_class_property_add (klass, name,"bool" ,NULL , +return object_class_property_add (klass, name,"bool" , &bool_type_info, getter, setter,NULL , (void *)offset); }
@@ -2837,7 +2837,7 @@ object_property_add_uint8_ptr(Object *obj, const char *name, setter = property_set_uint8_ptr; } -return object_property_add (obj, name,"uint8" ,NULL , +return object_property_add (obj, name,"uint8" , &uint8_type_info, getter, setter,NULL , (void *)v); }
@@ -2857,7 +2857,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name, setter = property_class_set_uint8_ptr; } -return object_class_property_add (klass, name,"uint8" ,NULL , +return object_class_property_add (klass, name,"uint8" , &uint8_type_info, getter, setter,NULL , (void *)offset); }
@@ -2878,7 +2878,7 @@ object_class_static_property_add_uint8_ptr(ObjectClass *klass, setter = property_set_uint8_ptr; } -return object_class_property_add (klass, name,"uint8" ,NULL , +return object_class_property_add (klass, name,"uint8" , &uint8_type_info, getter, setter,NULL , (void *)v); }
@@ -2898,7 +2898,7 @@ object_property_add_uint16_ptr(Object *obj, const char *name, setter = property_set_uint16_ptr; } -return object_property_add (obj, name,"uint16" ,NULL , +return object_property_add (obj, name,"uint16" , &uint16_type_info, getter, setter,NULL , (void *)v); }
@@ -2918,7 +2918,7 @@ object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name, setter = property_class_set_uint16_ptr; } -return object_class_property_add (klass, name,"uint16" ,NULL , +return object_class_property_add (klass, name,"uint16" , &uint16_type_info, getter, setter,NULL , (void *)offset); }
@@ -2939,7 +2939,7 @@ object_class_static_property_add_uint16_ptr(ObjectClass *klass, setter = property_set_uint16_ptr; } -return object_class_property_add (klass, name,"uint16" ,NULL , +return object_class_property_add (klass, name,"uint16" , &uint16_type_info, getter, setter,NULL , (void *)v); }
@@ -2959,7 +2959,7 @@ object_property_add_uint32_ptr(Object *obj, const char *name, setter = property_set_uint32_ptr; } -return object_property_add (obj, name,"uint32" ,NULL , +return object_property_add (obj, name,"uint32" , &uint32_type_info, getter, setter,NULL , (void *)v); }
@@ -2979,7 +2979,7 @@ object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name, setter = property_class_set_uint32_ptr; } -return object_class_property_add (klass, name,"uint32" ,NULL , +return object_class_property_add (klass, name,"uint32" , &uint32_type_info, getter, setter,NULL , (void *)offset); }
@@ -3000,7 +3000,7 @@ object_class_static_property_add_uint32_ptr(ObjectClass *klass, setter = property_set_uint32_ptr; } -return object_class_property_add (klass, name,"uint32" ,NULL , +return object_class_property_add (klass, name,"uint32" , &uint32_type_info, getter, setter,NULL , (void *)v); }
@@ -3020,7 +3020,7 @@ object_property_add_uint64_ptr(Object *obj, const char *name, setter = property_set_uint64_ptr; } -return object_property_add (obj, name,"uint64" ,NULL , +return object_property_add (obj, name,"uint64" , &uint64_type_info, getter, setter,NULL , (void *)v); }
@@ -3040,7 +3040,7 @@ object_class_property_add_uint64_ptr(ObjectClass *klass, const char *name, setter = property_class_set_uint64_ptr; } -return object_class_property_add (klass, name,"uint64" ,NULL , +return object_class_property_add (klass, name,"uint64" , &uint64_type_info, getter, setter,NULL , (void *)offset); }
@@ -3061,7 +3061,7 @@ object_class_static_property_add_uint64_ptr(ObjectClass *klass, setter = property_set_uint64_ptr; } -return object_class_property_add (klass, name,"uint64" ,NULL , +return object_class_property_add (klass, name,"uint64" , &uint64_type_info, getter, setter,NULL , (void *)v); }
system/bootdevice.c +2 -1
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "qapi/visitor.h" #include "qemu/error-report.h"
@@ -336,7 +337,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, prop->suffix = suffix; prop->dev = dev; - object_property_add(obj, name, "int32", NULL, + object_property_add(obj, name, "int32", &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex,
system/memory.c +3 -2
@@ -16,6 +16,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/memory.h" #include "qapi/visitor.h" #include "qemu/bitops.h"
@@ -1293,11 +1294,11 @@ static void memory_region_initfn(Object *obj)object_property_add_uint64_ptr (OBJECT (mr),"addr" , &mr->addr,OBJ_PROP_FLAG_READ ); -object_property_add (OBJECT (mr),"priority" ,"int32" ,NULL , +object_property_add (OBJECT (mr),"priority" ,"int32" , &int32_type_info, memory_region_get_priority,NULL ,/* memory_region_set_priority */ NULL ,NULL ); -object_property_add (OBJECT (mr),"size" ,"uint64" ,NULL , +object_property_add (OBJECT (mr),"size" ,"uint64" , &uint64_type_info, memory_region_get_size,NULL ,/* memory_region_set_size, */ NULL ,NULL );
target/arm/cpu64.c +11 -5
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "cpregs.h" #include "qemu/module.h"
@@ -328,7 +329,8 @@ static void prop_bool_set_false(Object *obj, Visitor *v, const char *name,static void prop_add_stub_bool (Object *obj,const char *name) { -object_property_add (obj, name,"bool" ,NULL , prop_bool_get_false, +object_property_add (obj, name,"bool" , &bool_type_info, + prop_bool_get_false, prop_bool_set_false,NULL ,NULL ); }
@@ -518,13 +520,15 @@ void aarch64_add_sve_properties(Object *obj)for (vq =1 ; vq <=ARM_MAX_VQ ; ++vq) {char name[8 ];snprintf (name,sizeof (name),"sve%d" , vq *128 ); -object_property_add (obj, name,"bool" ,NULL , cpu_arm_get_vq, +object_property_add (obj, name,"bool" , &bool_type_info, + cpu_arm_get_vq, cpu_arm_set_vq,NULL , &cpu->sve_vq); }#ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ -object_property_add (obj,"sve-default-vector-length" ,"int32" ,NULL , +object_property_add (obj,"sve-default-vector-length" ,"int32" , + &int32_type_info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len,NULL , &cpu->sve_default_vq);
@@ -543,13 +547,15 @@ void aarch64_add_sme_properties(Object *obj)for (vq =1 ; vq <=ARM_MAX_VQ ; vq <<=1 ) {char name[8 ];snprintf (name,sizeof (name),"sme%d" , vq *128 ); -object_property_add (obj, name,"bool" ,NULL , cpu_arm_get_vq, +object_property_add (obj, name,"bool" , &bool_type_info, + cpu_arm_get_vq, cpu_arm_set_vq,NULL , &cpu->sme_vq); }#ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ -object_property_add (obj,"sme-default-vector-length" ,"int32" ,NULL , +object_property_add (obj,"sme-default-vector-length" ,"int32" , + &int32_type_info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len,NULL , &cpu->sme_default_vq);
target/arm/kvm.c +2 -1
@@ -20,6 +20,7 @@#include "qemu/main-loop.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "system/runstate.h" #include "system/ramblock.h"
@@ -1820,7 +1821,7 @@ static void kvm_arch_set_eager_split_size(Object *obj, Visitor *v,void kvm_arch_accel_class_init (ObjectClass *oc) { -object_class_property_add (oc,"eager-split-size" ,"size" ,NULL , +object_class_property_add (oc,"eager-split-size" ,"size" , &size_type_info, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size,NULL ,NULL );
target/arm/tcg/cpu64.c +4 -2
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "qemu/module.h" #include "qapi/visitor.h"
@@ -1392,7 +1393,7 @@ void aarch64_max_v8_tcg_initfn(Object *obj)/* v8.2: FEAT_SVE */ cpu->sve_vq.supported =MAKE_64BIT_MASK (0 ,ARM_MAX_VQ );aarch64_add_sve_properties (OBJECT (cpu)); -object_property_add (OBJECT (cpu),"sve-max-vq" ,"uint32" ,NULL , +object_property_add (OBJECT (cpu),"sve-max-vq" ,"uint32" , &uint32_type_info, cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq,NULL ,NULL );
@@ -1529,7 +1530,8 @@ void aarch64_max_v9_tcg_initfn(Object *obj)object_property_add_bool (obj,"x-rme" , cpu_arm_get_rme, cpu_arm_set_rme);/* v9.4: FEAT_RME_GPC2 */ -object_property_add (obj,"x-l0gptsz" ,"uint32" ,NULL , cpu_max_get_l0gptsz, +object_property_add (obj,"x-l0gptsz" ,"uint32" , &uint32_type_info, + cpu_max_get_l0gptsz, cpu_max_set_l0gptsz,NULL ,NULL ); }
target/i386/cpu.c +7 -6
@@ -10486,7 +10486,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *xcc, fp =g_new0 (BitProperty,1 ); fp->w = w; fp->mask = mask; -object_class_property_add (oc, prop_name,"bool" ,NULL , +object_class_property_add (oc, prop_name,"bool" , &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop,NULL , fp);
@@ -11009,13 +11009,13 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data) dc->user_creatable = true; -object_class_property_add (oc,"family" ,"uint64" ,NULL , +object_class_property_add (oc,"family" ,"uint64" , &uint64_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family,NULL ,NULL ); -object_class_property_add (oc,"model" ,"uint64" ,NULL , +object_class_property_add (oc,"model" ,"uint64" , &uint64_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model,NULL ,NULL ); -object_class_property_add (oc,"stepping" ,"uint64" ,NULL , +object_class_property_add (oc,"stepping" ,"uint64" , &uint64_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping,NULL ,NULL ); object_class_property_add_str(oc, "vendor",
@@ -11024,7 +11024,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data)object_class_property_add_str (oc,"model-id" , x86_cpuid_get_model_id, x86_cpuid_set_model_id); -object_class_property_add (oc,"tsc-frequency" ,"int" ,NULL , +object_class_property_add (oc,"tsc-frequency" ,"int" , &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq,NULL ,NULL );/*
@@ -11037,7 +11037,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data) x86_cpu_get_unavailable_features, NULL, NULL, NULL); -object_class_property_add (oc,"avx10-version" ,"uint8" ,NULL , +object_class_property_add (oc,"avx10-version" ,"uint8" , + &uint8_type_info, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version,NULL ,NULL );
target/i386/kvm/kvm.c +6 -4
@@ -7098,7 +7098,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc)object_class_property_set_description (oc,"notify-vmexit" ,"Enable notify VM exit" ); -object_class_property_add (oc,"notify-window" ,"uint32" ,NULL , +object_class_property_add (oc,"notify-window" ,"uint32" , &uint32_type_info, kvm_arch_get_notify_window, kvm_arch_set_notify_window,NULL ,NULL );
@@ -7106,7 +7106,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc)"Clock cycles without an event window " "after which a notification VM exit occurs"); -object_class_property_add (oc,"xen-version" ,"uint32" ,NULL , +object_class_property_add (oc,"xen-version" ,"uint32" , &uint32_type_info, kvm_arch_get_xen_version, kvm_arch_set_xen_version,NULL ,NULL );
@@ -7115,14 +7115,16 @@ void kvm_arch_accel_class_init(ObjectClass *oc)"(in XENVER_version form " "e.g. 0x4000a for 4.10)"); -object_class_property_add (oc,"xen-gnttab-max-frames" ,"uint16" ,NULL , +object_class_property_add (oc,"xen-gnttab-max-frames" ,"uint16" , + &uint16_type_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames,NULL ,NULL );object_class_property_set_description (oc,"xen-gnttab-max-frames" ,"Maximum number of grant table frames" ); -object_class_property_add (oc,"xen-evtchn-max-pirq" ,"uint16" ,NULL , +object_class_property_add (oc,"xen-evtchn-max-pirq" ,"uint16" , + &uint16_type_info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq,NULL ,NULL );
target/i386/sev.c +4 -3
@@ -3051,7 +3051,8 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =DEFAULT_GUEST_POLICY ;object_property_add_uint32_ptr (obj,"handle" , &sev_guest->handle,OBJ_PROP_FLAG_READWRITE ); -object_property_add (obj,"policy" ,"uint32" ,NULL , sev_guest_get_policy, +object_property_add (obj,"policy" ,"uint32" , &uint32_type_info, + sev_guest_get_policy, sev_guest_set_policy,NULL ,NULL );object_apply_compat_props (obj);
@@ -3329,7 +3330,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void *data) x86_klass->adjust_cpuid_features = sev_snp_adjust_cpuid_features; x86_klass->kvm_type = sev_snp_kvm_type; -object_class_property_add (oc,"policy" ,"uint64" ,NULL , +object_class_property_add (oc,"policy" ,"uint64" , &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy,NULL ,NULL ); object_class_property_add_str(oc, "guest-visible-workarounds",
@@ -3353,7 +3354,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void *data)object_class_property_add_bool (oc,"secure-tsc" , sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); -object_class_property_add (oc,"tsc-frequency" ,"uint32" ,NULL , +object_class_property_add (oc,"tsc-frequency" ,"uint32" , &uint64_type_info, sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency,NULL ,NULL ); }
target/ppc/compat.c +2 -1
@@ -23,6 +23,7 @@#include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h"
@@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *name,gchar *names, *desc;int i; -object_property_add (obj, name,"string" ,NULL , +object_property_add (obj, name,"string" , &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set,NULL , compat_pvr);
target/riscv/cpu.c +13 -6
@@ -29,6 +29,7 @@#include "target/riscv/tcg/csr.h" #include "internals.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/timer.h"
@@ -1412,20 +1413,26 @@ void riscv_add_satp_mode_properties(Object *obj) {RISCVCPU *cpu =RISCV_CPU (obj); -object_property_add (obj,"svbare" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"svbare" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes);if (cpu->env.misa_mxl ==MXL_RV32 ) { -object_property_add (obj,"sv32" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"sv32" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); }else { -object_property_add (obj,"sv39" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"sv39" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv48" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"sv48" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv57" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"sv57" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); -object_property_add (obj,"sv64" ,"bool" ,NULL , cpu_riscv_get_satp, +object_property_add (obj,"sv64" ,"bool" , &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp,NULL , &cpu->satp_modes); } }
target/riscv/kvm/kvm-cpu.c +4 -3
@@ -24,6 +24,7 @@#include "qemu/timer.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/target-info.h"
@@ -541,7 +542,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj, const char *prop_name)* unknown to KVM and error out if the user attempts * to enable any of them. */ -object_property_add (obj, prop_name,"bool" ,NULL , +object_property_add (obj, prop_name,"bool" , &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable,NULL , (void *)prop_name);
@@ -561,7 +562,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *cpu_obj) misa_cfg->name =riscv_get_misa_ext_name (bit); misa_cfg->description =riscv_get_misa_ext_description (bit); -object_property_add (cpu_obj, misa_cfg->name,"bool" ,NULL , +object_property_add (cpu_obj, misa_cfg->name,"bool" , &bool_type_info, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg,NULL , misa_cfg);
@@ -577,7 +578,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *cpu_obj)for (i =0 ; i <ARRAY_SIZE (kvm_multi_ext_cfgs); i++) {KVMCPUConfig *multi_cfg = &kvm_multi_ext_cfgs[i]; -object_property_add (cpu_obj, multi_cfg->name,"bool" ,NULL , +object_property_add (cpu_obj, multi_cfg->name,"bool" , &bool_type_info, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg,NULL , multi_cfg);
target/riscv/tcg/tcg-cpu.c +4 -3
@@ -26,6 +26,7 @@#include "pmu.h" #include "time_helper.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/accel.h" #include "qemu/error-report.h"
@@ -1478,7 +1479,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu_obj)continue ; } -object_property_add (cpu_obj, name,"bool" ,NULL , +object_property_add (cpu_obj, name,"bool" , &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg,NULL , (void *)misa_cfg);
@@ -1532,7 +1533,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj)for (int i =0 ; riscv_profiles[i] !=NULL ; i++) {RISCVCPUProfile *profile = riscv_profiles[i]; -object_property_add (cpu_obj, profile->name,"bool" ,NULL , +object_property_add (cpu_obj, profile->name,"bool" , &bool_type_info, cpu_get_profile, cpu_set_profile,NULL , (void *)profile);
@@ -1608,7 +1609,7 @@ static void riscv_cpu_add_user_properties(Object *obj)for (edata = isa_edata_arr; edata && edata->name; edata++) {if (edata->prop_name) { -object_property_add (obj, edata->prop_name,"bool" ,NULL , +object_property_add (obj, edata->prop_name,"bool" , &bool_type_info, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg,NULL , (void *)&edata->ext_enable_offset);
target/s390x/cpu_models.c +4 -2
@@ -17,6 +17,7 @@#include "system/kvm.h" #include "system/tcg.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qapi/visitor.h" #include "qemu/module.h"
@@ -792,13 +793,14 @@ void s390_cpu_model_class_register_props(ObjectClass *oc)for (feat =0 ; feat <S390_FEAT_MAX ; feat++) {const S390FeatDef *def =s390_feat_def (feat); -object_class_property_add (oc, def->name,"bool" ,NULL , get_feature, +object_class_property_add (oc, def->name,"bool" , &bool_type_info, + get_feature, set_feature,NULL , (void *) feat);object_class_property_set_description (oc, def->name, def->desc); }for (group =0 ; group <S390_FEAT_GROUP_MAX ; group++) {const S390FeatGroupDef *def =s390_feat_group_def (group); -object_class_property_add (oc, def->name,"bool" ,NULL , +object_class_property_add (oc, def->name,"bool" , &bool_type_info, get_feature_group, set_feature_group,NULL , (void *) group);object_class_property_set_description (oc, def->name, def->desc);
tests/unit/test-qdev-global-props.c +5 -4
@@ -27,6 +27,7 @@#include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h"
@@ -171,11 +172,11 @@ static void prop2_accessor(Object *obj, Visitor *v, const char *name,static void dynamic_instance_init (Object *obj) { -object_property_add (obj,"prop1" ,"uint32" ,NULL , prop1_accessor, - prop1_accessor, +object_property_add (obj,"prop1" ,"uint32" , &uint32_type_info, + prop1_accessor, prop1_accessor,NULL ,NULL ); -object_property_add (obj,"prop2" ,"uint32" ,NULL , prop2_accessor, - prop2_accessor, +object_property_add (obj,"prop2" ,"uint32" , &uint32_type_info, + prop2_accessor, prop2_accessor,NULL ,NULL ); }
ui/console.c +2 -1
@@ -28,6 +28,7 @@#include "ui/vgafont.h" #include "hw/core/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-ui.h" #include "qapi/visitor.h" #include "qemu/coroutine.h"
@@ -535,7 +536,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const void *data) offsetof(QemuGraphicConsole , device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); -object_class_property_add (oc,"head" ,"uint32" ,NULL , +object_class_property_add (oc,"head" ,"uint32" , &uint32_type_info, qemu_graphic_console_prop_get_head,NULL ,NULL ,NULL );
util/thread-context.c +7 -3
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "qemu/thread-context.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h"
@@ -278,13 +279,16 @@ static void thread_context_class_init(ObjectClass *oc, const void *data)UserCreatableClass *ucc =USER_CREATABLE_CLASS (oc); ucc->complete = thread_context_instance_complete; -object_class_property_add (oc,"thread-id" ,"uint64" ,NULL , +object_class_property_add (oc,"thread-id" ,"uint64" , + &uint64_type_info, thread_context_get_thread_id,NULL ,NULL ,NULL ); -object_class_property_add (oc,"cpu-affinity" ,"[uint16]" ,NULL , +object_class_property_add (oc,"cpu-affinity" ,"[uint16]" , + &uint16List_type_info, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity,NULL ,NULL ); -object_class_property_add (oc,"node-affinity" ,"[uint16]" ,NULL ,NULL , +object_class_property_add (oc,"node-affinity" ,"[uint16]" , + &uint16List_type_info,NULL , thread_context_set_node_affinity,NULL ,NULL ); }
Signature · 1 line
2.55.0
PATCH v8 37/56 i386/cpu: convert strList property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_class_property_add().
--- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target/i386/cpu.c +2 -1
@@ -11033,7 +11033,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, const void *data)* QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ -object_class_property_add (oc,"unavailable-features" ,"strList" ,NULL , +object_class_property_add (oc,"unavailable-features" ,"strList" , + &strList_type_info, x86_cpu_get_unavailable_features,NULL ,NULL ,NULL );
Signature · 1 line
2.55.0
PATCH v8 38/56 accel/hvf: convert OnOffSplit property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum().
--- accel/hvf/hvf-all.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
accel/hvf/hvf-all.c +8 -16
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "accel/accel-ops.h" #include "exec/cpu-common.h"
@@ -230,18 +231,12 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)return hvf_arch_init (); } -static void hvf_set_kernel_irqchip (Object *obj,Visitor *v, -const char *name,void *opaque, +static void hvf_set_kernel_irqchip (Object *obj,int value,Error **errp) { -OnOffSplit mode; - hvf_kernel_irqchip_override = true; -if (!visit_type_OnOffSplit (v, name, &mode, errp)) { -return ; - } -switch (mode) { +switch (value) {case ON_OFF_SPLIT_ON :#ifdef HOST_X86_64 /* macOS 12 onwards exposes an HVF virtual APIC. */
@@ -261,11 +256,7 @@ static void hvf_set_kernel_irqchip(Object *obj, Visitor *v,break ;default : -/* -* The value was checked in visit_type_OnOffSplit() above. If -* we get here, then something is wrong in QEMU. -*/ -abort (); +g_assert_not_reached (); } }
@@ -277,9 +268,10 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data) ac->allowed = &hvf_allowed; hvf_kernel_irqchip_override = false; hvf_kernel_irqchip = false; -object_class_property_add (oc,"kernel-irqchip" ,"on|off|split" ,NULL , -NULL , hvf_set_kernel_irqchip, -NULL ,NULL ); + +object_class_property_add_enum (oc,"kernel-irqchip" ,"on|off|split" , + &OnOffSplit_type_info,NULL , +NULL , hvf_set_kernel_irqchip);object_class_property_set_description (oc,"kernel-irqchip" ,"Configure HVF irqchip" ); }
Signature · 1 line
2.55.0
PATCH v8 39/56 i386/x86: convert SgxEPCList property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_class_property_add().
--- hw/i386/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/x86.c +2 -1
@@ -25,6 +25,7 @@#include "qemu/units.h" #include "qapi/error.h" #include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h"
@@ -423,7 +424,7 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,X86_MACHINE_BUS_LOCK_RATELIMIT ,"Set the ratelimit for the bus locks acquired in VMs" ); -object_class_property_add (oc,"sgx-epc" ,"SgxEPC" ,NULL , +object_class_property_add (oc,"sgx-epc" ,"SgxEPC" , &SgxEPCList_type_info, machine_get_sgx_epc, machine_set_sgx_epc,NULL ,NULL ); object_class_property_set_description(oc, "sgx-epc",
Signature · 1 line
2.55.0
PATCH v8 40/56 virtio-balloon: convert guest-stats property to QAPI type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Define VirtioBalloonStats and VirtioBalloonGuestStats QAPI struct types in the schema, replacing the hand-rolled visitor in balloon_stats_get_all() with a generated visit_type_VirtioBalloonGuestStats() call.
The wire format is preserved: the JSON output from qom-get is identical to the previous hand-rolled visitor output.
--- docs/interop/virtio-balloon-stats.rst | 22 +------ qapi/machine.json | 88 +++++++++++++++++++++++++++ hw/virtio/virtio-balloon.c | 85 +++++++++----------------- 3 files changed, 119 insertions(+), 76 deletions(-)
docs/interop/virtio-balloon-stats.rst +1 -21
@@ -22,27 +22,7 @@ polling the guest's balloon driver for new stats in the specified time interval. To retrieve those stats, clients have to query the guest-stats property, -which will return a dictionary containing: - - * A key named 'stats', containing all available stats. If the guest - doesn't support a particular stat, or if it couldn't be retrieved, - its value will be -1. Currently, the following stats are supported: - - - stat-swap-in - - stat-swap-out - - stat-major-faults - - stat-minor-faults - - stat-free-memory - - stat-total-memory - - stat-available-memory - - stat-disk-caches - - stat-htlb-pgalloc - - stat-htlb-pgfail - - * A key named last-update, which contains the last stats update - timestamp in seconds. Since this timestamp is generated by the host, - a buggy guest can't influence its value. The value is 0 if the guest - has not updated the stats (yet). +which will return a VirtioBalloonGuestStats (see QAPI documentation). It's also important to note the following:
qapi/machine.json +88 -0
94 lines not on this page · raw message
hw/virtio/virtio-balloon.c +30 -55
110 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v8 41/56 qom: replace object_property_add_tm with StructTm QAPI type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Define a StructTm QAPI struct in common.json matching the existing "struct tm" property wire format (tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec as int32).
Convert the two callers (mc146818rtc and spapr_rtc) to pass its QAPITypeInfo to object_class_property_add() / object_property_add(), and use a standard ObjectPropertyAccessor that populates a StructTm and calls the generated visitor.
Remove object_property_add_tm(), object_class_property_add_tm(), the TMProperty type, and the property_get_tm() helper from qom/object.c, along with their declarations in object.h.
--- qapi/common.json | 27 +++++++++++++++++ qapi/pragma.json | 1 + include/qom/object.h | 29 ------------------ hw/ppc/spapr_rtc.c | 25 ++++++++++++++-- hw/rtc/mc146818rtc.c | 23 +++++++++++++-- qom/object.c | 70 -------------------------------------------- 6 files changed, 70 insertions(+), 105 deletions(-)
qapi/common.json +27 -0
@@ -218,3 +218,30 @@ ## { 'enum': 'EndianMode', 'data': [ 'unspecified', 'little', 'big' ] } + +## +# @StructTm: +# Broken-down time. Field semantics match C ``struct tm``. +# +# @tm_year: years since 1900 +# +# @tm_mon: months since January (0-11) +# +# @tm_mday: day of the month (1-31) +# +# @tm_hour: hours since midnight (0-23) +# +# @tm_min: minutes after the hour (0-59) +# +# @tm_sec: seconds after the minute (0-59, 60-61 for leap seconds) +# +# Since: 11.2 +## +{ 'struct': 'StructTm', + 'data': { + 'tm_year': 'int32', + 'tm_mon': 'int32', + 'tm_mday': 'int32', + 'tm_hour': 'int32', + 'tm_min': 'int32', + 'tm_sec': 'int32' } }
qapi/pragma.json +1 -0
@@ -109,6 +109,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ...
include/qom/object.h +0 -29
@@ -2027,35 +2027,6 @@ ObjectProperty *object_class_property_add_enum(ObjectClass *klass,int (*get)(Object *,Error **), void (*set)(Object *, int, Error **)); -/** -* object_property_add_tm: -* @obj: the object to add a property to -* @name: the name of the property -* @get: the getter or NULL if the property is write-only. -* -* Add a read-only struct tm valued property using a getter function. -* This function will add a property of type 'struct tm'. -* -* Returns: The newly added property on success, or %NULL on failure. -*/ -ObjectProperty *object_property_add_tm (Object *obj,const char *name, -void (*get)(Object *,struct tm *,Error **)); - -/** -* object_class_property_add_tm: -* @klass: the object class to add a property to -* @name: the name of the property -* @get: the getter or NULL if the property is write-only. -* -* Add a read-only struct tm valued property using a getter function. -* This function will add a property of type 'struct tm'. -* -* Returns: The newly added property on success, or %NULL on failure. -*/ -ObjectProperty *object_class_property_add_tm (ObjectClass *klass, -const char *name, -void (*get)(Object *,struct tm *,Error **)); - typedef enum { /* Automatically add a getter to the property */ OBJ_PROP_FLAG_READ = 1 << 0,
hw/ppc/spapr_rtc.c +22 -3
@@ -33,6 +33,9 @@#include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" +#include "qapi/visitor.h" #include "qemu/cutils.h" #include "qemu/module.h"
@@ -131,9 +134,23 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, SpaprMachineState *spapr,rtas_st (rets,0 ,RTAS_OUT_SUCCESS ); } -static void spapr_rtc_qom_date (Object *obj,struct tm *current_tm,Error **errp) +static void spapr_rtc_qom_date (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) { -spapr_rtc_read (SPAPR_RTC (obj), current_tm,NULL ); +struct tm value; +StructTm tm, *tmp = &tm; + +spapr_rtc_read (SPAPR_RTC (obj), &value,NULL ); + + tm = (StructTm ) { + .tm_year = value.tm_year, + .tm_mon = value.tm_mon, + .tm_mday = value.tm_mday, + .tm_hour = value.tm_hour, + .tm_min = value.tm_min, + .tm_sec = value.tm_sec, + }; +visit_type_StructTm (v, name, &tmp, errp); }static void spapr_rtc_realize (DeviceState *dev,Error **errp)
@@ -150,7 +167,9 @@ static void spapr_rtc_realize(DeviceState *dev, Error **errp) rtc_ns =qemu_clock_get_ns (rtc_clock); rtc->ns_offset = host_s *NANOSECONDS_PER_SECOND - rtc_ns; -object_property_add_tm (OBJECT (rtc),"date" , spapr_rtc_qom_date); +object_property_add (OBJECT (rtc),"date" ,"struct tm" , + &StructTm_type_info, + spapr_rtc_qom_date,NULL ,NULL ,NULL ); }static const VMStateDescription vmstate_spapr_rtc = {
hw/rtc/mc146818rtc.c +20 -3
@@ -42,6 +42,8 @@#include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" #include "trace.h"
@@ -854,12 +856,25 @@ static const MemoryRegionOps cmos_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; -static void rtc_get_date (Object *obj,struct tm *current_tm,Error **errp) +static void rtc_get_date (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {MC146818RtcState *s =MC146818_RTC (obj); +struct tm value; +StructTm tm, *tmp = &tm;rtc_update_time (s); -rtc_get_time (s, current_tm); +rtc_get_time (s, &value); + + tm = (StructTm ) { + .tm_year = value.tm_year, + .tm_mon = value.tm_mon, + .tm_mday = value.tm_mday, + .tm_hour = value.tm_hour, + .tm_min = value.tm_min, + .tm_sec = value.tm_sec, + }; +visit_type_StructTm (v, name, &tmp, errp); }static void rtc_realizefn (DeviceState *dev,Error **errp)
@@ -1019,7 +1034,9 @@ static void rtc_class_initfn(ObjectClass *klass, const void *data)device_class_set_props (dc, mc146818rtc_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); -object_class_property_add_tm (klass,"date" , rtc_get_date); +object_class_property_add (klass,"date" ,"struct tm" , + &StructTm_type_info, + rtc_get_date,NULL ,NULL ,NULL ); }static const TypeInfo mc146818rtc_info = {
qom/object.c +0 -70
76 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v8 42/56 hw/nvdimm: convert UUID property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_property_add().
--- hw/mem/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/nvdimm.c +1 -1
@@ -104,7 +104,7 @@ static void nvdimm_init(Object *obj) nvdimm_get_label_size, nvdimm_set_label_size,NULL , NULL); -object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" ,NULL , +object_property_add (obj,NVDIMM_UUID_PROP ,"QemuUUID" , &str_type_info, nvdimm_get_uuid, nvdimm_set_uuid,NULL ,NULL ); }
Signature · 1 line
2.55.0
PATCH v8 43/56 hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_class_property_add().
--- hw/s390x/s390-virtio-ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +2 -1
@@ -43,6 +43,7 @@#include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h"
@@ -908,7 +909,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)object_class_property_set_description (oc,"dea-key-wrap" ,"enable/disable DEA key wrapping using the CPACF wrapping key" ); -object_class_property_add (oc,"loadparm" ,"loadparm" ,NULL , +object_class_property_add (oc,"loadparm" ,"loadparm" , &str_type_info, machine_get_loadparm, machine_set_loadparm,NULL ,NULL ); object_class_property_set_description(oc, "loadparm",
Signature · 1 line
2.55.0
PATCH v8 44/56 hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Use object_property_add_qapi() with any_type_info for the "fdt" property, since the FDT structure is dynamically shaped at runtime and cannot be represented as a static QAPI type.
--- hw/ppc/spapr_drc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_drc.c +1 -1
@@ -587,7 +587,7 @@ static void spapr_dr_connector_instance_init(Object *obj)object_property_add_uint32_ptr (obj,"id" , &drc->id,OBJ_PROP_FLAG_READ );object_property_add (obj,"index" ,"uint32" , &uint32_type_info, prop_get_index,NULL ,NULL ,NULL ); -object_property_add (obj,"fdt" ,"struct" ,NULL , prop_get_fdt, +object_property_add (obj,"fdt" ,"struct" , &any_type_info, prop_get_fdt,NULL ,NULL ,NULL ); drc->state = drck->empty_state; }
Signature · 1 line
2.55.0
PATCH v8 45/56 hw/s390x: convert BootCertificatesList to QAPI-aware registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Pass appropriate QAPITypeInfo to object_class_property_add().
--- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +3 -1
@@ -44,6 +44,7 @@#include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-machine-s390x.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h"
@@ -917,7 +918,8 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)" to upper case) to pass to machine loader, boot manager," " and guest kernel"); -object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" ,NULL , +object_class_property_add (oc,"boot-certs" ,"BootCertificatesList" , + &BootCertificatesList_type_info, machine_get_boot_certs, machine_set_boot_certs,NULL ,NULL );object_class_property_set_description (oc,"boot-certs" ,"provide paths to a directory and/or a certificate file for secure boot" );
Signature · 1 line
2.55.0
PATCH v8 46/56 qdev: add qapi_type field to PropertyInfo with fallback registration
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info.
Update qdev_property_add_static() and qdev_class_add_property() to pass qapi_type instead of NULL to object_property_add() and object_class_property_add().
Update the shared enum accessor functions to prefer .qapi_type->lookup over .enum_table via a new qdev_propinfo_enum_lookup() helper.
No PropertyInfo definitions are changed, all .qapi_type fields default to NULL, so this patch is no-op for now.
--- include/hw/core/qdev-properties.h | 1 + hw/core/qdev-properties.c | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-)
include/hw/core/qdev-properties.h +1 -0
@@ -34,6 +34,7 @@ struct PropertyInfo {const char *type;const char *description;const QEnumLookup *enum_table; +const QAPITypeInfo *qapi_type;bool realized_set_allowed;/* allow setting property on realized device */ char *(*print)(Object *obj,const Property *prop);void (*set_default_value)(ObjectProperty *op,const Property *prop);
hw/core/qdev-properties.c +19 -7
@@ -99,13 +99,22 @@ static ObjectPropertyAccessor *field_prop_setter(const PropertyInfo *info)return info->set ? field_prop_set :NULL ; } +static const QEnumLookup *qdev_propinfo_enum_lookup (const PropertyInfo *info) +{ +if (info->qapi_type) { +assert (info->qapi_type->lookup); +return info->qapi_type->lookup; + } +return info->enum_table; +} +void qdev_propinfo_get_enum (Object *obj,Visitor *v,const char *name,void *opaque,Error **errp) {const Property *prop = opaque;int *ptr =object_field_prop_ptr (obj, prop); -visit_type_enum (v, name, ptr, prop->info->enum_table, errp); +visit_type_enum (v, name, ptr,qdev_propinfo_enum_lookup (prop->info), errp); } void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
@@ -114,14 +123,15 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,const Property *prop = opaque;int *ptr =object_field_prop_ptr (obj, prop); -visit_type_enum (v, name, ptr, prop->info->enum_table, errp); +visit_type_enum (v, name, ptr,qdev_propinfo_enum_lookup (prop->info), errp); }void qdev_propinfo_set_default_value_enum (ObjectProperty *op,const Property *prop) {object_property_set_default_str (op, -qapi_enum_lookup (prop->info->enum_table, prop->defval.i)); +qapi_enum_lookup (qdev_propinfo_enum_lookup (prop->info), + prop->defval.i)); }/* Bit */
@@ -941,8 +951,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *name, int value) prop =qdev_prop_find (dev, name);object_property_set_str (OBJECT (dev), name, -qapi_enum_lookup (prop->info->enum_table, value), - &error_abort); +qapi_enum_lookup (qdev_propinfo_enum_lookup (prop->info), value), + &error_abort); }void qdev_prop_set_array (DeviceState *dev,const char *name,QList *values)
@@ -1150,7 +1160,8 @@ void qdev_property_add_static(DeviceState *dev, const Property *prop)assert (!prop->info->create); - op = object_property_add(obj, prop->name, prop->info->type, NULL, + op = object_property_add(obj, prop->name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,
@@ -1176,7 +1187,8 @@ static void qdev_class_add_property(DeviceClass *klass, const char *name,if (prop->info->create) { op = prop->info->create (oc, name, prop); }else { - op = object_class_property_add(oc, name, prop->info->type, NULL, + op = object_class_property_add(oc, name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release,
Signature · 1 line
2.55.0
PATCH v8 47/56 qdev: convert core PropertyInfo definitions to use qapi_type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Add a .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper.
It's strange to use type &size_type_info for both u32 (prop_size32) and u64 (prop_size).
Link property are actually strings. The "full type name" is set when the property is added, as "link<TYPE>".
Array properties are left for later.
--- hw/core/qdev-properties.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
hw/core/qdev-properties.c +23 -2
@@ -12,6 +12,8 @@#include "qdev-prop-internal.h" #include "qom/compat-properties.h" #include "qom/qom-qobject.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" void qdev_prop_set_after_realize (DeviceState *dev,const char *name,Error **errp)
@@ -182,6 +184,7 @@ static void set_default_value_bool(ObjectProperty *op, const Property *prop)const PropertyInfo qdev_prop_bit = { .type ="bool" , + .qapi_type = &bool_type_info, .description ="on/off" , .get = prop_get_bit, .set = prop_set_bit,
@@ -232,6 +235,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, const char *name,const PropertyInfo qdev_prop_bit64 = { .type ="bool" , + .qapi_type = &bool_type_info, .description ="on/off" , .get = prop_get_bit64, .set = prop_set_bit64,
@@ -294,8 +298,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Visitor *v,const PropertyInfo qdev_prop_on_off_auto_bit64 = { .type ="OnOffAuto" , + .qapi_type = &OnOffAuto_type_info, .description ="on/off/auto" , - .enum_table = &OnOffAuto_lookup, .get = prop_get_on_off_auto_bit64, .set = prop_set_on_off_auto_bit64, .set_default_value = qdev_propinfo_set_default_value_enum,
@@ -323,6 +327,7 @@ static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_bool = { .type ="bool" , + .qapi_type = &bool_type_info, .description ="on/off" , .get = get_bool, .set = set_bool,
@@ -363,6 +368,7 @@ void qdev_propinfo_set_default_value_uint(ObjectProperty *op,const PropertyInfo qdev_prop_uint8 = { .type ="uint8" , + .qapi_type = &uint8_type_info, .get = get_uint8, .set = set_uint8, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -390,6 +396,7 @@ static void set_uint16(Object *obj, Visitor *v, const char *name,const PropertyInfo qdev_prop_uint16 = { .type ="uint16" , + .qapi_type = &uint16_type_info, .get = get_uint16, .set = set_uint16, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -435,6 +442,7 @@ static void set_int32(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_uint32 = { .type ="uint32" , + .qapi_type = &uint32_type_info, .get = get_uint32, .set = set_uint32, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -442,6 +450,7 @@ const PropertyInfo qdev_prop_uint32 = {const PropertyInfo qdev_prop_int32 = { .type ="int32" , + .qapi_type = &int32_type_info, .get = qdev_propinfo_get_int32, .set = set_int32, .set_default_value = qdev_propinfo_set_default_value_int,
@@ -487,6 +496,7 @@ static void set_int64(Object *obj, Visitor *v, const char *name,const PropertyInfo qdev_prop_uint64 = { .type ="uint64" , + .qapi_type = &uint64_type_info, .get = get_uint64, .set = set_uint64, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -494,6 +504,7 @@ const PropertyInfo qdev_prop_uint64 = {const PropertyInfo qdev_prop_int64 = { .type ="int64" , + .qapi_type = &int64_type_info, .get = get_int64, .set = set_int64, .set_default_value = qdev_propinfo_set_default_value_int,
@@ -516,6 +527,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *v, const char *name,const PropertyInfo qdev_prop_uint64_checkmask = { .type ="uint64" , + .qapi_type = &uint64_type_info, .get = get_uint64, .set = set_uint64_checkmask, };
@@ -552,6 +564,11 @@ static void set_usize(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_usize = { .type ="usize" , +#if HOST_LONG_BITS == 32 + .qapi_type = &uint32_type_info, +#else + .qapi_type = &uint64_type_info, +#endif .get = get_usize, .set = set_usize, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -596,6 +613,7 @@ static void set_string(Object *obj, Visitor *v, const char *name,const PropertyInfo qdev_prop_string = { .type ="str" , + .qapi_type = &str_type_info, .release = release_string, .get = get_string, .set = set_string,
@@ -605,8 +623,8 @@ const PropertyInfo qdev_prop_string = {const PropertyInfo qdev_prop_on_off_auto = { .type ="OnOffAuto" , + .qapi_type = &OnOffAuto_type_info, .description ="on/off/auto" , - .enum_table = &OnOffAuto_lookup, .get = qdev_propinfo_get_enum, .set = qdev_propinfo_set_enum, .set_default_value = qdev_propinfo_set_default_value_enum,
@@ -648,6 +666,7 @@ static void set_size32(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_size32 = { .type ="size" , + .qapi_type = &size_type_info, .get = qdev_propinfo_get_size32, .set = set_size32, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -1061,6 +1080,7 @@ static void set_size(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_size = { .type ="size" , + .qapi_type = &size_type_info, .get = get_size, .set = set_size, .set_default_value = qdev_propinfo_set_default_value_uint,
@@ -1143,6 +1163,7 @@ static void set_link(Object *obj, Visitor *v, const char *name, void *opaque,const PropertyInfo qdev_prop_link = { .type ="link" , + .qapi_type = &str_type_info, .create = create_link_property,/* * Since we have a create method, the get and set are used
Signature · 1 line
2.55.0
PATCH v8 48/56 qdev: convert system PropertyInfo definitions to use qapi_type
In reply to Markus ArmbrusterFrom: Marc-André Lureau <[email protected]>
Add a .qapi_type pointer on all PropertyInfo definitions in qdev-properties-system.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper.
Update file-private enum accessor functions to use .qapi_type->lookup instead of .enum_table.
Note, this should be a faithful conversion, but it would be worth to consider better types than just "str" for references (block node names, chardev/netdev IDs, MAC addrs, etc)
--- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 71 +++++++++++++++++++++----------- hw/core/qdev-properties.c | 2 +- 3 files changed, 51 insertions(+), 24 deletions(-)
hw/core/qdev-prop-internal.h +2 -0
@@ -8,6 +8,8 @@#ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H +const QEnumLookup *qdev_propinfo_enum_lookup (const PropertyInfo *info); +void qdev_propinfo_get_enum (Object *obj,Visitor *v,const char *name,void *opaque,Error **errp); void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
hw/core/qdev-properties-system.c +48 -23
300 lines not on this page · raw message
hw/core/qdev-properties.c +1 -1
@@ -101,7 +101,7 @@ static ObjectPropertyAccessor *field_prop_setter(const PropertyInfo *info)return info->set ? field_prop_set :NULL ; } -static const QEnumLookup *qdev_propinfo_enum_lookup (const PropertyInfo *info) +const QEnumLookup *qdev_propinfo_enum_lookup (const PropertyInfo *info) {if (info->qapi_type) {assert (info->qapi_type->lookup);
Signature · 1 line
2.55.0