[libvirt] [PATCH v5 10/15] Revert "interface: Consume @def in virInterfaceObjNew"

John Ferlan posted 15 patches 8 years, 5 months ago
[libvirt] [PATCH v5 10/15] Revert "interface: Consume @def in virInterfaceObjNew"
Posted by John Ferlan 8 years, 5 months ago
This reverts commit 92840eb3a7e47cdf761e52afccc41d2a35327fbd.

More recent reviews/changes don't have the vir*ObjNew APIs
consuming the @def, so remove from Interface as well. Changes
needed to also deal with conflicts from commit id '46f5eca4'.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/conf/virinterfaceobj.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index 106f232..e993b92 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -74,7 +74,7 @@ virInterfaceObjDispose(void *opaque)
 
 
 static virInterfaceObjPtr
-virInterfaceObjNew(virInterfaceDefPtr def)
+virInterfaceObjNew(void)
 {
     virInterfaceObjPtr obj;
 
@@ -85,7 +85,6 @@ virInterfaceObjNew(virInterfaceDefPtr def)
         return NULL;
 
     virObjectLock(obj);
-    obj->def = def;
 
     return obj;
 }
@@ -261,15 +260,15 @@ virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces,
         return obj;
     }
 
-    if (!(obj = virInterfaceObjNew(def)))
+    if (!(obj = virInterfaceObjNew()))
         return NULL;
 
     if (VIR_APPEND_ELEMENT_COPY(interfaces->objs,
                                 interfaces->count, obj) < 0) {
-        obj->def = NULL;
         virInterfaceObjEndAPI(&obj);
         return NULL;
     }
+    obj->def = def;
     return virObjectRef(obj);
 }
 
-- 
2.9.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 10/15] Revert "interface: Consume @def in virInterfaceObjNew"
Posted by Pavel Hrdina 8 years, 5 months ago
On Wed, Aug 23, 2017 at 05:22:06PM -0400, John Ferlan wrote:
> This reverts commit 92840eb3a7e47cdf761e52afccc41d2a35327fbd.
> 
> More recent reviews/changes don't have the vir*ObjNew APIs
> consuming the @def, so remove from Interface as well. Changes
> needed to also deal with conflicts from commit id '46f5eca4'.
> 
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/conf/virinterfaceobj.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list