From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwvXG-0005B0-Hp for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:19:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwvXD-0005Q4-FH for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:19:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwvXD-0005Py-9e for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:19:43 -0500 From: Juan Quintela In-Reply-To: <1447342707-27556-1-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Thu, 12 Nov 2015 15:38:27 +0000") References: <1447342707-27556-1-git-send-email-dgilbert@redhat.com> Date: Thu, 12 Nov 2015 18:19:37 +0100 Message-ID: <87d1vfqgnq.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/1] migration_init: Fix lock initialisation/make it explicit Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: amit.shah@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Peter reported a lock error on MacOS after my a82d593b > patch. > > migrate_get_current does one-time initialisation of > a bunch of variables. > migrate_init does reinitialisation even on a 2nd > migrate after a cancel. > > The problem here was that I'd initialised the mutex > in migrate_get_current, and the memset in migrate_init > corrupted it. > > Remove the memset and replace it by explicit initialisation > of fields that need initialising; this also turns out to be simpler > than the old code that had to preserve some fields. > > Reported-by: Peter Maydell > Signed-off-by: Dr. David Alan Gilbert > Fixes: a82d593b Reviewed-by: Juan Quintela Applied