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

[libvirt] [PATCH 6/6] vz: make error path code idiomatic



Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy virtuozzo com>
---
 src/vz/vz_sdk.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7937699..cca5459 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3548,8 +3548,7 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
 
     }
 
-    ret = prlsdkDoApplyConfig(conn, sdkdom, def, NULL);
-    if (ret)
+    if (prlsdkDoApplyConfig(conn, sdkdom, def, NULL) < 0)
         goto cleanup;
 
     flags = PACF_NON_INTERACTIVE_MODE;
@@ -3557,7 +3556,9 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
         flags |= PRNVM_PRESERVE_DISK;
     job = PrlVm_RegEx(sdkdom, "", flags);
     if (PRL_FAILED(waitJob(job)))
-        ret = -1;
+        goto cleanup;
+
+    ret = 0;
 
  cleanup:
     PrlHandle_Free(sdkdom);
-- 
1.8.3.1


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