[Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv

Wei Yang posted 1 patch 6 years, 8 months ago
Test checkpatch passed
Test asan failed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190311083234.20841-1-richardw.yang@linux.intel.com
Maintainers: "Andreas Färber" <afaerber@suse.de>
qom/object.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Wei Yang 6 years, 8 months ago
Function object_new_with_propv already get the Type of the object, so we
could leverage object_new_with_type here.

[make check test pass]

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qom/object.c b/qom/object.c
index 05a8567041..76d2f1eb2f 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -640,7 +640,7 @@ Object *object_new_with_propv(const char *typename,
         error_setg(errp, "object type '%s' is abstract", typename);
         return NULL;
     }
-    obj = object_new(typename);
+    obj = object_new_with_type(klass->type);
 
     if (object_set_propv(obj, &local_err, vargs) < 0) {
         goto error;
-- 
2.19.1


Re: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Marc-André Lureau 6 years, 8 months ago
Hi

On Mon, Mar 11, 2019 at 9:34 AM Wei Yang <richardw.yang@linux.intel.com> wrote:
>
> Function object_new_with_propv already get the Type of the object, so we
> could leverage object_new_with_type here.
>
> [make check test pass]
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
>  qom/object.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index 05a8567041..76d2f1eb2f 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -640,7 +640,7 @@ Object *object_new_with_propv(const char *typename,
>          error_setg(errp, "object type '%s' is abstract", typename);
>          return NULL;
>      }
> -    obj = object_new(typename);
> +    obj = object_new_with_type(klass->type);
>
>      if (object_set_propv(obj, &local_err, vargs) < 0) {
>          goto error;
> --
> 2.19.1
>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

-- 
Marc-André Lureau

Re: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Wei Yang 6 years, 8 months ago
On Mon, Mar 11, 2019 at 06:08:10PM +0100, Marc-André Lureau wrote:
>Hi
>
>On Mon, Mar 11, 2019 at 9:34 AM Wei Yang <richardw.yang@linux.intel.com> wrote:
>>
>> Function object_new_with_propv already get the Type of the object, so we
>> could leverage object_new_with_type here.
>>
>> [make check test pass]
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>>  qom/object.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/qom/object.c b/qom/object.c
>> index 05a8567041..76d2f1eb2f 100644
>> --- a/qom/object.c
>> +++ b/qom/object.c
>> @@ -640,7 +640,7 @@ Object *object_new_with_propv(const char *typename,
>>          error_setg(errp, "object type '%s' is abstract", typename);
>>          return NULL;
>>      }
>> -    obj = object_new(typename);
>> +    obj = object_new_with_type(klass->type);
>>
>>      if (object_set_propv(obj, &local_err, vargs) < 0) {
>>          goto error;
>> --
>> 2.19.1
>>
>>
>
>Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>

Thanks :-)

>-- 
>Marc-André Lureau

-- 
Wei Yang
Help you, Help me

Re: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Stefano Garzarella 6 years, 8 months ago
On Mon, Mar 11, 2019 at 04:32:34PM +0800, Wei Yang wrote:
> Function object_new_with_propv already get the Type of the object, so we
> could leverage object_new_with_type here.
> 
> [make check test pass]
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
>  qom/object.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM. Just a note for future patches:
I think that info like "[make check test pass]" should go after the
three dashes to avoid to store it in the commit message.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Thanks,
Stefano

Re: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Markus Armbruster 6 years, 7 months ago
Stefano Garzarella <sgarzare@redhat.com> writes:

> On Mon, Mar 11, 2019 at 04:32:34PM +0800, Wei Yang wrote:
>> Function object_new_with_propv already get the Type of the object, so we
>> could leverage object_new_with_type here.
>> 
>> [make check test pass]
>> 
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>>  qom/object.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> LGTM. Just a note for future patches:
> I think that info like "[make check test pass]" should go after the
> three dashes to avoid to store it in the commit message.

Yes.  Whoever applies  should delete this line.

> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Cc: qemu-trivial for merging.

Re: [Qemu-devel] [Qemu-trivial] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Laurent Vivier 6 years, 7 months ago
On 02/04/2019 08:27, Markus Armbruster wrote:
> Stefano Garzarella <sgarzare@redhat.com> writes:
> 
>> On Mon, Mar 11, 2019 at 04:32:34PM +0800, Wei Yang wrote:
>>> Function object_new_with_propv already get the Type of the object, so we
>>> could leverage object_new_with_type here.
>>>
>>> [make check test pass]
>>>
>>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>>> ---
>>>  qom/object.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> LGTM. Just a note for future patches:
>> I think that info like "[make check test pass]" should go after the
>> three dashes to avoid to store it in the commit message.
> 
> Yes.  Whoever applies  should delete this line.
> 
>> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
> 
> Cc: qemu-trivial for merging.
> 

Applied to my trivial-patches branch with updated commit message.

Thanks,
Laurent

Re: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv
Posted by Wei Yang 6 years, 8 months ago
On Tue, Mar 12, 2019 at 09:43:13AM +0100, Stefano Garzarella wrote:
>On Mon, Mar 11, 2019 at 04:32:34PM +0800, Wei Yang wrote:
>> Function object_new_with_propv already get the Type of the object, so we
>> could leverage object_new_with_type here.
>> 
>> [make check test pass]
>> 
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>>  qom/object.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>LGTM. Just a note for future patches:
>I think that info like "[make check test pass]" should go after the
>three dashes to avoid to store it in the commit message.
>

Thanks for reminding :-)

>Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
>Thanks,
>Stefano

-- 
Wei Yang
Help you, Help me