Changeset
src/openvz/openvz_conf.c   | 1 -
src/openvz/openvz_driver.c | 8 ++------
2 files changed, 2 insertions(+), 7 deletions(-)
Git apply log
Switched to a new branch '20180411165708.5990-1-jferlan@redhat.com'
Applying: openvz: Remove unnecessary Unref in openvzLoadDomains
Applying: openvz: Clean up openvzDomainGetHostname
To https://github.com/patchew-project/libvirt
 + ddc250c...83bb751 patchew/20180411165708.5990-1-jferlan@redhat.com -> patchew/20180411165708.5990-1-jferlan@redhat.com (forced update)
Test passed: syntax-check

loading

[libvirt] [PATCH 0/2] A couple of openvz fixups
Posted by John Ferlan, 1 week ago
Patch 1 came from "the next part" of the code when I determined
that the Unref was unnecessary

Patch 2 is a result of Jim Fehlig's review that openvzDomainGetHostname
doesn't really need the error/cleanup logic.

John Ferlan (2):
  openvz: Remove unnecessary Unref in openvzLoadDomains
  openvz: Clean up openvzDomainGetHostname

 src/openvz/openvz_conf.c   | 1 -
 src/openvz/openvz_driver.c | 8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)

-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] openvz: Remove unnecessary Unref in openvzLoadDomains
Posted by John Ferlan, 1 week 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, 3 days 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
[libvirt] [PATCH 2/2] openvz: Clean up openvzDomainGetHostname
Posted by John Ferlan, 1 week ago
Remove the unnecessary goto error followed by goto cleanup
processing.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/openvz/openvz_driver.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index ec9541840a..2c62dd6f29 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -319,22 +319,18 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
 
     hostname = openvzVEGetStringParam(dom, "hostname");
     if (hostname == NULL)
-        goto error;
+        goto cleanup;
 
     /* vzlist prints an unset hostname as '-' */
     if (STREQ(hostname, "-")) {
         virReportError(VIR_ERR_OPERATION_FAILED,
                        _("Hostname of '%s' is unset"), vm->def->name);
-        goto error;
+        VIR_FREE(hostname);
     }
 
  cleanup:
     virDomainObjEndAPI(&vm);
     return hostname;
-
- error:
-    VIR_FREE(hostname);
-    goto cleanup;
 }
 
 
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] openvz: Clean up openvzDomainGetHostname
Posted by Ján Tomko, 3 days ago
On Wed, Apr 11, 2018 at 12:57:08PM -0400, John Ferlan wrote:
>Remove the unnecessary goto error followed by goto cleanup
>processing.
>
>Signed-off-by: John Ferlan <jferlan@redhat.com>
>---
> src/openvz/openvz_driver.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>

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