* [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups
@ 2026-11-05 8:03 Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 1/5] target/riscv: Fix up PropertyInfo to set @qapi_type Markus Armbruster
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
Marc-André missed one property, I lost two in my butchering of his
work, and we both missed alias class properties. Not too bad for such
a big series, I think.
Bonus improvement: child and link properties.
v2:
* New PATCH 5: child and link properties
Markus Armbruster (5):
target/riscv: Fix up PropertyInfo to set @qapi_type
hw/gpio/pca9552: Fix @type of pca9552 property led<N>
hw: Fix up PropertyInfo to set @qapi_type
qom: Convert alias properties to QAPI-aware registration
qom: Convert child and link properties to QAPI-aware registration
hw/gpio/pca9552.c | 5 +++--
hw/gpio/pca9554.c | 5 +++--
qom/object.c | 13 +++++++------
target/riscv/cpu.c | 1 +
4 files changed, 14 insertions(+), 10 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/5] target/riscv: Fix up PropertyInfo to set @qapi_type
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
@ 2026-11-05 8:03 ` Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 2/5] hw/gpio/pca9552: Fix @type of pca9552 property led<N> Markus Armbruster
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
When we recently updated PropertyInfo to set @qapi_type, we missed
one. Update it now.
Fixes: 07458a910f7b ("target/riscv: convert PropertyInfo definitions to use qapi_type")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
target/riscv/cpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 362e561809..15c27f4ce4 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -2075,6 +2075,7 @@ static void prop_vlen_get(Object *obj, Visitor *v, const char *name,
static const PropertyInfo prop_vlen = {
.type = "uint16",
+ .qapi_type = &uint16_type_info,
.description = "vlen",
.get = prop_vlen_get,
.set = prop_vlen_set,
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/5] hw/gpio/pca9552: Fix @type of pca9552 property led<N>
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 1/5] target/riscv: Fix up PropertyInfo to set @qapi_type Markus Armbruster
@ 2026-11-05 8:03 ` Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 3/5] hw: Fix up PropertyInfo to set @qapi_type Markus Armbruster
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel
Cc: marcandre.lureau, pbonzini, berrange, Philippe Mathieu-Daudé,
Glenn Miles
pca955x_initfn() passes @type "bool" to object_property_add(). The
properties are actually string-typed: pca955x_get_led() and
pca955x_set_led() use visit_type_str(). Pass "str" instead.
Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
---
hw/gpio/pca9552.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c
index 7e5fda4980..07ef0fb20b 100644
--- a/hw/gpio/pca9552.c
+++ b/hw/gpio/pca9552.c
@@ -567,7 +567,7 @@ static void pca955x_initfn(Object *obj)
if (k->has_led_support) {
/* LED variant: expose the LED selector state as led%d. */
name = g_strdup_printf("led%d", ix);
- object_property_add(obj, name, "bool", NULL,
+ object_property_add(obj, name, "str", NULL,
pca955x_get_led, pca955x_set_led, NULL, NULL);
} else {
/* GPIO variant: expose the pin logic level as pin%d. */
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/5] hw: Fix up PropertyInfo to set @qapi_type
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 1/5] target/riscv: Fix up PropertyInfo to set @qapi_type Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 2/5] hw/gpio/pca9552: Fix @type of pca9552 property led<N> Markus Armbruster
@ 2026-11-05 8:03 ` Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 4/5] qom: Convert alias properties to QAPI-aware registration Markus Armbruster
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
When we recently updated PropertyInfo to set @qapi_type, we missed a
few. Update them now.
Fixes: 04dc2fe4d463 ("hw: convert device-local PropertyInfo definitions to use qapi_type")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/gpio/pca9552.c | 5 +++--
hw/gpio/pca9554.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c
index 07ef0fb20b..90ccf5170e 100644
--- a/hw/gpio/pca9552.c
+++ b/hw/gpio/pca9552.c
@@ -23,6 +23,7 @@
#include "hw/core/irq.h"
#include "migration/vmstate.h"
#include "qapi/error.h"
+#include "qapi/qapi-builtin-type-infos.h"
#include "qapi/visitor.h"
#include "trace.h"
#include "qom/object.h"
@@ -567,12 +568,12 @@ static void pca955x_initfn(Object *obj)
if (k->has_led_support) {
/* LED variant: expose the LED selector state as led%d. */
name = g_strdup_printf("led%d", ix);
- object_property_add(obj, name, "str", NULL,
+ object_property_add(obj, name, "str", &str_type_info,
pca955x_get_led, pca955x_set_led, NULL, NULL);
} else {
/* GPIO variant: expose the pin logic level as pin%d. */
name = g_strdup_printf("pin%d", ix);
- object_property_add(obj, name, "str", NULL,
+ object_property_add(obj, name, "str", &str_type_info,
pca955x_get_pin, pca955x_set_pin, NULL, NULL);
}
g_free(name);
diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c
index 0dd063f93a..07bb00babf 100644
--- a/hw/gpio/pca9554.c
+++ b/hw/gpio/pca9554.c
@@ -16,6 +16,7 @@
#include "hw/core/irq.h"
#include "migration/vmstate.h"
#include "qapi/error.h"
+#include "qapi/qapi-builtin-type-infos.h"
#include "qapi/visitor.h"
#include "trace.h"
#include "qom/object.h"
@@ -280,8 +281,8 @@ static void pca9554_initfn(Object *obj)
char *name;
name = g_strdup_printf("pin%d", pin);
- object_property_add(obj, name, "str", NULL, pca9554_get_pin,
- pca9554_set_pin,
+ object_property_add(obj, name, "str", &str_type_info,
+ pca9554_get_pin, pca9554_set_pin,
NULL, NULL);
g_free(name);
}
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/5] qom: Convert alias properties to QAPI-aware registration
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
` (2 preceding siblings ...)
2026-11-05 8:03 ` [PATCH v2 3/5] hw: Fix up PropertyInfo to set @qapi_type Markus Armbruster
@ 2026-11-05 8:03 ` Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 5/5] qom: Convert child and link " Markus Armbruster
2026-11-06 12:12 ` [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
5 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
Pass the target property's QAPITypeInfo to object_class_property_add()
/ object_property_add().
Commit 53c674710b4 (qom: add qapi_type field to ObjectProperty)
already monkey-patched it in object_property_add_alias(), but not in
object_class_property_add_alias(). Delete that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
qom/object.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index cd0590c3fd..774a976c8b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -3099,13 +3099,13 @@ object_property_add_alias(Object *obj, const char *name,
prop->target_name = g_strdup(target_name);
prop->flags = 0;
- op = object_property_add(obj, name, prop_type, NULL,
+ op = object_property_add(obj, name, prop_type,
+ target_prop->qapi_type,
property_get_alias,
property_set_alias,
property_release_alias,
prop);
op->resolve = property_resolve_alias;
- op->qapi_type = target_prop->qapi_type;
if (target_prop->defval) {
op->defval = qobject_ref(target_prop->defval);
}
@@ -3144,7 +3144,8 @@ object_class_property_add_alias(ObjectClass *klass, const char *name,
prop->target_name = g_strdup(target_name);
prop->flags = OBJ_PROP_ALIAS_CLASS;
- op = object_class_property_add(klass, name, prop_type, NULL,
+ op = object_class_property_add(klass, name, prop_type,
+ target_prop->qapi_type,
property_get_alias,
property_set_alias,
property_release_alias,
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 5/5] qom: Convert child and link properties to QAPI-aware registration
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
` (3 preceding siblings ...)
2026-11-05 8:03 ` [PATCH v2 4/5] qom: Convert alias properties to QAPI-aware registration Markus Armbruster
@ 2026-11-05 8:03 ` Markus Armbruster
2026-11-05 12:20 ` Marc-André Lureau
2026-11-06 12:12 ` [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
5 siblings, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2026-11-05 8:03 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
Child and link properties get serialized as QOM paths, i.e. as
strings. Use &str_type_info for them.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qom/object.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index 774a976c8b..9276b7a435 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1914,7 +1914,7 @@ object_property_try_add_child(Object *obj, const char *name,
type = g_strdup_printf("child<%s>", object_get_typename(child));
- op = object_property_try_add(obj, name, type, NULL,
+ op = object_property_try_add(obj, name, type, &str_type_info,
object_get_child_property,
NULL, object_finalize_child_property,
child, errp);
@@ -2109,7 +2109,7 @@ object_add_link_prop(Object *obj, const char *name,
full_type = g_strdup_printf("link<%s>", type);
- op = object_property_add(obj, name, full_type, NULL,
+ op = object_property_add(obj, name, full_type, &str_type_info,
object_get_link_property,
check ? object_set_link_property : NULL,
object_release_link_property,
@@ -2146,7 +2146,7 @@ object_class_property_add_link(ObjectClass *oc,
full_type = g_strdup_printf("link<%s>", type);
- op = object_class_property_add(oc, name, full_type, NULL,
+ op = object_class_property_add(oc, name, full_type, &str_type_info,
object_get_link_property,
check ? object_set_link_property : NULL,
object_release_link_property,
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 5/5] qom: Convert child and link properties to QAPI-aware registration
2026-11-05 8:03 ` [PATCH v2 5/5] qom: Convert child and link " Markus Armbruster
@ 2026-11-05 12:20 ` Marc-André Lureau
0 siblings, 0 replies; 8+ messages in thread
From: Marc-André Lureau @ 2026-11-05 12:20 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, pbonzini, berrange
On Thu, Nov 5, 2026 at 12:03 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Child and link properties get serialized as QOM paths, i.e. as
> strings. Use &str_type_info for them.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> qom/object.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index 774a976c8b..9276b7a435 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1914,7 +1914,7 @@ object_property_try_add_child(Object *obj, const char *name,
>
> type = g_strdup_printf("child<%s>", object_get_typename(child));
>
> - op = object_property_try_add(obj, name, type, NULL,
> + op = object_property_try_add(obj, name, type, &str_type_info,
> object_get_child_property,
> NULL, object_finalize_child_property,
> child, errp);
> @@ -2109,7 +2109,7 @@ object_add_link_prop(Object *obj, const char *name,
>
> full_type = g_strdup_printf("link<%s>", type);
>
> - op = object_property_add(obj, name, full_type, NULL,
> + op = object_property_add(obj, name, full_type, &str_type_info,
> object_get_link_property,
> check ? object_set_link_property : NULL,
> object_release_link_property,
> @@ -2146,7 +2146,7 @@ object_class_property_add_link(ObjectClass *oc,
>
> full_type = g_strdup_printf("link<%s>", type);
>
> - op = object_class_property_add(oc, name, full_type, NULL,
> + op = object_class_property_add(oc, name, full_type, &str_type_info,
> object_get_link_property,
> check ? object_set_link_property : NULL,
> object_release_link_property,
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
` (4 preceding siblings ...)
2026-11-05 8:03 ` [PATCH v2 5/5] qom: Convert child and link " Markus Armbruster
@ 2026-11-06 12:12 ` Markus Armbruster
5 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-11-06 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, pbonzini, berrange
Queued for 11.2.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-06 12:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 8:03 [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 1/5] target/riscv: Fix up PropertyInfo to set @qapi_type Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 2/5] hw/gpio/pca9552: Fix @type of pca9552 property led<N> Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 3/5] hw: Fix up PropertyInfo to set @qapi_type Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 4/5] qom: Convert alias properties to QAPI-aware registration Markus Armbruster
2026-11-05 8:03 ` [PATCH v2 5/5] qom: Convert child and link " Markus Armbruster
2026-11-05 12:20 ` Marc-André Lureau
2026-11-06 12:12 ` [PATCH v2 0/5] qom/qdev: associate properties with QAPI types fixups Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.