]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: remove unneeded locking of driver when restoring
authorJim Fehlig <jfehlig@suse.com>
Wed, 5 Feb 2014 19:50:52 +0000 (12:50 -0700)
committerJim Fehlig <jfehlig@suse.com>
Thu, 6 Feb 2014 17:39:32 +0000 (10:39 -0700)
libxlDomainRestoreFlags acquires the driver lock while reading the
domain config from the save file and adding it to
libxlDriverPrivatePtr->domains.  But virDomainObjList provides
self-locking APIs, so remove the needless driver locking.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_driver.c

index b852279e4a0cfd503655953ab3c786a2e16372cc..03aa463b239b1a540a6c2c8385bc175b727ba0df 100644 (file)
@@ -1956,11 +1956,6 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
         return -1;
     }
 
-    /* Lock the driver until domain def is read from the saved
-       image and a virDomainObj is created and locked.
-    */
-    libxlDriverLock(driver);
-
     fd = libxlSaveImageOpen(driver, cfg, from, &def, &hdr);
     if (fd < 0)
         goto cleanup_unlock;
@@ -1975,7 +1970,6 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
                                    NULL)))
         goto cleanup_unlock;
 
-    libxlDriverUnlock(driver);
     def = NULL;
 
     ret = libxlVmStart(driver, vm, (flags & VIR_DOMAIN_SAVE_PAUSED) != 0, fd);