Marc-André Lureau <[email protected]> writes:
> The typename parameter becomes a QAPITypeInfo pointer, and the
> validation compares prop->qapi_type against it instead of matching
> prop->type strings.
>
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
> hw/core/machine-qmp-cmds.c | 3 ++-
> include/qom/object.h | 4 ++--
> qom/object.c | 8 ++++----
> tests/unit/check-qom-proplist.c | 6 +++---
> 4 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 543dd3201b5a..1c23ec8897f0 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -18,6 +18,7 @@
> #include "qapi/qapi-commands-accelerator.h"
> #include "qapi/qapi-commands-machine.h"
> #include "qobject/qobject.h"
> +#include "qapi/qapi-type-infos-common.h"
> #include "qapi/qobject-input-visitor.h"
> #include "qapi/type-helpers.h"
> #include "qemu/uuid.h"
> @@ -219,7 +220,7 @@ static int query_memdev(Object *obj, void *opaque)
> } else {
> m->has_reserve = true;
> }
> - m->policy = object_property_get_enum(obj, "policy", "HostMemPolicy",
> + m->policy = object_property_get_enum(obj, "policy",
> &HostMemPolicy_type_info,
scripts/checkpatch.pl warns
WARNING: line over 80 characters
Easy enough to avoid.
> &error_abort);
> host_nodes = object_property_get_qobject(obj,
> "host-nodes",
[...]