migration: fix compiler warning on uninitialized variable
authorJeff Cody <jcody@redhat.com>
Mon, 31 Oct 2016 21:50:44 +0000 (17:50 -0400)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 1 Nov 2016 09:31:53 +0000 (09:31 +0000)
Some older GCC versions (e.g. 4.4.7) report a warning on an
uninitialized variable for 'request', even though all possible code
paths that reference 'request' will be initialized.   To appease
these versions, initialize the variable to 0.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Message-id: 259818682e41b95ae60f1423b87954a3fe377639.1477950393.git.jcody@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
migration/colo.c

index e7224b8a0afd20198ef17f25a53a2c0ca158c612..93c85c538b6ebde50b0513f3b015b47622db724d 100644 (file)
@@ -439,7 +439,7 @@ void *colo_process_incoming_thread(void *opaque)
     }
 
     while (mis->state == MIGRATION_STATUS_COLO) {
-        int request;
+        int request = 0;
 
         colo_wait_handle_message(mis->from_src_file, &request, &local_err);
         if (local_err) {