[libvirt] [PATCH 3/3] libxl: remove unneeded cleanup_unlock label

Jim Fehlig jfehlig at suse.com
Wed Mar 4 00:09:03 UTC 2015


In the old days of a global driver lock, it was necessary to unlock
the driver after a domain restore operation.  When the global lock
was removed from the driver, some remnants were left behind in
libxlDomainRestoreFlags.  Remove this unneeded (and incorrect) code.

Signed-off-by: Jim Fehlig <jfehlig at suse.com>
---
 src/libxl/libxl_driver.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ce3a99b..55fa64f 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1464,17 +1464,17 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
 
     fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr);
     if (fd < 0)
-        goto cleanup_unlock;
+        return -1;
 
     if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
-        goto cleanup_unlock;
+        return -1;
 
     if (!(vm = virDomainObjListAdd(driver->domains, def,
                                    driver->xmlopt,
                                    VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
                                    VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                    NULL)))
-        goto cleanup_unlock;
+        goto cleanup;
 
     def = NULL;
 
@@ -1492,10 +1492,6 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
         virObjectUnlock(vm);
     virObjectUnref(cfg);
     return ret;
-
- cleanup_unlock:
-    libxlDriverUnlock(driver);
-    goto cleanup;
 }
 
 static int
-- 
1.8.4.5




More information about the libvir-list mailing list