Skip to contentSkip to conversation

qom: use object_new_with_type in object_new_with_propv

PATCH Applied Wei Yang 4 participants 5 messages Mar 11, 2019 – Apr 11, 2019 1 message not in the archive

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 qom: use object_new_with_type in object_new_with_propv

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]

---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -1
index 05a8567041..76d2f1eb2f 100644
@@ -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;
Signature · 1 line
2.19.1
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 25 lines · Wei Yang

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]

---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -2
index 05a8567041..76d2f1eb2f 100644
@@ -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;
--
Quoted 3 lines

2.19.1

Signature · 1 line
Marc-André Lureau
author
#2 lore raw
Quoted 25 lines · Marc-André Lureau

Hi

Quoted 22 lines · Wei Yang

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]

---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -1
index 05a8567041..76d2f1eb2f 100644
@@ -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);
 
Quoted 9 lines
Quoted 6 lines
qom/object.c +0 -1
     if (object_set_propv(obj, &local_err, vargs) < 0) {
         goto error;
--

2.19.1

Thanks :-)

Quoted 2 lines
Signature · 1 line
Marc-André Lureau
Signature · 2 lines
Wei Yang
Help you, Help me

A message that is not in the archive (sent off-list or not yet received): 20190312084313.webcenp43tk3yfmm@steredhat

#4 lore raw
Quoted 6 lines · Stefano Garzarella
Quoted 5 lines · Wei Yang

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]

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 1 line
Cc qemu-trivial for merging.
#5 lore raw
Quoted 17 lines · Markus Armbruster
Quoted 6 lines · Stefano Garzarella
Quoted 5 lines · Wei Yang

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]

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 6 lines

Yes. Whoever applies should delete this line.

Quoted 1 line
Cc qemu-trivial for merging.

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

Thanks,
Laurent