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

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

 



From: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 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 b595fe7..4fe9bfa 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3777,8 +3777,7 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
 
     }
 
-    ret = prlsdkDoApplyConfig(driver, sdkdom, def, NULL);
-    if (ret)
+    if (prlsdkDoApplyConfig(driver, sdkdom, def, NULL) < 0)
         goto cleanup;
 
     flags = PACF_NON_INTERACTIVE_MODE;
@@ -3786,7 +3785,9 @@ prlsdkCreateCt(vzDriverPtr driver, 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);
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]