Received: from eggs.gnu.org ([2001:4830:134:3::10]:58142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWgFs-0000qw-NV for qemu-devel@nongnu.org; Wed, 03 Jan 2018 05:26:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWgFp-0007du-In for qemu-devel@nongnu.org; Wed, 03 Jan 2018 05:26:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWgFp-0007d1-CY for qemu-devel@nongnu.org; Wed, 03 Jan 2018 05:26:37 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A23076A06 for ; Wed, 3 Jan 2018 10:26:36 +0000 (UTC) Date: Wed, 3 Jan 2018 18:26:32 +0800 From: Peter Xu Message-ID: <20180103102632.GJ2557@xz-mi> References: <20180103054043.25719-1-peterx@redhat.com> <20180103054043.25719-3-peterx@redhat.com> <87efn72the.fsf@secure.laptop> <20180103093619.GH2557@xz-mi> <87shbn1bv8.fsf@secure.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87shbn1bv8.fsf@secure.laptop> Subject: Re: [Qemu-devel] [PATCH 02/11] migration: qemu_savevm_state_cleanup() in cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org, Laurent Vivier , "Dr . David Alan Gilbert" On Wed, Jan 03, 2018 at 11:21:31AM +0100, Juan Quintela wrote: > Peter Xu wrote: > > On Wed, Jan 03, 2018 at 10:15:41AM +0100, Juan Quintela wrote: > >> Peter Xu wrote: > >> > Moving existing callers all into migrate_fd_cleanup(). It simplifies > >> > migration_thread() a bit. > >> > > >> > Signed-off-by: Peter Xu > >> > >> Reviewed-by: Juan Quintela > > > > Thanks. > > > >> > >> I am trying to see if we can call migrate_fd_cleanup() twice. As far as > >> I can see, we are not doing it. But, and it is a big but, we are not > >> checking that we are not calling qemu_savevm_state_cleanup() twice. If > >> that happens, we can get double frees and similar. > >> > >> I put the reviewed-by anyways, because I *think* that we are doing it > >> right now, and otherwise, we should make sure that we are not calling it > >> twice, not papering over it. > >> > >> Once here, I have notice that we call block_cleanup_parameters() in > >> *three* places. We call notifier_list_notify() on two of this places (I > >> can't see any good reason *why* we don't call the notifier for > >> migrate_fd_cancel). > > > > Indeed. > > > > IMHO we can remove two calls of block_cleanup_parameters(), only keep > > the one in migrate_fd_cleanup(), and remove on notifier_list_notify() > > in migrate_fd_error() (these can be two more patches). What do you > > think? > > I think we need to make sure that we have a function that we always > call at the end. I think that we have that on migration_fd_cleanup(), > so put everything there should be ok, no? IMHO that's exactly what I mean, no? :) For notifier_list_notify(), it's different - I just remove the extra one in migrate_fd_error() because it'll be called in migrate_fd_cleanup() as well, which is a duplicate. -- Peter Xu