From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1OCB-0007Wn-6N for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:49:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1OC8-0001DZ-4M for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:48:59 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:43733) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1OC7-00019L-Gl for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:48:56 -0400 References: <1477824430-1460-1-git-send-email-amit.shah@redhat.com> <1477824430-1460-7-git-send-email-amit.shah@redhat.com> <20161031182507.GB25480@thinpad.lan.raisama.net> From: Hailiang Zhang Message-ID: <5817F459.2060702@huawei.com> Date: Tue, 1 Nov 2016 09:48:09 +0800 MIME-Version: 1.0 In-Reply-To: <20161031182507.GB25480@thinpad.lan.raisama.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PULL 06/18] COLO: Introduce checkpointing protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , Amit Shah Cc: Peter Maydell , qemu list , "Dr. David Alan Gilbert" , Juan Quintela 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