Skip to content

qom: introduce property flags to track external user input

Zhao Liu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest21 patches 47 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21qom/object: use BIT macro for ObjectPropertyFlagsinclude/qom/object.h+3 -21 reply
2/21qom/object: cache ObjectPropertyFlags in ObjectPropertyinclude/qom/object.h qom/object.c+40 -101 reply
3/21qom/object: factor out object_class_property_try_add()include/qom/object.h qom/object.c+82 -82 replies
4/21qom/object: add flags argument in object_{class_}property_try_add()include/qom/object.h qom/object.c+26 -140 replies
5/21qom/object: rename object_{class_}property_try_add() to object_{class_}property_add_full()include/qom/object.h qom/object.c+42 -420 replies
6/21qom/object: add helpers to set/get/clear property flagsinclude/qom/object.h qom/object.c+127 -00 replies
7/21qom/object: introduce user interaction flags for propertiesinclude/qom/object.h qom/object.c+39 -05 replies
8/21qom/object: add from_user argument in object_property_parse()hw/i386/sgx.c include/qom/object.h qom/object.c +3 more+23 -120 replies
9/21qom/object: mark global property set from CLI as USER_SEThw/core/qdev-properties.c include/qom/object.h qom/object.c+6 -40 replies
10/21qom/qom-hmp-cmd: mark properties set from HMP (non-JSON) "qom-set" as USER_SETqom/qom-hmp-cmds.c+1 -10 replies
11/21qom/qom-qmp-cmd: mark properties set from QMP/HMP (JSON) "qom-set" as USER_SETqom/qom-qmp-cmds.c+6 -10 replies
12/21qom/object_interfaces: mark properties set from qdict & keyval as USER_SETqom/object_interfaces.c+5 -00 replies
13/21system/vl: mark property set in object_parse_property_opt() as USER_SETsystem/vl.c+5 -10 replies
14/21hw/core/qdev-properties: allow qdev properties accept flagshw/core/qdev-properties.c include/hw/core/qdev-properties.h+29 -2113 replies
15/21target/i386: deprecate fill-mtrr-mask propertydocs/about/deprecated.rst target/i386/cpu.c+10 -10 replies
16/21target/i386: deprecate cpuid-0xb propertydocs/about/deprecated.rst target/i386/cpu.c+12 -10 replies
17/21hw/intc/ioapic: deprecate version propertydocs/about/deprecated.rst hw/intc/ioapic.c+15 -11 reply
18/21target/i386: mark x-consistent-cache property as internal-onlytarget/i386/cpu.c+2 -10 replies
19/21target/i386: remove redundant validation for lbr-fmt propertytarget/i386/cpu.c+0 -41 reply
20/21target/i386: detect user provided lbr-fmt via property flagtarget/i386/cpu.c+6 -11 reply
21/21hw/core/qdev-properties: support valid default value for DEFINE_PROP_UINT64_CHECKMASKhw/core/qdev-properties.c include/hw/core/qdev-properties.h target/i386/cpu.c+9 -101 reply

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchZide ChenThomas Huth
1/21R-b
2/21R-b
3/21
4/21
5/21
6/21
7/21
8/21
9/21
10/21
11/21
12/21
13/21
14/21
15/21
16/21
17/21
18/21
19/21R-b
20/21
21/21R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/21] qom: introduce property flags to track external user input

Hi,

This is the v2 trying to introduce property flags to detect user's property setting (from CLI/QMP/HMP). I dropped RFC tag since previous RFC v1 [1].

Though this work the follow-up of v2.6 & v2.7 machines' removal [2], now it is decoupled from [2] totally since v2 doesn't detect compat property and only focuses on external user setting, so this series is based on master branch at the commit 28a6ca268c2c ("Merge tag 'single- binary-20260203' of https://github.com/philmd/qemu into staging"). And you can also find the code here:

https://gitlab.com/zhao.liu/qemu/-/tree/prop-flags-v2.3-02-08-2026

This series introduces 3 property flags:
* USER_SET:
Any external user property setting (from CLI/HMP/QMP) is marked as USER_SET.
* DEPRECATED:
Once a property is marked as DEPRECATED, any external user property setting will trigger a warning.
* INTERNAL:
Once a property is marked as INTERNAL, any external user property setting will cause an error.

More details or document for these 3 flags, you can refer patch 7.

Compared with RFC v1, v2 mainly:
* introduce USER_SET property flag to identify all user's setting.
- patch 7 for document.
* construct DEPRECATED & INTERNAL flag on USER_SET.
- patch 7 for document.
* cover more comprehensive user set cases.
- patch 8-13.
* provide examples about new flags (USER_SET/DEPRECATED/INTELNAL).
- patch 15/16/17 are examples for DEPRECATED flag.
- patch 18 is the example for INTERNAL flag.
- patch 20 is the example for USER_SET flag.

I think v2 should now cover "nearly" all cases (patch 8-13) where users set properties: one approach is to trace the call chain of object_property_set().

Even if there are cases that were missed, they can be easily addressed based on this series:

  object_property_set(obj, ...);
  /* Insert this call after object_property_set(). */
  object_property_set_flags(obj, ..., OBJ_PROP_FLAG_USER_SET, ...);

[1]: RFC v1:

     https://lore.kernel.org/qemu-devel/[email protected]/
[2]: hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
     https://lore.kernel.org/qemu-devel/[email protected]/

Thanks and Best Regards,
Zhao
---
Zhao Liu (21):
qom/object: use BIT macro for ObjectPropertyFlags qom/object: cache ObjectPropertyFlags in ObjectProperty qom/object: factor out object_class_property_try_add() qom/object: add flags argument in object_{class_}property_try_add() qom/object: rename object_{class_}property_try_add() to
object_{class_}property_add_full()
qom/object: add helpers to set/get/clear property flags qom/object: introduce user interaction flags for properties qom/object: add from_user argument in object_property_parse() qom/object: mark global property set from CLI as USER_SET qom/qom-hmp-cmd: mark properties set from HMP (non-JSON) "qom-set" as
USER_SET
qom/qom-qmp-cmd: mark properties set from QMP/HMP (JSON) "qom-set" as
USER_SET
qom/object_interfaces: mark properties set from qdict & keyval as
USER_SET
system/vl: mark property set in object_parse_property_opt() as
USER_SET
hw/core/qdev-properties: allow qdev properties accept flags target/i386: deprecate fill-mtrr-mask property target/i386: deprecate cpuid-0xb property
hw/intc/ioapic: deprecate version property
target/i386: mark x-consistent-cache property as internal-only target/i386: remove redundant validation for lbr-fmt property target/i386: detect user provided lbr-fmt via property flag hw/core/qdev-properties: support valid default value for
DEFINE_PROP_UINT64_CHECKMASK

 docs/about/deprecated.rst         |  31 +++++
 hw/core/qdev-properties.c         |  29 ++--
 hw/i386/sgx.c                     |   2 +-
 hw/intc/ioapic.c                  |   3 +-
 include/hw/core/qdev-properties.h |  38 +++---
 include/qom/object.h              | 215 +++++++++++++++++++++++++++---
 qom/object.c                      | 177 ++++++++++++++++++++----
 qom/object_interfaces.c           |   5 +
 qom/qom-hmp-cmds.c                |   2 +-
 qom/qom-qmp-cmds.c                |   7 +-
 system/vl.c                       |   6 +-
 target/i386/cpu.c                 |  28 ++--
 12 files changed, 448 insertions(+), 95 deletions(-)
Signature · 1 line
2.34.1