[PATCH] qemu: return -1 on error paths in qemuDomainSaveImageStartVM

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

 



The error paths after fix suppose ret == -1 as at the
beginning of the function.

The better fix would be not to touch 'ret' at all until
the end of the function where it is set to 0. Thus we'd
better introduce some 'rc' variable to hold return
values of called functions.
---
 src/qemu/qemu_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 351e529..dfbf846 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6790,6 +6790,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
         virDomainAuditStart(vm, "restored", false);
         goto cleanup;
     }
+    ret = -1;
 
     event = virDomainEventLifecycleNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STARTED,
-- 
1.8.3.1

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