From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOMpk-00057a-Pp for qemu-devel@nongnu.org; Wed, 27 Jan 2016 04:56:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOMph-00025j-Hh for qemu-devel@nongnu.org; Wed, 27 Jan 2016 04:56:16 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:34673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOMpf-000240-3i for qemu-devel@nongnu.org; Wed, 27 Jan 2016 04:56:13 -0500 References: <1451372975-5048-1-git-send-email-zhang.zhanghailiang@huawei.com> <1451372975-5048-29-git-send-email-zhang.zhanghailiang@huawei.com> <20160126195503.GH2426@work-vm> From: Hailiang Zhang Message-ID: <56A893EF.9040802@huawei.com> Date: Wed, 27 Jan 2016 17:54:55 +0800 MIME-Version: 1.0 In-Reply-To: <20160126195503.GH2426@work-vm> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v13 28/39] COLO: Process shutdown command for VM in COLO state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: xiecl.fnst@cn.fujitsu.com, lizhijian@cn.fujitsu.com, quintela@redhat.com, yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, arei.gonglei@huawei.com, stefanha@redhat.com, Paolo Bonzini , amit.shah@redhat.com, zhangchen.fnst@cn.fujitsu.com, hongyang.yang@easystack.cn On 2016/1/27 3:55, Dr. David Alan Gilbert wrote: > * zhanghailiang (zhang.zhanghailiang@huawei.com) wrote: >> If VM is in COLO FT state, we should do some extra work before normal shutdown >> process. SVM will ignore the shutdown command if this command is issued directly >> to it, PVM will send the shutdown command to SVM if it gets this command. >> >> Cc: Paolo Bonzini >> Signed-off-by: zhanghailiang >> Signed-off-by: Li Zhijian >> --- >> v13: >> - Move COLO shutdown related codes to colo.c file (Dave's suggestion) > >> diff --git a/migration/colo.c b/migration/colo.c >> index de01ade..2bea519 100644 >> --- a/migration/colo.c >> +++ b/migration/colo.c >> @@ -248,6 +248,7 @@ static uint64_t colo_get_cmd_value(QEMUFile *f, uint32_t expect_cmd, >> static int colo_do_checkpoint_transaction(MigrationState *s, >> QEMUSizedBuffer *buffer) >> { >> + int colo_shutdown; >> QEMUFile *trans = NULL; >> size_t size; >> Error *local_err = NULL; >> @@ -277,6 +278,7 @@ static int colo_do_checkpoint_transaction(MigrationState *s, >> qemu_mutex_unlock_iothread(); >> goto out; >> } >> + colo_shutdown = colo_shutdown_requested; >> vm_stop_force_state(RUN_STATE_COLO); >> qemu_mutex_unlock_iothread(); >> trace_colo_vm_state_change("run", "stop"); >> @@ -330,6 +332,18 @@ static int colo_do_checkpoint_transaction(MigrationState *s, >> goto out; >> } >> >> + if (colo_shutdown) { > > Why do you take a copy of colo_shutdown_requested rather than just use > it directly? > Hmm, it is unnecessary, i will fix it in next version, thanks. > Dave > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > > . >