From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDERJ-0003pA-GV for qemu-devel@nongnu.org; Fri, 01 Aug 2014 11:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDERC-0003sn-Rs for qemu-devel@nongnu.org; Fri, 01 Aug 2014 11:08:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDERC-0003sf-JD for qemu-devel@nongnu.org; Fri, 01 Aug 2014 11:08:06 -0400 Date: Fri, 1 Aug 2014 16:07:56 +0100 From: "Dr. David Alan Gilbert" 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 Content-Disposition: inline In-Reply-To: <1406125538-27992-14-git-send-email-yanghy@cn.fujitsu.com> Subject: Re: [Qemu-devel] [RFC PATCH 13/17] COLO ctl: implement colo save List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang Cc: kvm@vger.kernel.org, GuiJianfeng@cn.fujitsu.com, eddie.dong@intel.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com * 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