|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v7 38/65] qom: convert scalar properties to QAPI-aware registration
Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> writes:
> Reviewed-by: Amit Machhiwal <amachhiw@xxxxxxxxxxxxx>
> Signed-off-by: Markus Armbruster <armbru@xxxxxxxxxx>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
How did you create this patch? It looks almost mechanical.
It misses a few conversions, almost certainly in code added since you
made this patch. I can take care of them.
[...]
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 1d91667fb880..bc178482b309 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -24,6 +24,7 @@
> #include "qemu/config-file.h"
> #include "qemu/error-report.h"
> #include "qapi/error.h"
> +#include "qapi/qapi-builtin-type-infos.h"
> #include "hw/pci/msi.h"
> #include "hw/pci/msix.h"
> #include "hw/s390x/adapter.h"
Not needed; we already include "qapi/qapi-type-infos-common.h".
[...]
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index 6d421b990cef..64228a620e69 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -26,6 +26,7 @@
>
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> +#include "qapi/qapi-builtin-type-infos.h"
> #include "qapi/visitor.h"
> #include "hw/pci/pci.h"
> #include "migration/vmstate.h"
Missing:
PM_REG_FIELD(acpi_pci_hotplug.root),
object_property_allow_set_link,
OBJ_PROP_LINK_STRONG);
- object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32",
+ object_class_property_add_qapi(oc, ACPI_PM_PROP_GPE0_BLK,
&uint32_type_info,
ich9_pm_get_gpe0_blk,
NULL, NULL, NULL);
object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED,
[...]
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> index cca37202ffb2..7b4fd933a8fb 100644
> --- a/hw/xen/xen-pvh-common.c
> +++ b/hw/xen/xen-pvh-common.c
> @@ -9,6 +9,7 @@
> #include "qemu/osdep.h"
> #include "qemu/error-report.h"
> #include "qemu/units.h"
> +#include "qapi/qapi-builtin-type-infos.h"
> #include "qapi/visitor.h"
> #include "hw/core/boards.h"
> #include "hw/core/irq.h"
> @@ -413,7 +414,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClass
> *xpc)
>
> #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \
> do { \
> - object_class_property_add(c, prop_name "-base", "uint64_t", \
> + object_class_property_add_qapi(c, prop_name "-base", &uint64_type_info,\
> xen_pvh_get_ ## name ## _base, \
> xen_pvh_set_ ## name ## _base, NULL, NULL); \
> object_class_property_set_description(oc, prop_name "-base", \
> @@ -422,7 +423,7 @@ do {
> \
>
> #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \
> do { \
> - object_class_property_add(c, prop_name "-size", "uint64_t", \
> + object_class_property_add_qapi(c, prop_name "-size", &size_type_info, \
> xen_pvh_get_ ## name ## _size, \
> xen_pvh_set_ ## name ## _size, NULL, NULL); \
> object_class_property_set_description(oc, prop_name "-size", \
Use of &size_type_info is not mechanical. Better to be as mechanical as
possible in such a huge patch.
[...]
> diff --git a/qom/object.c b/qom/object.c
> index cc113c0810e7..9f9a2abfa08d 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -22,10 +22,10 @@
> #include "qapi/string-output-visitor.h"
> #include "qapi/qobject-input-visitor.h"
> #include "qapi/forward-visitor.h"
> +#include "qapi/qapi-builtin-type-infos.h"
> #include "qapi/qapi-builtin-visit.h"
> #include "qapi/compat-policy.h"
> #include "qobject/qdict.h"
> -#include "qobject/qjson.h"
The deletion doesn't belong.
> #include "qemu/id.h"
> #include "qapi/qmp/qerror.h"
> #include "trace.h"
> @@ -2449,7 +2449,7 @@ object_property_add_str(Object *obj, const char *name,
> prop->get = get;
> prop->set = set;
>
> - return object_property_add(obj, name, "string",
> + return object_property_add_qapi(obj, name, &str_type_info,
> get ? property_get_str : NULL,
> set ? property_set_str : NULL,
> property_release_data,
> @@ -2467,7 +2467,7 @@ object_class_property_add_str(ObjectClass *klass, const
> char *name,
> prop->get = get;
> prop->set = set;
>
> - return object_class_property_add(klass, name, "string",
> + return object_class_property_add_qapi(klass, name, &str_type_info,
> get ? property_get_str : NULL,
> set ? property_set_str : NULL,
> NULL,
> @@ -2519,7 +2519,7 @@ object_property_add_bool(Object *obj, const char *name,
> prop->get = get;
> prop->set = set;
>
> - return object_property_add(obj, name, "bool",
> + return object_property_add_qapi(obj, name, &bool_type_info,
> get ? property_get_bool : NULL,
> set ? property_set_bool : NULL,
> property_release_data,
> @@ -2536,7 +2536,7 @@ object_class_property_add_bool(ObjectClass *klass,
> const char *name,
> prop->get = get;
> prop->set = set;
>
> - return object_class_property_add(klass, name, "bool",
> + return object_class_property_add_qapi(klass, name, &bool_type_info,
> get ? property_get_bool : NULL,
> set ? property_set_bool : NULL,
> NULL,
Missing:
@@ -2929,7 +2930,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass,
const char *name,
setter = property_class_set_bool_ptr;
}
- return object_class_property_add(klass, name, "bool",
+ return object_class_property_add_qapi(klass, name, &bool_type_info,
getter, setter, NULL, (void *)offset);
}
> @@ -2945,8 +2945,8 @@ object_property_add_uint8_ptr(Object *obj, const char
> *name,
> setter = property_set_uint8_ptr;
> }
>
> - return object_property_add(obj, name, "uint8",
> - getter, setter, NULL, (void *)v);
> + return object_property_add_qapi(obj, name, &uint8_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
Missing:
@@ -2969,7 +2970,7 @@ object_class_property_add_uint8_ptr(ObjectClass
*klass, const char *name,
setter = property_class_set_uint8_ptr;
}
- return object_class_property_add(klass, name, "uint8",
+ return object_class_property_add_qapi(klass, name, &uint8_type_info,
getter, setter, NULL, (void *)offset);
}
> @@ -2986,8 +2986,8 @@ object_class_static_property_add_uint8_ptr(ObjectClass
> *klass,
> setter = property_set_uint8_ptr;
> }
>
> - return object_class_property_add(klass, name, "uint8",
> - getter, setter, NULL, (void *)v);
> + return object_class_property_add_qapi(klass, name, &uint8_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
> @@ -3006,8 +3006,8 @@ object_property_add_uint16_ptr(Object *obj, const char
> *name,
> setter = property_set_uint16_ptr;
> }
>
> - return object_property_add(obj, name, "uint16",
> - getter, setter, NULL, (void *)v);
> + return object_property_add_qapi(obj, name, &uint16_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
Missing:
@@ -3030,7 +3031,7 @@ object_class_property_add_uint16_ptr(ObjectClass
*klass, const char *name,
setter = property_class_set_uint16_ptr;
}
- return object_class_property_add(klass, name, "uint16",
+ return object_class_property_add_qapi(klass, name, &uint16_type_info,
getter, setter, NULL, (void *)offset);
}
> @@ -3047,8 +3047,8 @@ object_class_static_property_add_uint16_ptr(ObjectClass
> *klass,
> setter = property_set_uint16_ptr;
> }
>
> - return object_class_property_add(klass, name, "uint16",
> - getter, setter, NULL, (void *)v);
> + return object_class_property_add_qapi(klass, name, &uint16_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
> @@ -3067,8 +3067,8 @@ object_property_add_uint32_ptr(Object *obj, const char
> *name,
> setter = property_set_uint32_ptr;
> }
>
> - return object_property_add(obj, name, "uint32",
> - getter, setter, NULL, (void *)v);
> + return object_property_add_qapi(obj, name, &uint32_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
Missing:
@@ -3091,7 +3092,7 @@ object_class_property_add_uint32_ptr(ObjectClass
*klass, const char *name,
setter = property_class_set_uint32_ptr;
}
- return object_class_property_add(klass, name, "uint32",
+ return object_class_property_add_qapi(klass, name, &uint32_type_info,
getter, setter, NULL, (void *)offset);
}
> @@ -3108,8 +3108,8 @@ object_class_static_property_add_uint32_ptr(ObjectClass
> *klass,
> setter = property_set_uint32_ptr;
> }
>
> - return object_class_property_add(klass, name, "uint32",
> - getter, setter, NULL, (void *)v);
> + return object_class_property_add_qapi(klass, name, &uint32_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
> @@ -3128,8 +3128,8 @@ object_property_add_uint64_ptr(Object *obj, const char
> *name,
> setter = property_set_uint64_ptr;
> }
>
> - return object_property_add(obj, name, "uint64",
> - getter, setter, NULL, (void *)v);
> + return object_property_add_qapi(obj, name, &uint64_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> ObjectProperty *
Missing:
@@ -3152,7 +3153,7 @@ object_class_property_add_uint64_ptr(ObjectClass
*klass, const char *name,
setter = property_class_set_uint64_ptr;
}
- return object_class_property_add(klass, name, "uint64",
+ return object_class_property_add_qapi(klass, name, &uint64_type_info,
getter, setter, NULL, (void *)offset);
}
> @@ -3169,8 +3169,8 @@ object_class_static_property_add_uint64_ptr(ObjectClass
> *klass,
> setter = property_set_uint64_ptr;
> }
>
> - return object_class_property_add(klass, name, "uint64",
> - getter, setter, NULL, (void *)v);
> + return object_class_property_add_qapi(klass, name, &uint64_type_info,
> + getter, setter, NULL, (void *)v);
> }
>
> typedef struct {
[...]
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index b2c7260c80a4..3a36fa4d0b95 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -3266,7 +3266,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void
> *data)
> x86_klass->adjust_cpuid_features = sev_snp_adjust_cpuid_features;
> x86_klass->kvm_type = sev_snp_kvm_type;
>
> - object_class_property_add(oc, "policy", "uint64",
> + object_class_property_add_qapi(oc, "policy", &uint64_type_info,
> sev_snp_guest_get_policy,
> sev_snp_guest_set_policy, NULL, NULL);
> object_class_property_add_str(oc, "guest-visible-workarounds",
Missing:
@@ -3290,7 +3290,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void
*data)
object_class_property_add_bool(oc, "secure-tsc",
sev_snp_guest_get_secure_tsc,
sev_snp_guest_set_secure_tsc);
- object_class_property_add(oc, "tsc-frequency", "uint32",
+ object_class_property_add_qapi(oc, "tsc-frequency", &uint32_type_info,
sev_snp_guest_get_tsc_frequency,
sev_snp_guest_set_tsc_frequency, NULL, NULL);
}
[...]
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |