[libvirt] [PATCH 1/2] openvz: Remove unnecessary Unref in openvzLoadDomains

John Ferlan posted 2 patches 7 years, 1 month ago
[libvirt] [PATCH 1/2] openvz: Remove unnecessary Unref in openvzLoadDomains
Posted by John Ferlan 7 years, 1 month ago
Since there is no way to get to cleanup without dom being NULL,
this is a unnecessary Unref.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/openvz/openvz_conf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 23a02d749e..a25eaf570e 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -626,7 +626,6 @@ int openvzLoadDomains(struct openvz_driver *driver)
     virCommandFree(cmd);
     VIR_FREE(temp);
     VIR_FREE(outbuf);
-    virObjectUnref(dom);
     virDomainDefFree(def);
     return -1;
 }
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] openvz: Remove unnecessary Unref in openvzLoadDomains
Posted by Ján Tomko 7 years ago
On Wed, Apr 11, 2018 at 12:57:07PM -0400, John Ferlan wrote:
>Since there is no way to get to cleanup without dom being NULL,
>this is a unnecessary Unref.
>

Actually, if we could get there it would be a bug, because
virDomainObjListAdd does not give us an extra reference, it just leaves
the domain locked.

>Signed-off-by: John Ferlan <jferlan@redhat.com>
>---
> src/openvz/openvz_conf.c | 1 -
> 1 file changed, 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list