From patchwork Fri Mar 11 05:39:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Congyang X-Patchwork-Id: 8562201 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 374409F46A for ; Fri, 11 Mar 2016 05:41:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30CBC2035D for ; Fri, 11 Mar 2016 05:41:00 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 3B5312034F for ; Fri, 11 Mar 2016 05:40:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aeFm8-0002z4-Ic; Fri, 11 Mar 2016 05:38:12 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aeFm6-0002ys-RH for xen-devel@lists.xen.org; Fri, 11 Mar 2016 05:38:10 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 4A/A4-04050-1C952E65; Fri, 11 Mar 2016 05:38:09 +0000 X-Env-Sender: wency@cn.fujitsu.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1457674687!2125192!1 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10440 invoked from network); 11 Mar 2016 05:38:08 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-6.tower-31.messagelabs.com with SMTP; 11 Mar 2016 05:38:08 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="4465739" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Mar 2016 13:38:01 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 4DAB742B4B13; Fri, 11 Mar 2016 13:37:55 +0800 (CST) Received: from G08FNSTD140052.g08.fujitsu.local (10.167.226.52) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 11 Mar 2016 13:37:54 +0800 From: Wen Congyang To: xen devel , Andrew Cooper , Wei Liu Date: Fri, 11 Mar 2016 13:39:02 +0800 Message-ID: <1457674744-12495-1-git-send-email-wency@cn.fujitsu.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.52] X-yoursite-MailScanner-ID: 4DAB742B4B13.AA913 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: wency@cn.fujitsu.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Cc: Ian Jackson , Ian Campbell , Wen Congyang Subject: [Xen-devel] [PATCH v3 1/3] libxc: move migration_stream's definition to xenguest.h 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP xc_domain_save() and xc_domain_restore's parameter will use this type, so it should be public. Signed-off-by: Wen Congyang Acked-by: Wei Liu --- v2->v3: Rename MIG_STREAM_* to XC_MIG_STREAM_* tools/libxc/include/xenguest.h | 7 ++++++- tools/libxc/xc_sr_common.h | 10 ---------- tools/libxc/xc_sr_save.c | 12 ++++++------ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index affc42b..cf521c3 100644 --- a/tools/libxc/include/xenguest.h +++ b/tools/libxc/include/xenguest.h @@ -75,13 +75,18 @@ struct save_callbacks { void* data; }; +typedef enum { + XC_MIG_STREAM_NONE, /* plain stream */ + XC_MIG_STREAM_REMUS, +} xc_migration_stream_t; + /** * This function will save a running domain. * * @parm xch a handle to an open hypervisor interface * @parm fd the file descriptor to save a domain to * @parm dom the id of the domain - * @param checkpointed_stream MIG_STREAM_NONE if the far end of the stream + * @param checkpointed_stream XC_MIG_STREAM_NONE if the far end of the stream * doesn't use checkpointing * @return 0 on success, -1 on failure */ diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h index 66f595f..e7568b5 100644 --- a/tools/libxc/xc_sr_common.h +++ b/tools/libxc/xc_sr_common.h @@ -180,16 +180,6 @@ struct xc_sr_context xc_dominfo_t dominfo; - /* - * migration stream - * 0: Plain VM - * 1: Remus - */ - enum { - MIG_STREAM_NONE, /* plain stream */ - MIG_STREAM_REMUS, - } migration_stream; - union /* Common save or restore data. */ { struct /* Save data. */ diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c index e258b7c..ab59673 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xc_sr_save.c @@ -629,7 +629,7 @@ static int send_domain_memory_live(struct xc_sr_context *ctx) if ( rc ) goto out; - if ( ctx->save.debug && ctx->save.checkpointed != MIG_STREAM_NONE ) + if ( ctx->save.debug && ctx->save.checkpointed != XC_MIG_STREAM_NONE ) { rc = verify_frames(ctx); if ( rc ) @@ -758,7 +758,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type) if ( ctx->save.live ) rc = send_domain_memory_live(ctx); - else if ( ctx->save.checkpointed != MIG_STREAM_NONE ) + else if ( ctx->save.checkpointed != XC_MIG_STREAM_NONE ) rc = send_domain_memory_checkpointed(ctx); else rc = send_domain_memory_nonlive(ctx); @@ -778,7 +778,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type) if ( rc ) goto err; - if ( ctx->save.checkpointed != MIG_STREAM_NONE ) + if ( ctx->save.checkpointed != XC_MIG_STREAM_NONE ) { /* * We have now completed the initial live portion of the checkpoint @@ -799,7 +799,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type) if ( rc <= 0 ) goto err; } - } while ( ctx->save.checkpointed != MIG_STREAM_NONE ); + } while ( ctx->save.checkpointed != XC_MIG_STREAM_NONE ); xc_report_progress_single(xch, "End of stream"); @@ -845,8 +845,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, ctx.save.checkpointed = checkpointed_stream; /* If altering migration_stream update this assert too. */ - assert(checkpointed_stream == MIG_STREAM_NONE || - checkpointed_stream == MIG_STREAM_REMUS); + assert(checkpointed_stream == XC_MIG_STREAM_NONE || + checkpointed_stream == XC_MIG_STREAM_REMUS); /* * TODO: Find some time to better tweak the live migration algorithm.