Received: from eggs.gnu.org ([209.51.188.92]:35005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJp8B-0004gs-Kr for qemu-devel@nongnu.org; Thu, 25 Apr 2019 20:54:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJp5v-0004mX-V4 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 20:52:04 -0400 Received: from mga17.intel.com ([192.55.52.151]:18636) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJp5v-0004jR-Ku for qemu-devel@nongnu.org; Thu, 25 Apr 2019 20:52:03 -0400 Date: Fri, 26 Apr 2019 08:51:33 +0800 From: Wei Yang Message-ID: <20190426005133.GB25513@richard> Reply-To: Wei Yang References: <20190424004700.12766-1-richardw.yang@linux.intel.com> <20190424004700.12766-3-richardw.yang@linux.intel.com> <0eb5e5a5-593e-f4a2-7e2d-a9fed481ab6c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0eb5e5a5-593e-f4a2-7e2d-a9fed481ab6c@gmail.com> Subject: Re: [Qemu-devel] [PATCH 2/4] migration/savevm: use migration_is_blocked to validate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Daniel Henrique Barboza Cc: Wei Yang , qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com On Thu, Apr 25, 2019 at 05:55:15PM -0300, Daniel Henrique Barboza wrote: > > >On 4/23/19 9:46 PM, Wei Yang wrote: >> migration_is_blocked() is used in migrate_prepare() and >> save_snapshot(), this is more proper to use this instead of >> qemu_savevm_state_blocked() in qemu_loadvm_state(). > > >migration_is_blocked() does an additional verification: > >"if (migration_blockers)" > >comparing to what was previously done in qemu_loadvm_state. > >I've checked what migration_blockers does and it is a GList used >for callers to block the migration process. This is used via >'migration_add_blocker', from migration.c. > >'migration_add_blocker' is called all over the place, most notably >in  _realize() functions  and _open() functions from block. > >Thus, I am not sure if this change will impact the use of >qemu_loadvm_state() from load_snapshot() (i.e. can load_snapshot >be called with migration_blockers?). It's better to someone >with a better understanding of this code to comment on that. > Well, when you look into the source side of migration: qmp_migrate migrate_prepare migration_is_blocked This means if migration_is_blocked fails, the source will not start migration. And it is the same as save_snapshot. >From my understanding, when we load a vm, it should check the same requirement. -- Wei Yang Help you, Help me