qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 06/18] COLO: Introduce checkpointing protocol


From: Hailiang Zhang
Subject: Re: [Qemu-devel] [PULL 06/18] COLO: Introduce checkpointing protocol
Date: Tue, 1 Nov 2016 09:48:09 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 2016/11/1 2:25, Eduardo Habkost wrote:
On Sun, Oct 30, 2016 at 04:16:58PM +0530, Amit Shah wrote:
[...]
+static void colo_wait_handle_message(QEMUFile *f, int *checkpoint_request,
+                                     Error **errp)
+{
+    COLOMessage msg;
+    Error *local_err = NULL;
+
+    msg = colo_receive_message(f, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+
+    switch (msg) {
+    case COLO_MESSAGE_CHECKPOINT_REQUEST:
+        *checkpoint_request = 1;
+        break;
+    default:
+        *checkpoint_request = 0;
+        error_setg(errp, "Got unknown COLO message: %d", msg);
+        break;
+    }
+}
[...]
+        colo_wait_handle_message(mis->from_src_file, &request, &local_err);
+        if (local_err) {
+            goto out;
+        }
+        assert(request);

GCC 4.8.5 doesn't seem to be smart enough to notice that request
will be always initialized:

   /root/qemu/migration/colo.c: In function ‘colo_process_incoming_thread’:
   /root/qemu/migration/colo.c:448:33: error: ‘request’ may be used 
uninitialized in this function [-Werror=maybe-uninitialized]
            assert(request);
                                    ^
   cc1: all warnings being treated as errors

   $ gcc --version
   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)


Yes, you are right, Jeff has sent a patch to fix this
'[PATCH 1/1] migration: fix compiler warning on uninitialized variable'

Thanks,
Hailiang




reply via email to

[Prev in Thread] Current Thread [Next in Thread]