From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dr. David Alan Gilbert" Subject: Re: [RFC PATCH 13/17] COLO ctl: implement colo save Date: Fri, 1 Aug 2014 16:07:56 +0100 Message-ID: <20140801150755.GF2430@work-vm> References: <1406125538-27992-1-git-send-email-yanghy@cn.fujitsu.com> <1406125538-27992-14-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, eddie.dong@intel.com, GuiJianfeng@cn.fujitsu.com, mrhines@linux.vnet.ibm.com, wency@cn.fujitsu.com To: Yang Hongyang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38217 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbaHAPIH (ORCPT ); Fri, 1 Aug 2014 11:08:07 -0400 Content-Disposition: inline In-Reply-To: <1406125538-27992-14-git-send-email-yanghy@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: * Yang Hongyang (yanghy@cn.fujitsu.com) wrote: > implement colo save My postcopy 'QEMU_VM_CMD_PACKAGED' does something similar to parts of this with the QEMUSizedBuffer, we might be able to share some more: https://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg00886.html > + /* we send the total size of the vmstate first */ > + ret = colo_ctl_put(s->file, colo_buffer.used); > + if (ret) { > + goto out; > + } > + > + qemu_put_buffer_async(s->file, colo_buffer.data, colo_buffer.used); > + ret = qemu_file_get_error(s->file); > + if (ret < 0) { > + goto out; > + } > + qemu_fflush(s->file); Is there a reason to use _async here? I thought the only gain is if you were going to do other writes in the shadow of the async, with the fflush immediately after I'm not sure it helps. Dave > > ret = colo_ctl_get(control, COLO_CHECKPOINT_RECEIVED); > if (ret) { > goto out; > } > > - /* TODO: Flush network etc. */ > + /* Flush network etc. */ > + colo_compare_flush(); > > ret = colo_ctl_get(control, COLO_CHECKPOINT_LOADED); > if (ret) { > goto out; > } > > - /* TODO: resume master */ > + colo_compare_resume(); > + ret = 0; > > out: > + /* resume master */ > + qemu_mutex_lock_iothread(); > + vm_start(); > + qemu_mutex_unlock_iothread(); > + > return ret; > } > > -- > 1.9.1 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK