Message ID | 1411477717-6988-6-git-send-email-arei.gonglei@huawei.com |
---|---|
State | New |
Headers | show |
Il 23/09/2014 15:08, arei.gonglei@huawei.com ha scritto: > From: Gonglei <arei.gonglei@huawei.com> > > When we call qdev_alias_all_properties() adding alias properties to > the source object all qdev properties on the target DeviceState, > set the object property's description to the qdev property's. > > c: Paolo Bonzini <pbonzini@redhat.com> > Cc: Michael S. Tsirkin <mst@redhat.com> > Cc: Markus Armbruster <armbru@redhat.com> > Signed-off-by: Gonglei <arei.gonglei@huawei.com> > --- > hw/core/qdev.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index fcb1638..61d352c 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -796,6 +796,9 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) > object_property_add_alias(source, prop->name, > OBJECT(target), prop->name, > &error_abort); > + object_property_set_description(source, prop->name, > + prop->info->description, > + &error_abort); Please do this directly in object_property_add_alias. Paolo > } > class = object_class_get_parent(class); > } while (class != object_class_by_name(TYPE_DEVICE)); >
> Subject: Re: [PATCH 5/7] qdev: set the object property's description to the qdev > property's. > > Il 23/09/2014 15:08, arei.gonglei@huawei.com ha scritto: > > From: Gonglei <arei.gonglei@huawei.com> > > > > When we call qdev_alias_all_properties() adding alias properties to > > the source object all qdev properties on the target DeviceState, > > set the object property's description to the qdev property's. > > > > c: Paolo Bonzini <pbonzini@redhat.com> > > Cc: Michael S. Tsirkin <mst@redhat.com> > > Cc: Markus Armbruster <armbru@redhat.com> > > Signed-off-by: Gonglei <arei.gonglei@huawei.com> > > --- > > hw/core/qdev.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > > index fcb1638..61d352c 100644 > > --- a/hw/core/qdev.c > > +++ b/hw/core/qdev.c > > @@ -796,6 +796,9 @@ void qdev_alias_all_properties(DeviceState *target, > Object *source) > > object_property_add_alias(source, prop->name, > > OBJECT(target), > prop->name, > > &error_abort); > > + object_property_set_description(source, prop->name, > > + > prop->info->description, > > + &error_abort); > > Please do this directly in object_property_add_alias. > OK. This way I have to add a description string parametet to object_property_add_alias function. Will do in the next version. :) Best regards, -Gonglei > Paolo > > > } > > class = object_class_get_parent(class); > > } while (class != object_class_by_name(TYPE_DEVICE)); > >
Il 24/09/2014 02:42, Gonglei (Arei) ha scritto: > OK. > > This way I have to add a description string parametet to > object_property_add_alias function. Will do in the next version. :) No, just take it from the original property. So if you alias A.X to B.Y, you copy the description of B.Y. Paolo
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo > Bonzini > Sent: Wednesday, September 24, 2014 2:54 PM > Subject: Re: [PATCH 5/7] qdev: set the object property's description to the qdev > property's. > > Il 24/09/2014 02:42, Gonglei (Arei) ha scritto: > > OK. > > > > This way I have to add a description string parametet to > > object_property_add_alias function. Will do in the next version. :) > > No, just take it from the original property. So if you alias A.X to > B.Y, you copy the description of B.Y. > But the description of B.Y wasn't set. Only qdev_alias_all_properties() call object_property_set_description() to set the description filed of ObjectProerty at present. Best regards, -Gonglei
Hi, > > > > Il 24/09/2014 02:42, Gonglei (Arei) ha scritto: > > > OK. > > > > > > This way I have to add a description string parametet to > > > object_property_add_alias function. Will do in the next version. :) > > > > No, just take it from the original property. So if you alias A.X to > > B.Y, you copy the description of B.Y. > > > > But the description of B.Y wasn't set. Only qdev_alias_all_properties() > call object_property_set_description() to set the description filed of > ObjectProerty at present. > I should set description at qdev_property_add_static(), then everything will be well. :) Thanks! Best regards, -Gonglei
Il 24/09/2014 11:12, Gonglei (Arei) ha scritto: >> > But the description of B.Y wasn't set. Only qdev_alias_all_properties() >> > call object_property_set_description() to set the description filed of >> > ObjectProerty at present. >> > > I should set description at qdev_property_add_static(), then > everything will be well. :) Thanks! Yes. :) Paolo
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index fcb1638..61d352c 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -796,6 +796,9 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) object_property_add_alias(source, prop->name, OBJECT(target), prop->name, &error_abort); + object_property_set_description(source, prop->name, + prop->info->description, + &error_abort); } class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE));