From patchwork Mon Mar 27 09:06:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Otto X-Patchwork-Id: 9645685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6117C602C8 for ; Mon, 27 Mar 2017 09:09:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B3C27A98 for ; Mon, 27 Mar 2017 09:09:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D9CB28338; Mon, 27 Mar 2017 09:09:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A25D27A98 for ; Mon, 27 Mar 2017 09:09:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csQcj-0004gm-Bh; Mon, 27 Mar 2017 09:07:37 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csQci-0004fM-2V for xen-devel@lists.xenproject.org; Mon, 27 Mar 2017 09:07:36 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id C4/10-15112-756D8D85; Mon, 27 Mar 2017 09:07:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsXSmNjwSTfs2o0 IgwPTOS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oz1O36wF/wxqrh2fyNbA2OjZhcjF4eQwBIm iWdti1i7GDk5WAR8JP5u6WeCsP8zSbzcywFiswmoS2xftJEdxBYRUJK4t2oyE0gzs8BBRokz5 w8zgySEBdwljp5rYYRoVpV41bcBbBCvgLNEy56NYHEJATmJm+c6weo5BVwkjl08xAZiCwHVXD vcC1VTLNF5dQcLhB0isbX7GCuErSNxb8c6Zgg7XmL//tlA8zmAbBOJB1M8IcKiEt2HnzGC3CY hMJ9R4s6CWWwTGIUXMDKsYtQoTi0qSy3SNTTSSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCrW S87P3cQIDFAGINjBeHljwCFGSQ4mJVHeD6dvRAjxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4A24C pQTLEpNT61Iy8wBxgpMWoKDR0mEdwVImre4IDG3ODMdInWKUVFKnHcqSEIAJJFRmgfXBovPS4 yyUsK8jECHCPEUpBblZpagyr9iFOdgVBLm3Q0yhSczrwRu+iugxUxAiw/PB1tckoiQkmpgzHt m3b1PeW3ku6YfbOf0tub9nVLgbbhydsdSl77f5wzn+8w5/HkKX0iRZuSTPQ4FZ313XXgXsv37 y2NVOy5dM59w7vWmqDvTWP/enGK/9n+95F+JlfuYLJdNfXy6xeScwKumZ/9NJt5+oi+qm7RNY 7X6jEibrw+W6D8UEVLVn+jFmePelnNtircSS3FGoqEWc1FxIgBCyDjbygIAAA== X-Env-Sender: jtotto@uwaterloo.ca X-Msg-Ref: server-12.tower-27.messagelabs.com!1490605653!92384668!1 X-Originating-IP: [129.97.128.242] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46787 invoked from network); 27 Mar 2017 09:07:33 -0000 Received: from mailchk-m06.uwaterloo.ca (HELO mailchk-m06.uwaterloo.ca) (129.97.128.242) by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 27 Mar 2017 09:07:33 -0000 Received: from eagle.uwaterloo.ca (cs-auth-dc-129-97-60-142.dynamic.uwaterloo.ca [129.97.60.142]) (authenticated bits=0) by mailchk-m06.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id v2R97DTH023326 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Mon, 27 Mar 2017 05:07:23 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 mailchk-m06.uwaterloo.ca v2R97DTH023326 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uwaterloo.ca; s=default; t=1490605646; bh=oBJPEy0MaJo1iEMJjHODpvjlz2nDVk/VlGj8dPwayqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KL/2gMUc/qAUO5LJClKick7WrmLHGdM/Nncofwf5EMDbKMav2/oT6ooTszyGEayxl Nd/lCKB/9Khw2wLnV60i335AOeQN/RXlb6aq02+A9AA0lq9eaGKESBOwxsHhxodMZc EAU/c0Fa+urbq7j1STzU1OkFBDCZN0IT19LPErk8= From: Joshua Otto To: xen-devel@lists.xenproject.org Date: Mon, 27 Mar 2017 05:06:13 -0400 Message-Id: <1490605592-12189-2-git-send-email-jtotto@uwaterloo.ca> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490605592-12189-1-git-send-email-jtotto@uwaterloo.ca> References: <1490605592-12189-1-git-send-email-jtotto@uwaterloo.ca> X-UUID: 75cbf7b3-cf32-49f7-b0e3-b7c0b9921fc3 X-Miltered: at mailchk-m06 with ID 58D8D641.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: clamav-milter 0.99.2 at mailchk-m06 X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mailchk-m06.uwaterloo.ca [129.97.128.141]); Mon, 27 Mar 2017 05:07:26 -0400 (EDT) Cc: wei.liu2@citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, czylin@uwaterloo.ca, Joshua Otto , imhy.yang@gmail.com, hjarmstr@uwaterloo.ca Subject: [Xen-devel] [PATCH RFC 01/20] tools: rename COLO 'postcopy' to 'aftercopy' X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The COLO xc domain save and restore procedures both make use of a 'postcopy' callback to defer part of each checkpoint operation to xl. In this context, the name 'postcopy' is meant as "the callback invoked immediately after this checkpoint's memory callback." This is an unfortunate name collision with the other common use of 'postcopy' in the context of live migration, where it is used to mean "a memory migration that permits the guest to execute at the destination before all of its memory is migrated by servicing accesses to unmigrated memory via a network page-fault." Mechanically rename 'postcopy' -> 'aftercopy' to free up the postcopy namespace while preserving the original intent of the name in the COLO context. No functional change. Signed-off-by: Joshua Otto Acked-by: Zhang Chen --- tools/libxc/include/xenguest.h | 4 ++-- tools/libxc/xc_sr_restore.c | 4 ++-- tools/libxc/xc_sr_save.c | 4 ++-- tools/libxl/libxl_colo_restore.c | 2 +- tools/libxl/libxl_colo_save.c | 2 +- tools/libxl/libxl_remus.c | 2 +- tools/libxl/libxl_save_msgs_gen.pl | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index 40902ee..aa8cc8b 100644 --- a/tools/libxc/include/xenguest.h +++ b/tools/libxc/include/xenguest.h @@ -53,7 +53,7 @@ struct save_callbacks { * xc_domain_save then flushes the output buffer, while the * guest continues to run. */ - int (*postcopy)(void* data); + int (*aftercopy)(void* data); /* Called after the memory checkpoint has been flushed * out into the network. Typical actions performed in this @@ -115,7 +115,7 @@ struct restore_callbacks { * Callback function resumes the guest & the device model, * returns to xc_domain_restore. */ - int (*postcopy)(void* data); + int (*aftercopy)(void* data); /* A checkpoint record has been found in the stream. * returns: */ diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index 3549f0a..ee06b3d 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xc_sr_restore.c @@ -576,7 +576,7 @@ static int handle_checkpoint(struct xc_sr_context *ctx) ctx->restore.callbacks->data); /* Resume secondary vm */ - ret = ctx->restore.callbacks->postcopy(ctx->restore.callbacks->data); + ret = ctx->restore.callbacks->aftercopy(ctx->restore.callbacks->data); HANDLE_CALLBACK_RETURN_VALUE(ret); /* Wait for a new checkpoint */ @@ -855,7 +855,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, { /* this is COLO restore */ assert(callbacks->suspend && - callbacks->postcopy && + callbacks->aftercopy && callbacks->wait_checkpoint && callbacks->restore_results); } diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c index f98c827..fc63a55 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xc_sr_save.c @@ -863,7 +863,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type) } } - rc = ctx->save.callbacks->postcopy(ctx->save.callbacks->data); + rc = ctx->save.callbacks->aftercopy(ctx->save.callbacks->data); if ( rc <= 0 ) goto err; @@ -951,7 +951,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, if ( hvm ) assert(callbacks->switch_qemu_logdirty); if ( ctx.save.checkpointed ) - assert(callbacks->checkpoint && callbacks->postcopy); + assert(callbacks->checkpoint && callbacks->aftercopy); if ( ctx.save.checkpointed == XC_MIG_STREAM_COLO ) assert(callbacks->wait_checkpoint); diff --git a/tools/libxl/libxl_colo_restore.c b/tools/libxl/libxl_colo_restore.c index 0c535bd..7d8f9ff 100644 --- a/tools/libxl/libxl_colo_restore.c +++ b/tools/libxl/libxl_colo_restore.c @@ -246,7 +246,7 @@ void libxl__colo_restore_setup(libxl__egc *egc, if (init_dsps(&crcs->dsps)) goto out; - callbacks->postcopy = libxl__colo_restore_domain_resume_callback; + callbacks->aftercopy = libxl__colo_restore_domain_resume_callback; callbacks->wait_checkpoint = libxl__colo_restore_domain_wait_checkpoint_callback; callbacks->suspend = libxl__colo_restore_domain_suspend_callback; callbacks->checkpoint = libxl__colo_restore_domain_checkpoint_callback; diff --git a/tools/libxl/libxl_colo_save.c b/tools/libxl/libxl_colo_save.c index f687d5a..5921196 100644 --- a/tools/libxl/libxl_colo_save.c +++ b/tools/libxl/libxl_colo_save.c @@ -145,7 +145,7 @@ void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css) callbacks->suspend = libxl__colo_save_domain_suspend_callback; callbacks->checkpoint = libxl__colo_save_domain_checkpoint_callback; - callbacks->postcopy = libxl__colo_save_domain_resume_callback; + callbacks->aftercopy = libxl__colo_save_domain_resume_callback; callbacks->wait_checkpoint = libxl__colo_save_domain_wait_checkpoint_callback; libxl__checkpoint_devices_setup(egc, &dss->cds); diff --git a/tools/libxl/libxl_remus.c b/tools/libxl/libxl_remus.c index 29a4783..1453365 100644 --- a/tools/libxl/libxl_remus.c +++ b/tools/libxl/libxl_remus.c @@ -110,7 +110,7 @@ void libxl__remus_setup(libxl__egc *egc, libxl__remus_state *rs) dss->sws.checkpoint_callback = remus_checkpoint_stream_written; callbacks->suspend = libxl__remus_domain_suspend_callback; - callbacks->postcopy = libxl__remus_domain_resume_callback; + callbacks->aftercopy = libxl__remus_domain_resume_callback; callbacks->checkpoint = libxl__remus_domain_save_checkpoint_callback; libxl__checkpoint_devices_setup(egc, cds); diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libxl/libxl_save_msgs_gen.pl index 3ae7373..27845bb 100755 --- a/tools/libxl/libxl_save_msgs_gen.pl +++ b/tools/libxl/libxl_save_msgs_gen.pl @@ -24,7 +24,7 @@ our @msgs = ( 'unsigned long', 'done', 'unsigned long', 'total'] ], [ 3, 'srcxA', "suspend", [] ], - [ 4, 'srcxA', "postcopy", [] ], + [ 4, 'srcxA', "aftercopy", [] ], [ 5, 'srcxA', "checkpoint", [] ], [ 6, 'srcxA', "wait_checkpoint", [] ], [ 7, 'scxA', "switch_qemu_logdirty", [qw(int domid