qom: Fix object_property_add_alias() with [*]
PATCH 1/1 qom: Fix object_property_add_alias() with [*]
Commit 8074264 (qom: Add description field in ObjectProperty struct) introduced property descriptions and copied them for alias properties.
Instead of using the caller-supplied property name, use the returned property name for setting the description. This avoids an Error when setting a property description for a property with literal "[*]" that doesn't exist due to automatic property naming in object_property_add().
--- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -1
@@ -1761,7 +1761,7 @@ void object_property_add_alias(Object *obj, const char *name, } op->resolve = property_resolve_alias; -object_property_set_description (obj, name, +object_property_set_description (obj, op->name, target_prop->description, &error_abort);
Signature · 1 line
2.1.4
Quoted 21 lines · Andreas Färber
Commit 8074264 (qom: Add description field in ObjectProperty struct) introduced property descriptions and copied them for alias properties.
Instead of using the caller-supplied property name, use the returned property name for setting the description. This avoids an Error when setting a property description for a property with literal "[*]" that doesn't exist due to automatic property naming in
object_property_add().Cc Gonglei <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Michael S. Tsirkin <[email protected]>Signed-off-by Andreas Färber <[email protected]>--- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)qom/object.c +0
-0
qom/object.c void object_property_add_alias(Object *obj, const char *name, · line 1767
Quoted 8 lines
qom/object.c +1
-1@@ -1761,7 +1761,7 @@ void object_property_add_alias(Object *obj, const char *name, } op->resolve = property_resolve_alias; -object_property_set_description (obj, name, +object_property_set_description (obj, op->name, target_prop->description, &error_abort);
Looks good to me. I think this is a candidate for 2.3 rc2.
Regards,
-Gonglei
Quoted 22 lines · Andreas Färber
Commit 8074264 (qom: Add description field in ObjectProperty struct) introduced property descriptions and copied them for alias properties.
Instead of using the caller-supplied property name, use the returned property name for setting the description. This avoids an Error when setting a property description for a property with literal "[*]" that doesn't exist due to automatic property naming in
object_property_add().Cc Gonglei <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Michael S. Tsirkin <[email protected]>Signed-off-by Andreas Färber <[email protected]>--- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)qom/object.c +0
-0
qom/object.c void object_property_add_alias(Object *obj, const char *name, · line 1767
Quoted 8 lines
qom/object.c +1
-1@@ -1761,7 +1761,7 @@ void object_property_add_alias(Object *obj, const char *name, } op->resolve = property_resolve_alias; -object_property_set_description (obj, name, +object_property_set_description (obj, op->name, target_prop->description, &error_abort);