[PATCH v2 13/21] system/vl: mark property set in object_parse_property_opt() as USER_SET

Zhao Liu posted 21 patches 15 hours ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Zhao Liu <zhao1.liu@intel.com>
[PATCH v2 13/21] system/vl: mark property set in object_parse_property_opt() as USER_SET
Posted by Zhao Liu 15 hours ago
At present, object_parse_property_opt() is only used for -accel, which
handles user configurations from CLI.

So, mark the property as USER_SET in object_property_parse().

Also, add a comment to the function to clarify this specific usage
context, and it can serve as a reminder to future callers that
utilizing this function implies the property setting originates from
the external user.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 system/vl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/system/vl.c b/system/vl.c
index 6d8167a50006..ef1d4e5d96af 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1700,6 +1700,10 @@ static MachineClass *select_machine(QDict *qdict, Error **errp)
     return machine_class;
 }
 
+/*
+ * object_parse_property_opt() is only used for -accel, so mark the
+ * property as USER_SET in object_property_parse().
+ */
 static int object_parse_property_opt(Object *obj,
                                      const char *name, const char *value,
                                      const char *skip, Error **errp)
@@ -1708,7 +1712,7 @@ static int object_parse_property_opt(Object *obj,
         return 0;
     }
 
-    if (!object_property_parse(obj, name, value, false, errp)) {
+    if (!object_property_parse(obj, name, value, true, errp)) {
         return -1;
     }
 
-- 
2.34.1