Message ID | 20201029220246.472693-25-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
Series | Make qdev static property API usable by any QOM type | expand |
On Fri, Oct 30, 2020 at 2:13 AM Eduardo Habkost <ehabkost@redhat.com> wrote: > These functions will be moved to be part of QOM, so rename them. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: "Daniel P. Berrangé" <berrange@redhat.com> > Cc: Eduardo Habkost <ehabkost@redhat.com> > Cc: qemu-devel@nongnu.org > --- > hw/core/qdev-prop-internal.h | 28 +++++++++---------- > hw/core/qdev-properties-system.c | 48 ++++++++++++++++---------------- > hw/core/qdev-properties.c | 48 ++++++++++++++++---------------- > 3 files changed, 62 insertions(+), 62 deletions(-) > > diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h > index c8006a21c7..41ec9e8942 100644 > --- a/hw/core/qdev-prop-internal.h > +++ b/hw/core/qdev-prop-internal.h > @@ -8,22 +8,22 @@ > #ifndef HW_CORE_QDEV_PROP_INTERNAL_H > #define HW_CORE_QDEV_PROP_INTERNAL_H > > -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, > - void *opaque, Error **errp); > -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, > - void *opaque, Error **errp); > +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name, > + void *opaque, Error **errp); > +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name, > + void *opaque, Error **errp); > > -void qdev_propinfo_set_default_value_enum(ObjectProperty *op, > - const Property *prop); > -void qdev_propinfo_set_default_value_int(ObjectProperty *op, > - const Property *prop); > -void qdev_propinfo_set_default_value_uint(ObjectProperty *op, > - const Property *prop); > +void object_propinfo_set_default_value_enum(ObjectProperty *op, > + const Property *prop); > +void object_propinfo_set_default_value_int(ObjectProperty *op, > + const Property *prop); > +void object_propinfo_set_default_value_uint(ObjectProperty *op, > + const Property *prop); > > -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, > - void *opaque, Error **errp); > -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, > - void *opaque, Error **errp); > +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name, > + void *opaque, Error **errp); > +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name, > + void *opaque, Error **errp); > > /** > * object_property_add_static: Add a static property to an object instance > diff --git a/hw/core/qdev-properties-system.c > b/hw/core/qdev-properties-system.c > index 60a45f5620..d9355053d2 100644 > --- a/hw/core/qdev-properties-system.c > +++ b/hw/core/qdev-properties-system.c > @@ -535,9 +535,9 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != > sizeof(int)); > const PropertyInfo qdev_prop_losttickpolicy = { > .name = "LostTickPolicy", > .enum_table = &LostTickPolicy_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- blocksize --- */ > @@ -566,9 +566,9 @@ const PropertyInfo qdev_prop_blocksize = { > .name = "size", > .description = "A power of two between " MIN_BLOCK_SIZE_STR > " and " MAX_BLOCK_SIZE_STR, > - .get = qdev_propinfo_get_size32, > + .get = object_propinfo_get_size32, > .set = set_blocksize, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- Block device error handling policy --- */ > @@ -580,9 +580,9 @@ const PropertyInfo qdev_prop_blockdev_on_error = { > .description = "Error handling policy, " > "report/ignore/enospc/stop/auto", > .enum_table = &BlockdevOnError_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- BIOS CHS translation */ > @@ -594,9 +594,9 @@ const PropertyInfo qdev_prop_bios_chs_trans = { > .description = "Logical CHS translation algorithm, " > "auto/none/lba/large/rechs", > .enum_table = &BiosAtaTranslation_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- FDC default drive types */ > @@ -606,9 +606,9 @@ const PropertyInfo qdev_prop_fdc_drive_type = { > .description = "FDC drive type, " > "144/288/120/none/auto", > .enum_table = &FloppyDriveType_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- MultiFDCompression --- */ > @@ -618,9 +618,9 @@ const PropertyInfo qdev_prop_multifd_compression = { > .description = "multifd_compression values, " > "none/zlib/zstd", > .enum_table = &MultiFDCompression_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- Reserved Region --- */ > @@ -764,9 +764,9 @@ const PropertyInfo qdev_prop_pci_devfn = { > .name = "int32", > .description = "Slot and optional function number, example: 06.0 or > 06", > .print = print_pci_devfn, > - .get = qdev_propinfo_get_int32, > + .get = object_propinfo_get_int32, > .set = set_pci_devfn, > - .set_default_value = qdev_propinfo_set_default_value_int, > + .set_default_value = object_propinfo_set_default_value_int, > }; > > /* --- pci host address --- */ > @@ -879,9 +879,9 @@ const PropertyInfo qdev_prop_off_auto_pcibar = { > .name = "OffAutoPCIBAR", > .description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", > .enum_table = &OffAutoPCIBAR_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- PCIELinkSpeed 2_5/5/8/16 -- */ > @@ -951,7 +951,7 @@ const PropertyInfo qdev_prop_pcie_link_speed = { > .enum_table = &PCIELinkSpeed_lookup, > .get = get_prop_pcielinkspeed, > .set = set_prop_pcielinkspeed, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */ > @@ -1039,5 +1039,5 @@ const PropertyInfo qdev_prop_pcie_link_width = { > .enum_table = &PCIELinkWidth_lookup, > .get = get_prop_pcielinkwidth, > .set = set_prop_pcielinkwidth, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c > index 5189626c09..e4aba2b237 100644 > --- a/hw/core/qdev-properties.c > +++ b/hw/core/qdev-properties.c > @@ -93,7 +93,7 @@ static ObjectPropertyAccessor *static_prop_setter(const > PropertyInfo *info) > return info->set ? static_prop_set : NULL; > } > > -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, > +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name, > void *opaque, Error **errp) > { > Property *prop = opaque; > @@ -102,7 +102,7 @@ void qdev_propinfo_get_enum(Object *obj, Visitor *v, > const char *name, > visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); > } > > -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, > +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name, > void *opaque, Error **errp) > { > Property *prop = opaque; > @@ -111,7 +111,7 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, > const char *name, > visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); > } > > -void qdev_propinfo_set_default_value_enum(ObjectProperty *op, > +void object_propinfo_set_default_value_enum(ObjectProperty *op, > const Property *prop) > { > object_property_set_default_str(op, > @@ -120,9 +120,9 @@ void > qdev_propinfo_set_default_value_enum(ObjectProperty *op, > > const PropertyInfo qdev_prop_enum = { > .name = "enum", > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* Bit */ > @@ -275,13 +275,13 @@ static void set_uint8(Object *obj, Visitor *v, const > char *name, void *opaque, > visit_type_uint8(v, name, ptr, errp); > } > > -void qdev_propinfo_set_default_value_int(ObjectProperty *op, > +void object_propinfo_set_default_value_int(ObjectProperty *op, > const Property *prop) > { > object_property_set_default_int(op, prop->defval.i); > } > > -void qdev_propinfo_set_default_value_uint(ObjectProperty *op, > +void object_propinfo_set_default_value_uint(ObjectProperty *op, > const Property *prop) > { > object_property_set_default_uint(op, prop->defval.u); > @@ -291,7 +291,7 @@ const PropertyInfo qdev_prop_uint8 = { > .name = "uint8", > .get = get_uint8, > .set = set_uint8, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- 16bit integer --- */ > @@ -318,7 +318,7 @@ const PropertyInfo qdev_prop_uint16 = { > .name = "uint16", > .get = get_uint16, > .set = set_uint16, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- 32bit integer --- */ > @@ -341,7 +341,7 @@ static void set_uint32(Object *obj, Visitor *v, const > char *name, > visit_type_uint32(v, name, ptr, errp); > } > > -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, > +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name, > void *opaque, Error **errp) > { > Property *prop = opaque; > @@ -363,14 +363,14 @@ const PropertyInfo qdev_prop_uint32 = { > .name = "uint32", > .get = get_uint32, > .set = set_uint32, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > const PropertyInfo qdev_prop_int32 = { > .name = "int32", > - .get = qdev_propinfo_get_int32, > + .get = object_propinfo_get_int32, > .set = set_int32, > - .set_default_value = qdev_propinfo_set_default_value_int, > + .set_default_value = object_propinfo_set_default_value_int, > }; > > /* --- 64bit integer --- */ > @@ -415,14 +415,14 @@ const PropertyInfo qdev_prop_uint64 = { > .name = "uint64", > .get = get_uint64, > .set = set_uint64, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > const PropertyInfo qdev_prop_int64 = { > .name = "int64", > .get = get_int64, > .set = set_int64, > - .set_default_value = qdev_propinfo_set_default_value_int, > + .set_default_value = object_propinfo_set_default_value_int, > }; > > /* --- string --- */ > @@ -474,14 +474,14 @@ const PropertyInfo qdev_prop_on_off_auto = { > .name = "OnOffAuto", > .description = "on/off/auto", > .enum_table = &OnOffAuto_lookup, > - .get = qdev_propinfo_get_enum, > - .set = qdev_propinfo_set_enum, > - .set_default_value = qdev_propinfo_set_default_value_enum, > + .get = object_propinfo_get_enum, > + .set = object_propinfo_set_enum, > + .set_default_value = object_propinfo_set_default_value_enum, > }; > > /* --- 32bit unsigned int 'size' type --- */ > > -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, > +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name, > void *opaque, Error **errp) > { > Property *prop = opaque; > @@ -515,9 +515,9 @@ static void set_size32(Object *obj, Visitor *v, const > char *name, void *opaque, > > const PropertyInfo qdev_prop_size32 = { > .name = "size", > - .get = qdev_propinfo_get_size32, > + .get = object_propinfo_get_size32, > .set = set_size32, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- UUID --- */ > @@ -686,7 +686,7 @@ const PropertyInfo qdev_prop_arraylen = { > .name = "uint32", > .get = get_uint32, > .set = set_prop_arraylen, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- public helpers --- */ > @@ -885,7 +885,7 @@ const PropertyInfo qdev_prop_size = { > .name = "size", > .get = get_size, > .set = set_size, > - .set_default_value = qdev_propinfo_set_default_value_uint, > + .set_default_value = object_propinfo_set_default_value_uint, > }; > > /* --- object link property --- */ > -- > 2.28.0 > > > -- Marc-André Lureau <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 30, 2020 at 2:13 AM Eduardo Habkost <<a href="mailto:ehabkost@redhat.com">ehabkost@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">These functions will be moved to be part of QOM, so rename them.<br> <br> Signed-off-by: Eduardo Habkost <<a href="mailto:ehabkost@redhat.com" target="_blank">ehabkost@redhat.com</a>><br></blockquote><div><br></div><div><div>Reviewed-by: Marc-André Lureau <<a href="mailto:marcandre.lureau@redhat.com" target="_blank">marcandre.lureau@redhat.com</a>></div><div><br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> ---<br> Cc: Paolo Bonzini <<a href="mailto:pbonzini@redhat.com" target="_blank">pbonzini@redhat.com</a>><br> Cc: "Daniel P. Berrangé" <<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>><br> Cc: Eduardo Habkost <<a href="mailto:ehabkost@redhat.com" target="_blank">ehabkost@redhat.com</a>><br> Cc: <a href="mailto:qemu-devel@nongnu.org" target="_blank">qemu-devel@nongnu.org</a><br> ---<br> hw/core/qdev-prop-internal.h | 28 +++++++++----------<br> hw/core/qdev-properties-system.c | 48 ++++++++++++++++----------------<br> hw/core/qdev-properties.c | 48 ++++++++++++++++----------------<br> 3 files changed, 62 insertions(+), 62 deletions(-)<br> <br> diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h<br> index c8006a21c7..41ec9e8942 100644<br> --- a/hw/core/qdev-prop-internal.h<br> +++ b/hw/core/qdev-prop-internal.h<br> @@ -8,22 +8,22 @@<br> #ifndef HW_CORE_QDEV_PROP_INTERNAL_H<br> #define HW_CORE_QDEV_PROP_INTERNAL_H<br> <br> -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,<br> - void *opaque, Error **errp);<br> -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,<br> - void *opaque, Error **errp);<br> +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name,<br> + void *opaque, Error **errp);<br> +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name,<br> + void *opaque, Error **errp);<br> <br> -void qdev_propinfo_set_default_value_enum(ObjectProperty *op,<br> - const Property *prop);<br> -void qdev_propinfo_set_default_value_int(ObjectProperty *op,<br> - const Property *prop);<br> -void qdev_propinfo_set_default_value_uint(ObjectProperty *op,<br> - const Property *prop);<br> +void object_propinfo_set_default_value_enum(ObjectProperty *op,<br> + const Property *prop);<br> +void object_propinfo_set_default_value_int(ObjectProperty *op,<br> + const Property *prop);<br> +void object_propinfo_set_default_value_uint(ObjectProperty *op,<br> + const Property *prop);<br> <br> -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,<br> - void *opaque, Error **errp);<br> -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,<br> - void *opaque, Error **errp);<br> +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name,<br> + void *opaque, Error **errp);<br> +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name,<br> + void *opaque, Error **errp);<br> <br> /**<br> * object_property_add_static: Add a static property to an object instance<br> diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c<br> index 60a45f5620..d9355053d2 100644<br> --- a/hw/core/qdev-properties-system.c<br> +++ b/hw/core/qdev-properties-system.c<br> @@ -535,9 +535,9 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != sizeof(int));<br> const PropertyInfo qdev_prop_losttickpolicy = {<br> .name = "LostTickPolicy",<br> .enum_table = &LostTickPolicy_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- blocksize --- */<br> @@ -566,9 +566,9 @@ const PropertyInfo qdev_prop_blocksize = {<br> .name = "size",<br> .description = "A power of two between " MIN_BLOCK_SIZE_STR<br> " and " MAX_BLOCK_SIZE_STR,<br> - .get = qdev_propinfo_get_size32,<br> + .get = object_propinfo_get_size32,<br> .set = set_blocksize,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- Block device error handling policy --- */<br> @@ -580,9 +580,9 @@ const PropertyInfo qdev_prop_blockdev_on_error = {<br> .description = "Error handling policy, "<br> "report/ignore/enospc/stop/auto",<br> .enum_table = &BlockdevOnError_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- BIOS CHS translation */<br> @@ -594,9 +594,9 @@ const PropertyInfo qdev_prop_bios_chs_trans = {<br> .description = "Logical CHS translation algorithm, "<br> "auto/none/lba/large/rechs",<br> .enum_table = &BiosAtaTranslation_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- FDC default drive types */<br> @@ -606,9 +606,9 @@ const PropertyInfo qdev_prop_fdc_drive_type = {<br> .description = "FDC drive type, "<br> "144/288/120/none/auto",<br> .enum_table = &FloppyDriveType_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- MultiFDCompression --- */<br> @@ -618,9 +618,9 @@ const PropertyInfo qdev_prop_multifd_compression = {<br> .description = "multifd_compression values, "<br> "none/zlib/zstd",<br> .enum_table = &MultiFDCompression_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- Reserved Region --- */<br> @@ -764,9 +764,9 @@ const PropertyInfo qdev_prop_pci_devfn = {<br> .name = "int32",<br> .description = "Slot and optional function number, example: 06.0 or 06",<br> .print = print_pci_devfn,<br> - .get = qdev_propinfo_get_int32,<br> + .get = object_propinfo_get_int32,<br> .set = set_pci_devfn,<br> - .set_default_value = qdev_propinfo_set_default_value_int,<br> + .set_default_value = object_propinfo_set_default_value_int,<br> };<br> <br> /* --- pci host address --- */<br> @@ -879,9 +879,9 @@ const PropertyInfo qdev_prop_off_auto_pcibar = {<br> .name = "OffAutoPCIBAR",<br> .description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5",<br> .enum_table = &OffAutoPCIBAR_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- PCIELinkSpeed 2_5/5/8/16 -- */<br> @@ -951,7 +951,7 @@ const PropertyInfo qdev_prop_pcie_link_speed = {<br> .enum_table = &PCIELinkSpeed_lookup,<br> .get = get_prop_pcielinkspeed,<br> .set = set_prop_pcielinkspeed,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */<br> @@ -1039,5 +1039,5 @@ const PropertyInfo qdev_prop_pcie_link_width = {<br> .enum_table = &PCIELinkWidth_lookup,<br> .get = get_prop_pcielinkwidth,<br> .set = set_prop_pcielinkwidth,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c<br> index 5189626c09..e4aba2b237 100644<br> --- a/hw/core/qdev-properties.c<br> +++ b/hw/core/qdev-properties.c<br> @@ -93,7 +93,7 @@ static ObjectPropertyAccessor *static_prop_setter(const PropertyInfo *info)<br> return info->set ? static_prop_set : NULL;<br> }<br> <br> -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,<br> +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name,<br> void *opaque, Error **errp)<br> {<br> Property *prop = opaque;<br> @@ -102,7 +102,7 @@ void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,<br> visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp);<br> }<br> <br> -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,<br> +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name,<br> void *opaque, Error **errp)<br> {<br> Property *prop = opaque;<br> @@ -111,7 +111,7 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,<br> visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp);<br> }<br> <br> -void qdev_propinfo_set_default_value_enum(ObjectProperty *op,<br> +void object_propinfo_set_default_value_enum(ObjectProperty *op,<br> const Property *prop)<br> {<br> object_property_set_default_str(op,<br> @@ -120,9 +120,9 @@ void qdev_propinfo_set_default_value_enum(ObjectProperty *op,<br> <br> const PropertyInfo qdev_prop_enum = {<br> .name = "enum",<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* Bit */<br> @@ -275,13 +275,13 @@ static void set_uint8(Object *obj, Visitor *v, const char *name, void *opaque,<br> visit_type_uint8(v, name, ptr, errp);<br> }<br> <br> -void qdev_propinfo_set_default_value_int(ObjectProperty *op,<br> +void object_propinfo_set_default_value_int(ObjectProperty *op,<br> const Property *prop)<br> {<br> object_property_set_default_int(op, prop->defval.i);<br> }<br> <br> -void qdev_propinfo_set_default_value_uint(ObjectProperty *op,<br> +void object_propinfo_set_default_value_uint(ObjectProperty *op,<br> const Property *prop)<br> {<br> object_property_set_default_uint(op, prop->defval.u);<br> @@ -291,7 +291,7 @@ const PropertyInfo qdev_prop_uint8 = {<br> .name = "uint8",<br> .get = get_uint8,<br> .set = set_uint8,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- 16bit integer --- */<br> @@ -318,7 +318,7 @@ const PropertyInfo qdev_prop_uint16 = {<br> .name = "uint16",<br> .get = get_uint16,<br> .set = set_uint16,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- 32bit integer --- */<br> @@ -341,7 +341,7 @@ static void set_uint32(Object *obj, Visitor *v, const char *name,<br> visit_type_uint32(v, name, ptr, errp);<br> }<br> <br> -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,<br> +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name,<br> void *opaque, Error **errp)<br> {<br> Property *prop = opaque;<br> @@ -363,14 +363,14 @@ const PropertyInfo qdev_prop_uint32 = {<br> .name = "uint32",<br> .get = get_uint32,<br> .set = set_uint32,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> const PropertyInfo qdev_prop_int32 = {<br> .name = "int32",<br> - .get = qdev_propinfo_get_int32,<br> + .get = object_propinfo_get_int32,<br> .set = set_int32,<br> - .set_default_value = qdev_propinfo_set_default_value_int,<br> + .set_default_value = object_propinfo_set_default_value_int,<br> };<br> <br> /* --- 64bit integer --- */<br> @@ -415,14 +415,14 @@ const PropertyInfo qdev_prop_uint64 = {<br> .name = "uint64",<br> .get = get_uint64,<br> .set = set_uint64,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> const PropertyInfo qdev_prop_int64 = {<br> .name = "int64",<br> .get = get_int64,<br> .set = set_int64,<br> - .set_default_value = qdev_propinfo_set_default_value_int,<br> + .set_default_value = object_propinfo_set_default_value_int,<br> };<br> <br> /* --- string --- */<br> @@ -474,14 +474,14 @@ const PropertyInfo qdev_prop_on_off_auto = {<br> .name = "OnOffAuto",<br> .description = "on/off/auto",<br> .enum_table = &OnOffAuto_lookup,<br> - .get = qdev_propinfo_get_enum,<br> - .set = qdev_propinfo_set_enum,<br> - .set_default_value = qdev_propinfo_set_default_value_enum,<br> + .get = object_propinfo_get_enum,<br> + .set = object_propinfo_set_enum,<br> + .set_default_value = object_propinfo_set_default_value_enum,<br> };<br> <br> /* --- 32bit unsigned int 'size' type --- */<br> <br> -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,<br> +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name,<br> void *opaque, Error **errp)<br> {<br> Property *prop = opaque;<br> @@ -515,9 +515,9 @@ static void set_size32(Object *obj, Visitor *v, const char *name, void *opaque,<br> <br> const PropertyInfo qdev_prop_size32 = {<br> .name = "size",<br> - .get = qdev_propinfo_get_size32,<br> + .get = object_propinfo_get_size32,<br> .set = set_size32,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- UUID --- */<br> @@ -686,7 +686,7 @@ const PropertyInfo qdev_prop_arraylen = {<br> .name = "uint32",<br> .get = get_uint32,<br> .set = set_prop_arraylen,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- public helpers --- */<br> @@ -885,7 +885,7 @@ const PropertyInfo qdev_prop_size = {<br> .name = "size",<br> .get = get_size,<br> .set = set_size,<br> - .set_default_value = qdev_propinfo_set_default_value_uint,<br> + .set_default_value = object_propinfo_set_default_value_uint,<br> };<br> <br> /* --- object link property --- */<br> -- <br> 2.28.0<br> <br> <br> </blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>
diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c8006a21c7..41ec9e8942 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,22 +8,22 @@ #ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp); -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp); +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); -void qdev_propinfo_set_default_value_enum(ObjectProperty *op, - const Property *prop); -void qdev_propinfo_set_default_value_int(ObjectProperty *op, - const Property *prop); -void qdev_propinfo_set_default_value_uint(ObjectProperty *op, - const Property *prop); +void object_propinfo_set_default_value_enum(ObjectProperty *op, + const Property *prop); +void object_propinfo_set_default_value_int(ObjectProperty *op, + const Property *prop); +void object_propinfo_set_default_value_uint(ObjectProperty *op, + const Property *prop); -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp); -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp); +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); /** * object_property_add_static: Add a static property to an object instance diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 60a45f5620..d9355053d2 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -535,9 +535,9 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != sizeof(int)); const PropertyInfo qdev_prop_losttickpolicy = { .name = "LostTickPolicy", .enum_table = &LostTickPolicy_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- blocksize --- */ @@ -566,9 +566,9 @@ const PropertyInfo qdev_prop_blocksize = { .name = "size", .description = "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, - .get = qdev_propinfo_get_size32, + .get = object_propinfo_get_size32, .set = set_blocksize, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- Block device error handling policy --- */ @@ -580,9 +580,9 @@ const PropertyInfo qdev_prop_blockdev_on_error = { .description = "Error handling policy, " "report/ignore/enospc/stop/auto", .enum_table = &BlockdevOnError_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- BIOS CHS translation */ @@ -594,9 +594,9 @@ const PropertyInfo qdev_prop_bios_chs_trans = { .description = "Logical CHS translation algorithm, " "auto/none/lba/large/rechs", .enum_table = &BiosAtaTranslation_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- FDC default drive types */ @@ -606,9 +606,9 @@ const PropertyInfo qdev_prop_fdc_drive_type = { .description = "FDC drive type, " "144/288/120/none/auto", .enum_table = &FloppyDriveType_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- MultiFDCompression --- */ @@ -618,9 +618,9 @@ const PropertyInfo qdev_prop_multifd_compression = { .description = "multifd_compression values, " "none/zlib/zstd", .enum_table = &MultiFDCompression_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- Reserved Region --- */ @@ -764,9 +764,9 @@ const PropertyInfo qdev_prop_pci_devfn = { .name = "int32", .description = "Slot and optional function number, example: 06.0 or 06", .print = print_pci_devfn, - .get = qdev_propinfo_get_int32, + .get = object_propinfo_get_int32, .set = set_pci_devfn, - .set_default_value = qdev_propinfo_set_default_value_int, + .set_default_value = object_propinfo_set_default_value_int, }; /* --- pci host address --- */ @@ -879,9 +879,9 @@ const PropertyInfo qdev_prop_off_auto_pcibar = { .name = "OffAutoPCIBAR", .description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", .enum_table = &OffAutoPCIBAR_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- PCIELinkSpeed 2_5/5/8/16 -- */ @@ -951,7 +951,7 @@ const PropertyInfo qdev_prop_pcie_link_speed = { .enum_table = &PCIELinkSpeed_lookup, .get = get_prop_pcielinkspeed, .set = set_prop_pcielinkspeed, - .set_default_value = qdev_propinfo_set_default_value_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */ @@ -1039,5 +1039,5 @@ const PropertyInfo qdev_prop_pcie_link_width = { .enum_table = &PCIELinkWidth_lookup, .get = get_prop_pcielinkwidth, .set = set_prop_pcielinkwidth, - .set_default_value = qdev_propinfo_set_default_value_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 5189626c09..e4aba2b237 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -93,7 +93,7 @@ static ObjectPropertyAccessor *static_prop_setter(const PropertyInfo *info) return info->set ? static_prop_set : NULL; } -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, +void object_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; @@ -102,7 +102,7 @@ void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); } -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, +void object_propinfo_set_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; @@ -111,7 +111,7 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); } -void qdev_propinfo_set_default_value_enum(ObjectProperty *op, +void object_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, @@ -120,9 +120,9 @@ void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const PropertyInfo qdev_prop_enum = { .name = "enum", - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* Bit */ @@ -275,13 +275,13 @@ static void set_uint8(Object *obj, Visitor *v, const char *name, void *opaque, visit_type_uint8(v, name, ptr, errp); } -void qdev_propinfo_set_default_value_int(ObjectProperty *op, +void object_propinfo_set_default_value_int(ObjectProperty *op, const Property *prop) { object_property_set_default_int(op, prop->defval.i); } -void qdev_propinfo_set_default_value_uint(ObjectProperty *op, +void object_propinfo_set_default_value_uint(ObjectProperty *op, const Property *prop) { object_property_set_default_uint(op, prop->defval.u); @@ -291,7 +291,7 @@ const PropertyInfo qdev_prop_uint8 = { .name = "uint8", .get = get_uint8, .set = set_uint8, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- 16bit integer --- */ @@ -318,7 +318,7 @@ const PropertyInfo qdev_prop_uint16 = { .name = "uint16", .get = get_uint16, .set = set_uint16, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- 32bit integer --- */ @@ -341,7 +341,7 @@ static void set_uint32(Object *obj, Visitor *v, const char *name, visit_type_uint32(v, name, ptr, errp); } -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, +void object_propinfo_get_int32(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; @@ -363,14 +363,14 @@ const PropertyInfo qdev_prop_uint32 = { .name = "uint32", .get = get_uint32, .set = set_uint32, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; const PropertyInfo qdev_prop_int32 = { .name = "int32", - .get = qdev_propinfo_get_int32, + .get = object_propinfo_get_int32, .set = set_int32, - .set_default_value = qdev_propinfo_set_default_value_int, + .set_default_value = object_propinfo_set_default_value_int, }; /* --- 64bit integer --- */ @@ -415,14 +415,14 @@ const PropertyInfo qdev_prop_uint64 = { .name = "uint64", .get = get_uint64, .set = set_uint64, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; const PropertyInfo qdev_prop_int64 = { .name = "int64", .get = get_int64, .set = set_int64, - .set_default_value = qdev_propinfo_set_default_value_int, + .set_default_value = object_propinfo_set_default_value_int, }; /* --- string --- */ @@ -474,14 +474,14 @@ const PropertyInfo qdev_prop_on_off_auto = { .name = "OnOffAuto", .description = "on/off/auto", .enum_table = &OnOffAuto_lookup, - .get = qdev_propinfo_get_enum, - .set = qdev_propinfo_set_enum, - .set_default_value = qdev_propinfo_set_default_value_enum, + .get = object_propinfo_get_enum, + .set = object_propinfo_set_enum, + .set_default_value = object_propinfo_set_default_value_enum, }; /* --- 32bit unsigned int 'size' type --- */ -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, +void object_propinfo_get_size32(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; @@ -515,9 +515,9 @@ static void set_size32(Object *obj, Visitor *v, const char *name, void *opaque, const PropertyInfo qdev_prop_size32 = { .name = "size", - .get = qdev_propinfo_get_size32, + .get = object_propinfo_get_size32, .set = set_size32, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- UUID --- */ @@ -686,7 +686,7 @@ const PropertyInfo qdev_prop_arraylen = { .name = "uint32", .get = get_uint32, .set = set_prop_arraylen, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- public helpers --- */ @@ -885,7 +885,7 @@ const PropertyInfo qdev_prop_size = { .name = "size", .get = get_size, .set = set_size, - .set_default_value = qdev_propinfo_set_default_value_uint, + .set_default_value = object_propinfo_set_default_value_uint, }; /* --- object link property --- */
These functions will be moved to be part of QOM, so rename them. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: "Daniel P. Berrangé" <berrange@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: qemu-devel@nongnu.org --- hw/core/qdev-prop-internal.h | 28 +++++++++---------- hw/core/qdev-properties-system.c | 48 ++++++++++++++++---------------- hw/core/qdev-properties.c | 48 ++++++++++++++++---------------- 3 files changed, 62 insertions(+), 62 deletions(-)