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(-)

-- 
2.34.1

Reply via email to