From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLO-00022d-7c for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWMLJ-0008LL-Fo for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:10 -0400 Received: from [59.151.112.132] (port=47516 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLJ-00083l-4O for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:05 -0400 From: Yang Hongyang Date: Tue, 23 Sep 2014 17:23:49 +0800 Message-ID: <1411464235-5653-18-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> References: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH v2 17/23] HACK: trigger checkpoint every 500ms List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: GuiJianfeng@cn.fujitsu.com, yunhong.jiang@intel.com, eddie.dong@intel.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, yanghy@cn.fujitsu.com Because COLO Agent is under development. We add this hack for test purpose. Trigger checkpoint every 500ms so that we can test the process of COLO save/restore. NOTE: This is only a hack, and will be removed at last. Signed-off-by: Yang Hongyang --- migration-colo.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/migration-colo.c b/migration-colo.c index 71a500e..1da5629 100644 --- a/migration-colo.c +++ b/migration-colo.c @@ -23,7 +23,7 @@ * this is large because COLO checkpoint will mostly depend on * COLO compare module. */ -#define CHKPOINT_TIMER 10000 +#define CHKPOINT_TIMER 500 enum { COLO_READY = 0x46, @@ -79,11 +79,6 @@ static int comp_fd = -1; static int colo_compare_init(void) { - comp_fd = open(COMPARE_DEV, O_RDONLY); - if (comp_fd < 0) { - return -1; - } - return 0; } @@ -104,17 +99,18 @@ static void colo_compare_destroy(void) */ static int colo_compare(void) { - return ioctl(comp_fd, COMP_IOCTWAIT, 250); + errno = ERESTART; + return 1; } static int colo_compare_flush(void) { - return ioctl(comp_fd, COMP_IOCTFLUSH, 1); + return 0; } static int colo_compare_resume(void) { - return ioctl(comp_fd, COMP_IOCTRESUME, 1); + return 0; } /* colo checkpoint control helper */ -- 1.9.1