From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: xiecl.fnst@cn.fujitsu.com, lizhijian@cn.fujitsu.com,
quintela@redhat.com, armbru@redhat.com, yunhong.jiang@intel.com,
eddie.dong@intel.com, peter.huangpeng@huawei.com,
qemu-devel@nongnu.org, arei.gonglei@huawei.com,
stefanha@redhat.com, amit.shah@redhat.com,
zhangchen.fnst@cn.fujitsu.com, hongyang.yang@easystack.cn
Subject: Re: [Qemu-devel] [PATCH COLO-Frame v15 27/38] migration/savevm: Add new helpers to process the different stages of loadvm
Date: Fri, 26 Feb 2016 12:52:02 +0000 [thread overview]
Message-ID: <20160226125202.GD2161@work-vm> (raw)
In-Reply-To: <1456108832-24212-28-git-send-email-zhang.zhanghailiang@huawei.com>
* zhanghailiang (zhang.zhanghailiang@huawei.com) wrote:
> There are several stages during loadvm process. In different stage,
> migration incoming processes different section.
> We want to control these stages more accuracy, to optimize the COLO
> capability.
>
> Here we add two new helper functions: qemu_loadvm_state_begin()
> and qemu_load_device_state().
> Besides, we make qemu_loadvm_state_main() API public.
>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
It's interesting; there's not that much difference between the two
routines, and they only wrap a little around the loadvm_state_main,
but I can see it makes it clearer at the place they're called.
Dave
> ---
> v14:
> - Split from patch 'COLO: Separate the process of saving/loading
> ram and device state
> ---
> include/sysemu/sysemu.h | 3 +++
> migration/savevm.c | 38 +++++++++++++++++++++++++++++++++++---
> 2 files changed, 38 insertions(+), 3 deletions(-)
>
> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 91eeda3..c0694a1 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -134,6 +134,9 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
> uint64_t *length_list);
>
> int qemu_loadvm_state(QEMUFile *f);
> +int qemu_loadvm_state_begin(QEMUFile *f);
> +int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
> +int qemu_load_device_state(QEMUFile *f);
>
> typedef enum DisplayType
> {
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 9e3c18a..954e0a7 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1249,8 +1249,6 @@ enum LoadVMExitCodes {
> LOADVM_QUIT = 1,
> };
>
> -static int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
> -
> /* ------ incoming postcopy messages ------ */
> /* 'advise' arrives before any transfers just to tell us that a postcopy
> * *might* happen - it might be skipped if precopy transferred everything
> @@ -1832,7 +1830,7 @@ qemu_loadvm_section_part_end(QEMUFile *f, MigrationIncomingState *mis)
> return 0;
> }
>
> -static int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis)
> +int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis)
> {
> uint8_t section_type;
> int ret;
> @@ -1965,6 +1963,40 @@ int qemu_loadvm_state(QEMUFile *f)
> return ret;
> }
>
> +int qemu_loadvm_state_begin(QEMUFile *f)
> +{
> + MigrationIncomingState *mis = migration_incoming_get_current();
> + Error *local_err = NULL;
> + int ret;
> +
> + if (qemu_savevm_state_blocked(&local_err)) {
> + error_report_err(local_err);
> + return -EINVAL;
> + }
> + /* Load QEMU_VM_SECTION_START section */
> + ret = qemu_loadvm_state_main(f, mis);
> + if (ret < 0) {
> + error_report("Failed to loadvm begin work: %d", ret);
> + }
> + return ret;
> +}
> +
> +int qemu_load_device_state(QEMUFile *f)
> +{
> + MigrationIncomingState *mis = migration_incoming_get_current();
> + int ret;
> +
> + /* Load QEMU_VM_SECTION_FULL section */
> + ret = qemu_loadvm_state_main(f, mis);
> + if (ret < 0) {
> + error_report("Failed to load device state: %d", ret);
> + return ret;
> + }
> +
> + cpu_synchronize_all_post_init();
> + return 0;
> +}
> +
> void hmp_savevm(Monitor *mon, const QDict *qdict)
> {
> BlockDriverState *bs, *bs1;
> --
> 1.8.3.1
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-02-26 12:52 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 2:39 [Qemu-devel] [PATCH COLO-Frame v15 00/38] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT) zhanghailiang
2016-02-22 2:39 ` [Qemu-devel] [PATCH COLO-Frame v15 01/38] configure: Add parameter for configure to enable/disable COLO support zhanghailiang
2016-02-22 2:39 ` [Qemu-devel] [PATCH COLO-Frame v15 02/38] migration: Introduce capability 'x-colo' to migration zhanghailiang
2016-02-22 2:39 ` [Qemu-devel] [PATCH COLO-Frame v15 03/38] COLO: migrate colo related info to secondary node zhanghailiang
2016-02-22 2:39 ` [Qemu-devel] [PATCH COLO-Frame v15 04/38] migration: Integrate COLO checkpoint process into migration zhanghailiang
2016-02-22 2:39 ` [Qemu-devel] [PATCH COLO-Frame v15 05/38] migration: Integrate COLO checkpoint process into loadvm zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 06/38] COLO/migration: Create a new communication path from destination to source zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 07/38] COLO: Implement colo checkpoint protocol zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 08/38] COLO: Add a new RunState RUN_STATE_COLO zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 09/38] QEMUSizedBuffer: Introduce two help functions for qsb zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 10/38] COLO: Save PVM state to secondary side when do checkpoint zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 11/38] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 12/38] ram/COLO: Record the dirty pages that SVM received zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 13/38] COLO: Load VMState into qsb before restore it zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 14/38] COLO: Flush PVM's cached RAM into SVM's memory zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 15/38] COLO: Add checkpoint-delay parameter for migrate-set-parameters zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 16/38] COLO: synchronize PVM's state to SVM periodically zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 17/38] COLO failover: Introduce a new command to trigger a failover zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 18/38] COLO failover: Introduce state to record failover process zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 19/38] COLO: Implement failover work for Primary VM zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 20/38] COLO: Implement failover work for Secondary VM zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 21/38] qmp event: Add COLO_EXIT event to notify users while exited from COLO zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 22/38] COLO failover: Shutdown related socket fd when do failover zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 23/38] COLO failover: Don't do failover during loading VM's state zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 24/38] COLO: Process shutdown command for VM in COLO state zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 25/38] COLO: Update the global runstate after going into colo state zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 26/38] savevm: Introduce two helper functions for save/find loadvm_handlers entry zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 27/38] migration/savevm: Add new helpers to process the different stages of loadvm zhanghailiang
2016-02-26 12:52 ` Dr. David Alan Gilbert [this message]
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 28/38] migration/savevm: Export two helper functions for savevm process zhanghailiang
2016-02-26 13:00 ` Dr. David Alan Gilbert
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 29/38] COLO: Separate the process of saving/loading ram and device state zhanghailiang
2016-02-26 13:16 ` Dr. David Alan Gilbert
2016-02-27 10:03 ` Hailiang Zhang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 30/38] COLO: Split qemu_savevm_state_begin out of checkpoint process zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 31/38] net/filter: Add a 'status' property for filter object zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 32/38] filter-buffer: Accept zero interval zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 33/38] net: Add notifier/callback for netdev init zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 34/38] COLO/filter: add each netdev a buffer filter zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 35/38] COLO: manage the status of buffer filters for PVM zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 36/38] filter-buffer: make filter_buffer_flush() public zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 37/38] COLO: flush buffered packets in checkpoint process or exit COLO zhanghailiang
2016-02-22 2:40 ` [Qemu-devel] [PATCH COLO-Frame v15 38/38] COLO: Add block replication into colo process zhanghailiang
2016-02-25 19:52 ` [Qemu-devel] [PATCH COLO-Frame v15 00/38] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT) Dr. David Alan Gilbert
2016-02-26 16:36 ` Dr. David Alan Gilbert
2016-02-27 7:54 ` Hailiang Zhang
2016-02-29 9:47 ` Dr. David Alan Gilbert
2016-02-29 12:16 ` Hailiang Zhang
2016-02-29 13:04 ` Dr. David Alan Gilbert
2016-03-01 12:25 ` Dr. David Alan Gilbert
2016-03-02 13:01 ` Hailiang Zhang
2016-03-03 20:13 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160226125202.GD2161@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=eddie.dong@intel.com \
--cc=hongyang.yang@easystack.cn \
--cc=lizhijian@cn.fujitsu.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=xiecl.fnst@cn.fujitsu.com \
--cc=yunhong.jiang@intel.com \
--cc=zhang.zhanghailiang@huawei.com \
--cc=zhangchen.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).