Re: [PATCH v1 02/25] libvirt-domain.c: modernize virDomainMigrateVersion1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/13/20 11:49 AM, Daniel Henrique Barboza wrote:
Use g_autofree on strings and remove the 'done' label since it's
now unneeded.

Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
  src/libvirt-domain.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 0941caa67f..6adb58a9ef 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c

@@ -2782,15 +2781,10 @@ virDomainMigrateVersion1(virDomainPtr domain,
       */
      dname = dname ? dname : domain->name;
      if (dconn->driver->domainMigrateFinish)
-        ddomain = dconn->driver->domainMigrateFinish
+        return dconn->driver->domainMigrateFinish
              (dconn, dname, cookie, cookielen, uri, destflags);
      else
-        ddomain = virDomainLookupByName(dconn, dname);

Might as well remove this else statement and ...

-
- done:
-    VIR_FREE(uri_out);
-    VIR_FREE(cookie);
-    return ddomain;
+        return virDomainLookupByName(dconn, dname);

.. do this return.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux