qemu/hw
Markus Armbruster ff30d3b1ac qdev: Change values of PropertyInfo member @type to be QAPI types
PropertyInfo member @type is externally visible via QMP
device-list-properties and qom-list-properies.

Its meaning is not documented at its definition.

It gets passed as @type argument to object_property_add() and
object_class_property_add().  This argument's documentation isn't of
much help, either:

 * @type: the type name of the property.  This namespace is pretty loosely
 *   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>'.

The two QMP commands document it as

 # @type: the type of the property.  This will typically come in one of
 #     four forms:
 #
 #     1) A primitive type such as 'u8', 'u16', 'bool', 'str', or
 #        'double'.  These types are mapped to the appropriate JSON
 #        type.
 #
 #     2) A child type in the form 'child<subtype>' where subtype is a
 #        qdev device type name.  Child properties create the
 #        composition tree.
 #
 #     3) A link type in the form 'link<subtype>' where subtype is a
 #        qdev device type name.  Link properties form the device model
 #        graph.

"Typically come in one of four forms" followed by three items inspires
the level of trust that is appropriate here.

Clean up a bunch of funnies:

* qdev_prop_fdc_drive_type.type is "FdcDriveType".  Its .enum_table
  refers to QAPI type "FloppyDriveType".  So use that.

* qdev_prop_reserved_region is "reserved_region".  Its only user is an
  array property called "reserved-regions".  Its .set() visits str.
  So change @type to "str".

* trng_prop_fault_event_set.type is "uint32:bits".  Its .set() visits
  uint32, so change @type to "uint32".  If we believe mentioning it's
  actually bits is useful, the proper place would be .description.

* ccw_loadparm.type is "ccw_loadparm".  It's users are properties
  called "loadparm".  Its .set() visits str.  So change @type to
  "str".

* qdev_prop_nv_gpudirect_clique.type is "uint4".  Its set() visits
  uint8, so change @type to "uint8".  If we believe mentioning the
  range is useful, the proper place would be .description.

* s390_pci_fid_propinfo.type is "zpci_fid".  Its .set() visits uint32.
  So change type to that, and move the "zpci_fid" to .description.
  This is admittedly a lousy description, but it's still an
  improvement; for instance, output of -device zpci,help changes from

      fid=<zpci_fid>

  to

      fid=<uint32>           - zpci_fid

* Similarly for a raft of PropertyInfo in target/riscv/cpu.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250227085601.4140852-5-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[Commit message typo fixed]
2025-03-06 10:33:05 +01:00
..
9pfs 9pfs: improve v9fs_open() tracing 2025-02-06 17:10:46 +01:00
acpi hw/acpi/ghes: Make ghes_record_cper_errors() static 2025-03-04 14:45:34 +01:00
adc include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
alpha hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
arm Misc HW patches 2025-03-05 21:54:58 +08:00
audio Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
avr hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
block qdev: Rename PropertyInfo member @name to @type 2025-03-06 10:30:58 +01:00
char hw/char/sifive_uart: Free fifo on unrealize 2025-03-04 14:45:34 +01:00
core qdev: Change values of PropertyInfo member @type to be QAPI types 2025-03-06 10:33:05 +01:00
cpu hw/cpu/arm_mpcore: Remove default values for GIC external IRQs 2025-02-20 14:20:29 +00:00
cxl mem/cxl_type3: support 3, 6, 12 and 16 interleave ways 2025-02-21 07:18:42 -05:00
display qdev: Rename PropertyInfo member @name to @type 2025-03-06 10:30:58 +01:00
dma Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
fsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
gpio hw/gpio/pca955*: Move Kconfig switches next to implementations 2025-02-25 15:32:58 +00:00
hppa hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
hyperv qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
i2c hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
i386 Misc HW patches 2025-03-05 21:54:58 +08:00
ide Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
input Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
intc loongarch queue 2025-03-05 21:57:15 +08:00
ipack hw/ipack: Remove legacy qemu_allocate_irqs() use 2025-01-31 19:36:44 +01:00
ipmi Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
isa hw: Declare various const data as 'const' 2025-02-16 14:26:07 +01:00
loongarch hw/loongarch/virt: Enable cpu hotplug feature on virt machine 2025-03-05 09:39:18 +08:00
m68k hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
mem mem/cxl_type3: support 3, 6, 12 and 16 interleave ways 2025-02-21 07:18:42 -05:00
microblaze hw/ssi/xilinx_spi: Make device endianness configurable 2025-02-16 14:34:57 +01:00
mips hw: Centralize handling of -machine dumpdtb option 2025-02-24 15:03:42 +00:00
misc qdev: Change values of PropertyInfo member @type to be QAPI types 2025-03-06 10:33:05 +01:00
net hw/net/fsl_etsec: Set eTSEC device description and category 2025-03-04 14:45:34 +01:00
nubus include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
nvme qdev: Rename PropertyInfo member @name to @type 2025-03-06 10:30:58 +01:00
nvram qdev: Rename PropertyInfo member @name to @type 2025-03-06 10:30:58 +01:00
openrisc hw: Centralize handling of -machine dumpdtb option 2025-02-24 15:03:42 +00:00
pci qdev: Rename PropertyInfo member @name to @type 2025-03-06 10:30:58 +01:00
pci-bridge Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
pci-host hw/arm/fsl-imx8mp: Add PCIe support 2025-02-25 17:02:34 +00:00
ppc hw/ppc/spapr: Restrict part of PAGE_INIT hypercall to TCG 2025-03-04 14:45:34 +01:00
remote Memory pull request for 10.0 2025-02-19 08:36:26 +08:00
riscv hw/riscv: add IOMMU HPM trace events 2025-03-04 15:42:54 +10:00
rtc goldfish_rtc: Fix tick_offset migration 2025-03-04 15:42:54 +10:00
rx hw/rx: Allow execution without either bios or kernel 2025-02-16 14:45:38 +01:00
s390x qdev: Change values of PropertyInfo member @type to be QAPI types 2025-03-06 10:33:05 +01:00
scsi block: remove unused BLOCK_OP_TYPE_DATAPLANE 2025-02-06 14:51:10 +01:00
sd hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
sensor hw: Make class data 'const' 2025-02-16 14:26:07 +01:00
sh4 hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
smbios include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
sparc hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
sparc64 hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
ssi hw/ssi: Make flash size a property in NPCM7XX FIU 2025-02-20 14:20:29 +00:00
timer * qom: Use command line syntax for default values in help 2025-03-03 10:20:59 +08:00
tpm hw/tpm: Have TPM TIS sysbus device inherit from DYNAMIC_SYS_BUS_DEVICE 2025-02-16 14:25:07 +01:00
tricore hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
uefi docs: add uefi variable service documentation 2025-03-04 12:07:05 +01:00
ufs hw/ufs: Add temperature event notification support 2025-03-05 02:13:29 +01:00
usb hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode 2025-03-04 14:45:34 +01:00
vfio qdev: Change values of PropertyInfo member @type to be QAPI types 2025-03-06 10:33:05 +01:00
virtio virtio,pc,pci: features, fixes, cleanups 2025-02-22 05:06:39 +08:00
vmapple hw/vmapple/vmapple: Add vmapple machine type 2025-03-04 14:45:34 +01:00
watchdog hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
xen hw/xen/xen-hvm: Reduce included headers 2025-03-04 14:45:34 +01:00
xenpv hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
xtensa hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
Kconfig Misc HW patches 2025-03-05 21:54:58 +08:00
meson.build Misc HW patches 2025-03-05 21:54:58 +08:00