Use members @kind and @qom-type instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- python/qemu/utils/qom_common.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common.py index e5bae1c7421..8d324f29cc3 100644 --- a/python/qemu/utils/qom_common.py +++ b/python/qemu/utils/qom_common.py @@ -35,11 +35,12 @@ class ObjectPropertyInfo: """ Represents the return type from e.g. qom-list. """ - def __init__(self, name: str, type_: str, + def __init__(self, name: str, kind: str, qom_type: Optional[str], description: Optional[str] = None, default_value: Optional[object] = None): self.name = name - self.type = type_ + self.kind = kind + self.qom_type = qom_type self.description = description self.default_value = default_value @@ -48,20 +49,20 @@ def make(cls, value: Dict[str, Any]) -> 'ObjectPropertyInfo': """ Build an ObjectPropertyInfo from a Dict with an unknown shape. """ - assert value.keys() >= {'name', 'type'} - return cls(value['name'], value['type'], + assert value.keys() >= {'name', 'kind'} + return cls(value['name'], value['kind'], value.get('qom-type'), value.get('description'), value.get('default-value')) @property def child(self) -> bool: """Is this property a child property?""" - return self.type.startswith('child<') + return self.kind == "child" @property def link(self) -> bool: """Is this property a link property?""" - return self.type.startswith('link<') + return self.kind == "link" class ObjectPropertyValue: -- 2.55.0