[libvirt PATCH 09/16] qemu: remove superfluous cleanup: labels and ret return variables

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

 



After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 002eab43be..68c2f45535 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4826,7 +4826,6 @@ qemuProcessGetNetworkAddress(const char *netname,
                              char **netaddr)
 {
     g_autoptr(virConnect) conn = NULL;
-    int ret = -1;
     g_autoptr(virNetwork) net = NULL;
     g_autoptr(virNetworkDef) netdef = NULL;
     virNetworkIPDef *ipdef;
@@ -4842,15 +4841,15 @@ qemuProcessGetNetworkAddress(const char *netname,
 
     net = virNetworkLookupByName(conn, netname);
     if (!net)
-        goto cleanup;
+        return -1;
 
     xml = virNetworkGetXMLDesc(net, 0);
     if (!xml)
-        goto cleanup;
+        return -1;
 
     netdef = virNetworkDefParseString(xml, NULL, false);
     if (!netdef)
-        goto cleanup;
+        return -1;
 
     switch ((virNetworkForwardType) netdef->forward.type) {
     case VIR_NETWORK_FORWARD_NONE:
@@ -4862,7 +4861,7 @@ qemuProcessGetNetworkAddress(const char *netname,
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("network '%s' doesn't have an IP address"),
                            netdef->name);
-            goto cleanup;
+            return -1;
         }
         addrptr = &ipdef->address;
         break;
@@ -4886,7 +4885,7 @@ qemuProcessGetNetworkAddress(const char *netname,
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("network '%s' has no associated interface or bridge"),
                            netdef->name);
-            goto cleanup;
+            return -1;
         }
         break;
 
@@ -4896,23 +4895,21 @@ qemuProcessGetNetworkAddress(const char *netname,
     case VIR_NETWORK_FORWARD_LAST:
     default:
         virReportEnumRangeError(virNetworkForwardType, netdef->forward.type);
-        goto cleanup;
+        return -1;
     }
 
     if (dev_name) {
         if (virNetDevIPAddrGet(dev_name, &addr) < 0)
-            goto cleanup;
+            return -1;
         addrptr = &addr;
     }
 
     if (!(addrptr &&
           (*netaddr = virSocketAddrFormat(addrptr)))) {
-        goto cleanup;
+        return -1;
     }
 
-    ret = 0;
- cleanup:
-    return ret;
+    return 0;
 }
 
 
-- 
2.37.1




[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