[PATCH 3/4] qemu: Small code cleanups in the managedsave functions

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

 



Save a few lines moving assignments into conditions and fix braces
position.
---
 src/qemu/qemu_driver.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 72da014..b1cb185 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3232,7 +3232,8 @@ qemuDomainSave(virDomainPtr dom, const char *path)
 }

 static char *
-qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm) {
+qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm)
+{
     char *ret;

     if (virAsprintf(&ret, "%s/%s.save", driver->saveDir, vm->def->name) < 0) {
@@ -3270,8 +3271,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
         goto cleanup;
     }

-    name = qemuDomainManagedSavePath(driver, vm);
-    if (name == NULL)
+    if (!(name = qemuDomainManagedSavePath(driver, vm)))
         goto cleanup;

     VIR_INFO("Saving state to %s", name);
@@ -3339,8 +3339,7 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
     if (!(vm = qemuDomObjFromDomainDriver(dom, &driver)))
         return -1;

-    name = qemuDomainManagedSavePath(driver, vm);
-    if (name == NULL)
+    if (!(name = qemuDomainManagedSavePath(driver, vm)))
         goto cleanup;

     ret = unlink(name);
-- 
1.8.0

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