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

[libvirt] [PATCH] parallels: don't forget to unlock domain after successful virDomainObjListFindByUUID call



Also a typo is fixed (s/detached/attached/)

Signed-off-by: Maxim Nestratov mnestratov parallels com
---
 src/parallels/parallels_driver.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 46e6c3e..41908a5 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -1081,7 +1081,7 @@ static int parallelsDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
     privdom = virDomainObjListFindByUUID(privconn->domains, dom->uuid);
     if (privdom == NULL) {
         parallelsDomNotFoundError(dom);
-        goto cleanup;
+        return -1;
     }
 
     if (!(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
@@ -1120,13 +1120,14 @@ static int parallelsDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
         break;
     default:
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
-                       _("device type '%s' cannot be detached"),
+                       _("device type '%s' cannot be attached"),
                        virDomainDeviceTypeToString(dev->type));
         break;
     }
 
     ret = 0;
  cleanup:
+    virObjectUnlock(privdom);
     return ret;
 }
 
-- 
1.7.1


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