[libvirt] [PATCH] qemu: fix build with clang

Roman Bogorodskiy posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170326044743.31786-1-bogorodskiy@gmail.com
src/qemu/qemu_migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: fix build with clang
Posted by Roman Bogorodskiy 7 years ago
qemuMigrationResetTLS() does not initialize 'ret' by default,
so when it jumps to 'cleanup' on error, the 'ret' variable will be
uninitialized, which clang complains about.

Set it to '-1' by default.
---
Pushed under the build-breaker rule.

 src/qemu/qemu_migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d91279ec6..a69e8784a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3815,7 +3815,7 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver,
     char *tlsAlias = in_tlsAlias;
     char *secAlias = in_secAlias;
     qemuMonitorMigrationParams migParams = { 0 };
-    int ret;
+    int ret = -1;
 
     /* If coming from a path that doesn't know whether it's been used or not,
      * let's first check we need to do this. If the tls-creds doesn't exist
-- 
2.11.0

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