From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1qQq-0005uy-1x for qemu-devel@nongnu.org; Thu, 26 Nov 2015 01:53:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1qQl-0006ZJ-6L for qemu-devel@nongnu.org; Thu, 26 Nov 2015 01:53:27 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:52202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1qQk-0006Wd-5J for qemu-devel@nongnu.org; Thu, 26 Nov 2015 01:53:23 -0500 References: <1448357149-17572-1-git-send-email-zhang.zhanghailiang@huawei.com> <1448357149-17572-11-git-send-email-zhang.zhanghailiang@huawei.com> <20151124190048.GK2490@work-vm> <5655BF57.2070003@redhat.com> From: Hailiang Zhang Message-ID: <5656AC4B.8080501@huawei.com> Date: Thu, 26 Nov 2015 14:52:59 +0800 MIME-Version: 1.0 In-Reply-To: <5655BF57.2070003@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v11 10/39] COLO: Implement colo checkpoint protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Dr. David Alan Gilbert" Cc: 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, amit.shah@redhat.com, hongyang.yang@easystack.cn On 2015/11/25 22:01, Eric Blake wrote: > On 11/24/2015 12:00 PM, Dr. David Alan Gilbert wrote: >> * zhanghailiang (zhang.zhanghailiang@huawei.com) wrote: >>> We need communications protocol of user-defined to control the checkpoint >>> process. >>> > >>> +static int colo_ctl_get(QEMUFile *f, uint32_t require, uint64_t *value) >>> +{ >>> + int ret; >>> + uint32_t cmd; >>> + >>> + ret = colo_ctl_get_cmd(f, &cmd); >>> + if (ret < 0) { >>> + return ret; >>> + } >>> + if (cmd != require) { >>> + error_report("Unexpect colo command, expect:%d, but got cmd:%d", >>> + require, cmd); >> >> I think you need to use PRIu32 rather than %d since they are uint32_t >> (I doubt it will break on anything, but it's correct). > > 32-bit cygwin uses 'long' for uint32_t, so there ARE platforms where it > is absolutely necessary to use PRIu32 for printing (even if qemu isn't > ported to cygwin). > Got it, i will fix it. > >>> +++ b/qapi-schema.json >>> @@ -722,6 +722,33 @@ >>> { 'command': 'migrate-start-postcopy' } >>> >>> ## >>> +# @COLOCommand >>> +# >>> +# The commands for COLO fault tolerance >>> +# >>> +# @invalid: unknown command >>> +# >>> +# @checkpoint-ready: SVM is ready for checkpointing >>> +# >>> +# @checkpoint-request: PVM tells SVM to prepare for new checkpointing >>> +# >>> +# @checkpoint-reply: SVM gets PVM's checkpoint request >>> +# >>> +# @vmstate-send: VM's state will be sent by PVM. >>> +# >>> +# @vmstate-size: The total size of VMstate. >>> +# >>> +# @vmstate-received: VM's state has been received by SVM >>> +# >>> +# @vmstate-loaded: VM's state has been loaded by SVM > > Inconsistent use of trailing '.' > > Also, do we really need 'invalid'? > No, we can remove it. Thanks. >>> +# >>> +# Since: 2.6 >>> +## >>> +{ 'enum': 'COLOCommand', >>> + 'data': [ 'invalid', 'checkpoint-ready', 'checkpoint-request', >>> + 'checkpoint-reply', 'vmstate-send', 'vmstate-size', >>> + 'vmstate-received', 'vmstate-loaded' ] } >>> + > >