[Qemu-devel] [PATCH v3 0/2] filter-rewriter: fix one bug and one improvement

2017-02-27 Thread zhanghailiang
Hi, Patch 1 fixes a double free bug. Patch 2 is an optimization for filter-rewriter. Please review, thanks. zhanghailiang (2): net/colo: fix memory double free error filter-rewriter: skip net_checksum_calculate() while offset = 0 net/colo.c| 4 ++-- net/filter-rewriter.c

[Qemu-devel] [PATCH v3 2/2] filter-rewriter: skip net_checksum_calculate() while offset = 0

2017-02-27 Thread zhanghailiang
While the offset of packets's sequence for primary side and secondary side is zero, it is unnecessary to call net_checksum_calculate() to recalculate the checksume value of packets. Signed-off-by: zhanghailiang --- net/filter-rewriter.c | 17 +++-- 1 file changed, 11 inser

[Qemu-devel] [PATCH v2 2/3] filter-rewriter: fix memory leak for connection in connection_track_table

2017-02-21 Thread zhanghailiang
After a net connection is closed, we didn't clear its releated resources in connection_track_table, which will lead to memory leak. Let't track the state of net connection, if it is closed, its related resources will be cleared up. Signed-off-by: zhanghailiang --- net/colo.h

[Qemu-devel] [PATCH 00/15] COLO: integrate colo frame with block replication and net compare

2017-02-21 Thread zhanghailiang
: Jason Wang zhanghailiang (15): net/colo: Add notifier/callback related helpers for filter colo-compare: implement the process of checkpoint colo-compare: use notifier to notify packets comparing result COLO: integrate colo compare with colo frame COLO: Handle shutdown command for VM in

[Qemu-devel] [PATCH v2 0/3] filter-rewriter: fix two bugs and one optimization

2017-02-21 Thread zhanghailiang
Hi, Patch 1 fixes a double free bug, and patch 2 fixes a memory leak bug. Patch 3 is an optimization for filter-rewriter. Please review, thanks. zhanghailiang (3): net/colo: fix memory double free error filter-rewriter: fix memory leak for connection in connection_track_table filter

[Qemu-devel] [PATCH v2 3/3] filter-rewriter: skip net_checksum_calculate() while offset = 0

2017-02-21 Thread zhanghailiang
While the offset of packets's sequence for primary side and secondary side is zero, it is unnecessary to call net_checksum_calculate() to recalculate the checksume value of packets. Signed-off-by: zhanghailiang --- net/filter-rewriter.c | 18 +++--- 1 file changed, 11 inser

[Qemu-devel] [PATCH v2 1/3] net/colo: fix memory double free error

2017-02-21 Thread zhanghailiang
The 'primary_list' and 'secondary_list' members of struct Connection is not allocated through dynamically g_queue_new(), but we free it by using g_queue_free(), which will lead to a double-free bug. Signed-off-by: zhanghailiang --- net/colo.c | 4 ++-- 1 file changed

[Qemu-devel] [PATCH 12/15] savevm: split the process of different stages for loadvm/savevm

2017-02-21 Thread zhanghailiang
_main() and qemu_save_device_state() public. Cc: Juan Quintela Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- include/sysemu/sysemu.h | 6 ++ migration/savevm.c | 55 ++--- 2 files change

[Qemu-devel] [PATCH 13/15] COLO: Separate the process of saving/loading ram and device state

2017-02-21 Thread zhanghailiang
was used during checkpoint. Besides, we move the colo_flush_ram_cache to the proper position after the above change. Cc: Juan Quintela Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 48

[Qemu-devel] [PATCH 10/15] qmp event: Add COLO_EXIT event to notify users while exited from COLO

2017-02-21 Thread zhanghailiang
is still necessary to notify users that we exited COLO mode. Cc: Markus Armbruster Cc: Michael Roth Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Eric Blake --- migration/colo.c | 19 +++ qapi-schema.json | 14 ++ qapi/event.json | 21 +++

[Qemu-devel] [PATCH 02/15] colo-compare: implement the process of checkpoint

2017-02-21 Thread zhanghailiang
While do checkpoint, we need to flush all the unhandled packets, By using the filter notifier mechanism, we can easily to notify every compare object to do this process, which runs inside of compare threads as a coroutine. Cc: Jason Wang Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen

[Qemu-devel] [PATCH 15/15] COLO: flush host dirty ram from cache

2017-02-21 Thread zhanghailiang
Don't need to flush all VM's ram from cache, only flush the dirty pages since last checkpoint Cc: Juan Quintela Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang --- migration/ram.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/migra

[Qemu-devel] [PATCH 14/15] COLO: Split qemu_savevm_state_begin out of checkpoint process

2017-02-21 Thread zhanghailiang
data transferring in the subsequent checkpoint. Cc: Juan Quintela Sgned-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 52 1 file changed, 36 insertions(+), 16 deletions(-) diff

[Qemu-devel] [PATCH 03/15] colo-compare: use notifier to notify packets comparing result

2017-02-21 Thread zhanghailiang
It's a good idea to use notifier to notify COLO frame of inconsistent packets comparing. Cc: Jason Wang Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang --- net/colo-compare.c | 32 net/colo-compare.h | 2 ++ 2 files changed, 30 insertions(

[Qemu-devel] [PATCH 11/15] savevm: split save/find loadvm_handlers entry into two helper functions

2017-02-21 Thread zhanghailiang
ad to memory leak. To fix it, we split the process of saving and finding section entry into two helper functions, we will check if section info was exist in loadvm_handlers list before save it. This modifications have no side effect for normal migration. Cc: Juan Quintela Signed-off-by: zhanghai

[Qemu-devel] [PATCH 05/15] COLO: Handle shutdown command for VM in COLO state

2017-02-21 Thread zhanghailiang
: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v19: - fix title and comment v15: - Go on the shutdown process even some error happened while sent 'SHUTDOWN' message to SVM. - Add Reviewed-by tag v14: - Remove 'colo_shutdown' variable, use c

[Qemu-devel] [PATCH 06/15] COLO: Add block replication into colo process

2017-02-21 Thread zhanghailiang
Make sure master start block replication after slave's block replication started. Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian Cc: Stefan Hajnoczi Cc: Kevin Wolf Cc: Max Reitz Cc: Changlong Xie --- migration/colo.c

[Qemu-devel] [PATCH 07/15] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily

2017-02-21 Thread zhanghailiang
state. Cc: Juan Quintela Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- include/exec/ram_addr.h | 1 + include/migration/migration.h | 4 +++ migration/colo.c | 14 + migration

[Qemu-devel] [PATCH 04/15] COLO: integrate colo compare with colo frame

2017-02-21 Thread zhanghailiang
For COLO FT, both the PVM and SVM run at the same time, only sync the state while it needs. So here, let SVM runs while not doing checkpoint, Besides, change DEFAULT_MIGRATE_X_CHECKPOINT_DELAY to 200*100. Cc: Jason Wang Signed-off-by: zhanghailiang --- migration/colo.c | 25

[Qemu-devel] [PATCH 08/15] ram/COLO: Record the dirty pages that SVM received

2017-02-21 Thread zhanghailiang
We record the address of the dirty pages that received, it will help flushing pages that cached into SVM. We record them by re-using migration dirty bitmap. Cc: Juan Quintela Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 30

[Qemu-devel] [PATCH 09/15] COLO: Flush PVM's cached RAM into SVM's memory

2017-02-21 Thread zhanghailiang
all content of PVM's RAM cache into SVM's MEMORY, we do this in a more efficient way: Only flush any page that dirtied by PVM since last checkpoint. In this way, we can ensure SVM's memory same with PVM's. Besides, we must ensure flush RAM cache before load device state. Cc

[Qemu-devel] [PATCH 01/15] net/colo: Add notifier/callback related helpers for filter

2017-02-21 Thread zhanghailiang
We will use this notifier to help COLO to notify filter object to do something, like do checkpoint, or process failover event. Cc: Jason Wang Signed-off-by: zhanghailiang --- net/colo.c | 92 ++ net/colo.h | 18 2 files

[Qemu-devel] [PATCH 2/3] filter-rewriter: fix memory leak for connection in connection_track_table

2017-02-20 Thread zhanghailiang
After a net connection is closed, we didn't clear its releated resources in connection_track_table, which will lead to memory leak. Let't track the state of net connection, if it is closed, its related resources will be cleared up. Signed-off-by: zhanghailiang --- net/colo.h

[Qemu-devel] [PATCH 1/3] net/colo: fix memory double free error

2017-02-20 Thread zhanghailiang
The 'primary_list' and 'secondary_list' members of struct Connection is not allocated through dynamically g_queue_new(), but we free it by using g_queue_free(), which will lead to a double-free bug. Signed-off-by: zhanghailiang --- net/colo.c | 2 -- 1 file changed, 2 deleti

[Qemu-devel] [PATCH 3/3] filter-rewriter: skip net_checksum_calculate() while offset = 0

2017-02-20 Thread zhanghailiang
While the offset of packets's sequence for primary side and secondary side is zero, it is unnecessary to call net_checksum_calculate() to recalculate the checksume value of packets. Signed-off-by: zhanghailiang --- net/filter-rewriter.c | 18 +++--- 1 file changed, 11 inser

[Qemu-devel] [PATCH 0/3] filter-rewriter: fix two bugs and one optimization

2017-02-20 Thread zhanghailiang
Hi, Patch 1 fixes a double free bug, and patch 2 fixes a memory leak bug. Patch 3 is an optimization for filter-rewriter. Please review, thanks. zhanghailiang (3): net/colo: fix memory double free error filter-rewriter: fix memory leak for connection in connection_track_table filter

[Qemu-devel] [PATCH v3 3/4] char: remove the right fd been watched in qemu_chr_fe_set_handlers()

2017-02-16 Thread zhanghailiang
h always try to find the Gsource from default context. Fix it by passing the right context to g_main_context_find_source_by_id(). Cc: Paolo Bonzini Cc: Marc-André Lureau Signed-off-by: zhanghailiang --- chardev/char-fd.c | 6 +++--- chardev/char-io.c | 8 chardev/ch

[Qemu-devel] [PATCH v3 1/4] colo-compare: use g_timeout_source_new() to process the stale packets

2017-02-16 Thread zhanghailiang
ff-by: zhanghailiang --- net/colo-compare.c | 62 +++--- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 162fd6a..fdde788 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -83,9

[Qemu-devel] [PATCH v3 0/4] colo-compare: fix some bugs

2017-02-16 Thread zhanghailiang
ndr?? Lureau's suggestion) v1->v2: - Squash patch 3 of last version into patch 2. (ZhangChen's suggestion) zhanghailiang (4): colo-compare: use g_timeout_source_new() to process the stale packets colo-compare: kick compare thread to exit after some cleanup in finalization

[Qemu-devel] [PATCH v3 4/4] colo-compare: Fix removing fds been watched incorrectly in finalization

2017-02-16 Thread zhanghailiang
by pass the worker_context parameter to qemu_chr_fe_set_handlers(). Signed-off-by: zhanghailiang --- net/colo-compare.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 37ce75c..a6fc2ff 100644 --- a/net/colo-c

[Qemu-devel] [PATCH v3 2/4] colo-compare: kick compare thread to exit after some cleanup in finalization

2017-02-16 Thread zhanghailiang
re compare thead exits, some cleanup works need to be done, All unhandled packets need to be released and connection_track_table needs to be freed, or there will be memory leak. Signed-off-by: zhanghailiang --- net/colo-compare.c | 39 +-- 1 file changed

[Qemu-devel] [PATCH v2 3/4] char: remove the right fd been watched in qemu_chr_fe_set_handlers()

2017-02-15 Thread zhanghailiang
h always try to find the Gsource from default context. Fix it by passing the right context to g_main_context_find_source_by_id(). Cc: Paolo Bonzini Cc: Marc-André Lureau Signed-off-by: zhanghailiang --- chardev/char-io.c | 13 + chardev/char-io.h | 2 ++ chardev/char.c|

[Qemu-devel] [PATCH v2 2/4] colo-compare: kick compare thread to exit after some cleanup in finalization

2017-02-15 Thread zhanghailiang
re compare thead exits, some cleanup works need to be done, All unhandled packets need to be released and connection_track_table needs to be freed, or there will be memory leak. Signed-off-by: zhanghailiang --- net/colo-compare.c | 39 +-- 1 file changed

[Qemu-devel] [PATCH v2 4/4] colo-compare: Fix removing fds been watched incorrectly in finalization

2017-02-15 Thread zhanghailiang
by pass the worker_context parameter to qemu_chr_fe_set_handlers(). Signed-off-by: zhanghailiang --- net/colo-compare.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 37ce75c..a6fc2ff 100644 --- a/net/colo-c

[Qemu-devel] [PATCH v2 1/4] colo-compare: use g_timeout_source_new() to process the stale packets

2017-02-15 Thread zhanghailiang
ff-by: zhanghailiang --- net/colo-compare.c | 62 +++--- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 162fd6a..fdde788 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -83,9

[Qemu-devel] [PATCH v2 0/4] colo-compare: fix some bugs

2017-02-15 Thread zhanghailiang
This series includes two parts: codes optimization and bug fix. patch 1 tries to move timer process into colo compare thread as a new coroutine. patch 2 ~ 4 fixe some bugs of colo compare. v2: - Squash patch 3 of last version into patch 2. (ZhangChen's suggestion) zhanghailiang (4):

[Qemu-devel] [PATCH 5/5] colo-compare: Fix removing fds been watched incorrectly in finalization

2017-02-15 Thread zhanghailiang
by pass the worker_context parameter to qemu_chr_fe_set_handlers(). Signed-off-by: zhanghailiang --- net/colo-compare.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 809bad3..4c74b02 100644 --- a/net/colo-c

[Qemu-devel] [PATCH 0/5] colo-compare: fix some bugs

2017-02-15 Thread zhanghailiang
Hi, This series fixes some bugs of colo compare. Patch 1 is trying to move timer process into colo compare thread as a new coroutine. Patch 2 ~ 5 fix several bugs in colo compare, for more details, please refer to each patch. Please review, thanks. zhanghailiang (5): colo-compare: use

[Qemu-devel] [PATCH 1/5] colo-compare: use g_timeout_source_new() to process the stale packets

2017-02-15 Thread zhanghailiang
ff-by: zhanghailiang --- net/colo-compare.c | 62 +++--- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 162fd6a..fdde788 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -83,9

[Qemu-devel] [PATCH 2/5] colo-compare: kick compare thread to exit while finalize

2017-02-15 Thread zhanghailiang
We should call g_main_loop_quit() to notify colo compare thread to exit, Or it will run in g_main_loop_run() forever. Besides, the finalizing process can't happen in context of colo thread, it is reasonable to remove the 'if (qemu_thread_is_self(&s->thread))' branch. Signed

[Qemu-devel] [PATCH 4/5] char: remove the right fd been watched in qemu_chr_fe_set_handlers()

2017-02-15 Thread zhanghailiang
h always try to find the Gsource from default context. Fix it by passing the right context to g_main_context_find_source_by_id(). Cc: Paolo Bonzini Cc: Marc-André Lureau Signed-off-by: zhanghailiang --- chardev/char-io.c | 13 + chardev/char-io.h | 2 ++ chardev/char.c|

[Qemu-devel] [PATCH 3/5] colo-compare: release all unhandled packets in finalize function

2017-02-15 Thread zhanghailiang
We should release all unhandled packets before finalize colo compare. Besides, we need to free connection_track_table, or there will be a memory leak bug. Signed-off-by: zhanghailiang --- net/colo-compare.c | 20 1 file changed, 20 insertions(+) diff --git a/net/colo

[Qemu-devel] [PATCH 2/2] savevm: Add new helpers to process the different stages of loadvm/savevm

2017-01-24 Thread zhanghailiang
le do checkpoint, besides, we want to separate the process of saving/loading memory and devices state. So we add three new helper functions: qemu_loadvm_state_begin(), qemu_load_device_state() and qemu_savevm_live_state() to achieve different process during migration. Signed-off-by: zhanghailiang S

[Qemu-devel] [PATCH 1/2] savevm: split save/find loadvm_handlers entry into two helper functions

2017-01-24 Thread zhanghailiang
ad to memory leak. To fix it, we split the process of saving and finding section entry into two helper functions, we will check if section info was exist in loadvm_handlers list before save it. This modifications have no side effect for normal migration. Signed-off-by: zhanghailiang Reviewed-b

[Qemu-devel] [PATCH 0/2] savevm: some improvements benefit COLO's later optimization

2017-01-24 Thread zhanghailiang
on, I fixed the titles/comments for both of them, and I kept the reviewed-by tag. (Hi Dave, please give it a glance again, since it has been a long time ;) ). Please review. Thanks. zhanghailiang (2): savevm: split save/find loadvm_handlers entry into two helper functions savevm: Ad

[Qemu-devel] [PATCH 2/3] colo-compare: add API to flush all queued packets while do checkpoint

2017-01-24 Thread zhanghailiang
From: Zhang Chen While COLO does checkpoint, we need to flush all queued packets of COLO proxy, use a new API to do these things, and export it which will be used by COLO frame. Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang --- net/colo-compare.c | 48

[Qemu-devel] [PATCH 3/3] colo-compare: use notifier to notify inconsistent packets comparing

2017-01-24 Thread zhanghailiang
It's a good idea to use notifier to notify COLO frame of inconsistent packets comparing. Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang --- net/colo-compare.c | 24 ++-- net/colo-compare.h | 2 ++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH 0/3] colo-compare: Preparing work for combining with COLO frame

2017-01-24 Thread zhanghailiang
Amit Shah Cc: Dr. David Alan Gilbert (git) Cc: eddie.d...@intel.com Cc: Xu Quan Zhang Chen (1): colo-compare: add API to flush all queued packets while do checkpoint zhanghailiang (2): colo-compare: reconstruct the mutex lock usage colo-compare: use notifier to notify inconsistent packets

[Qemu-devel] [PATCH 1/3] colo-compare: reconstruct the mutex lock usage

2017-01-24 Thread zhanghailiang
check_lock' to 'conn_list_lock' which is used to protect 'conn_list' queue, use another 'conn_lock' to protect 'primary_list' and 'secondary_list'. Besides, fix some missing places which need these mutex lock. Signed-off-by: zhanghailiang --

[Qemu-devel] [PATCH v2] migration: re-active images while migration been canceled after inactive them

2017-01-24 Thread zhanghailiang
d, the above error reports will appear. To prevent this, we can call bdrv_invalidate_cache_all() in qmp_migrate_cancel() directly if we find images become inactive. Besides, bdrv_invalidate_cache_all() in migration_completion() doesn't have the protection of big lock, fix it by add the missing qemu_

[Qemu-devel] [PATCH v3 4/6] replication: fix code logic with the new shared_disk option

2017-01-19 Thread zhanghailiang
Some code logic only be needed in non-shared disk, here we adjust these codes to prepare for shared disk scenario. Reviewed-by: Stefan Hajnoczi Signed-off-by: zhanghailiang --- block/replication.c | 47 --- 1 file changed, 28 insertions(+), 19

[Qemu-devel] [PATCH v3 5/6] replication: Implement block replication for shared disk case

2017-01-19 Thread zhanghailiang
d in the active disk and it will overwrite the existing sector content in the buffer. Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- block/replication.c | 48 ++-- 1 file changed, 42 insertions(+), 6 delet

[Qemu-devel] [PATCH v3 2/6] replication: add shared-disk and shared-disk-id options

2017-01-19 Thread zhanghailiang
We use these two options to identify which disk is shared Cc: Eric Blake Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- v3: - Move g_free(s->shared_disk_id) to the common fail process place (Stefan) - Fix comments for these two options --- bl

[Qemu-devel] [PATCH v3 3/6] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint()

2017-01-19 Thread zhanghailiang
. Reviewed-by: Stefan Hajnoczi Reviewed-by: Changlong Xie Signed-off-by: zhanghailiang --- block/replication.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/block/replication.c b/block/replication.c index b96a3e5..3a44728 100644 --- a

[Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case

2017-01-19 Thread zhanghailiang
p the patch which add a blk_root() helper - Fix some comments from Changlong zhanghailiang (6): docs/block-replication: Add description for shared-disk case replication: add shared-disk and shared-disk-id options replication: Split out backup_do_checkpoint() from secondary_do_check

[Qemu-devel] [PATCH v3 1/6] docs/block-replication: Add description for shared-disk case

2017-01-19 Thread zhanghailiang
Introuduce the scenario of shared-disk block replication and how to use it. Reviewed-by: Changlong Xie Reviewed-by: Stefan Hajnoczi Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- docs/block-replication.txt | 139

[Qemu-devel] [PATCH v3 6/6] nbd/replication: implement .bdrv_get_info() for nbd and replication driver

2017-01-19 Thread zhanghailiang
ver, it doesn't have cluster size, so here we return a fake value for it. This patch should be dropped if Eric's nbd patch be merged. https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg03567.html Cc: Eric Blake Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang ---

[Qemu-devel] [PATCH] migration: re-active images while migration been canceled after inactive them

2017-01-19 Thread zhanghailiang
called, the above error reports will appear. To prevent this, we can call bdrv_invalidate_cache_all() in qmp_migrate_cancel() directly if we find images become inactive. Signed-off-by: zhanghailiang --- Hi, I have sent another patch before to fix this problem, but didn't cover all the

[Qemu-devel] [PATCH 3/3] COLO: Don't process failover request while loading VM's state

2017-01-17 Thread zhanghailiang
need to restart the process. Cc: Eric Blake Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 26 ++ qapi-schema.json | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/migration/colo.

[Qemu-devel] [PATCH 1/3] COLO: fix setting checkpoint-delay not working properly

2017-01-17 Thread zhanghailiang
lize checkpoint-delay. Signed-off-by: zhanghailiang --- include/migration/colo.h | 2 ++ include/migration/migration.h | 5 + migration/colo.c | 33 +++-- migration/migration.c | 3 +++ 4 files changed, 33 insertions(+), 10 deletions(-

[Qemu-devel] [PATCH 2/3] COLO: Shutdown related socket fd while do failover

2017-01-17 Thread zhanghailiang
avoid this situation. Besides, we should close the corresponding file descriptors after failvoer BH shutdown them, Or there will be an error. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Cc: Dr. David Alan Gilbert --- include/migration/migration.h

[Qemu-devel] [PATCH 0/3] COLO: fix some bugs

2017-01-17 Thread zhanghailiang
ago, and has been reviewed by Dave. I'd like to pick these three patches from the later COLO series, which will include some optimization and integrating with block replication and COLO net proxy. Please review, thanks. zhanghailiang (3): COLO: fix setting checkpoint-delay not working pro

[Qemu-devel] [PATCH v2] qemu-thread: fix qemu_thread_set_name() race in qemu_thread_create()

2017-01-03 Thread zhanghailiang
From: Caoxinhua QEMU will crash with the follow backtrace if the new created thread exited before we call qemu_thread_set_name() for it. (gdb) bt #0 0x7f9a68b095d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x7f9a68b0acc8 in __GI_abort () at

[Qemu-devel] [Resend PATCH] The QEMU crashes since invoking qemu_thread_set_name(), the backtrace is:

2016-12-27 Thread zhanghailiang
From: Caoxinhua (gdb) bt #0 0x7f9a68b095d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x7f9a68b0acc8 in __GI_abort () at abort.c:90 #2 0x7f9a69cda389 in PAT_abort () from /usr/lib64/libuvpuserhotfix.so #3 0x7f9a69cdda0d in patchIllInsHandler

[Qemu-devel] [PATCH] The QEMU crashes since invoking qemu_thread_set_name(), the backtrace is:

2016-12-23 Thread zhanghailiang
From: Caoxinhua (gdb) bt #0 0x7f9a68b095d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x7f9a68b0acc8 in __GI_abort () at abort.c:90 #2 0x7f9a69cda389 in PAT_abort () from /usr/lib64/libuvpuserhotfix.so #3 0x7f9a69cdda0d in patchIllInsHandler

[Qemu-devel] [PATCH RFC v2 0/6] COLO block replication supports shared disk case

2016-12-05 Thread zhanghailiang
7;state': true } ] } } {'execute': 'migrate', 'arguments': {'uri': 'tcp:9.42.3.17:' } } 3. Failover Secondary side: Issue qmp commands: { 'execute': 'nbd-server-stop' } { "execute": "x-colo-lost-heartb

[Qemu-devel] [PATCH RFC v2 1/6] docs/block-replication: Add description for shared-disk case

2016-12-05 Thread zhanghailiang
Introuduce the scenario of shared-disk block replication and how to use it. Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- v2: - fix some problems found by Changlong --- docs/block-replication.txt | 139 +++-- 1

[Qemu-devel] [PATCH RFC v2 2/6] replication: add shared-disk and shared-disk-id options

2016-12-05 Thread zhanghailiang
We use these two options to identify which disk is shared Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- v2: - add these two options for BlockdevOptionsReplication to support qmp blockdev-add command. - fix a memory leak found by Changlong --- block

[Qemu-devel] [PATCH RFC v2 4/6] replication: fix code logic with the new shared_disk option

2016-12-05 Thread zhanghailiang
Some code logic only be needed in non-shared disk, here we adjust these codes to prepare for shared disk scenario. Signed-off-by: zhanghailiang --- block/replication.c | 47 --- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/block

[Qemu-devel] [PATCH RFC v2 6/6] nbd/replication: implement .bdrv_get_info() for nbd and replication driver

2016-12-05 Thread zhanghailiang
ver, it doesn't have cluster size, so here we return a fake value for it. This patch should be dropped if Eric's nbd patch be merged. https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg03567.html Cc: Eric Blake Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang ---

[Qemu-devel] [PATCH RFC v2 3/6] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint()

2016-12-05 Thread zhanghailiang
. Signed-off-by: zhanghailiang --- block/replication.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/block/replication.c b/block/replication.c index e87ae87..35e9ab3 100644 --- a/block/replication.c +++ b/block/replication.c @@ -332,20

[Qemu-devel] [PATCH RFC v2 5/6] replication: Implement block replication for shared disk case

2016-12-05 Thread zhanghailiang
d in the active disk and it will overwrite the existing sector content in the buffer. Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- block/replication.c | 48 ++-- 1 file changed, 42 insertions(+), 6 delet

[Qemu-devel] [PATCH] migration: re-active images when migration fails to complete

2016-11-19 Thread zhanghailiang
ol of images because we only regain it while the migration state is "active", but here users cancelled the migration when they found some errors happened (for example, libvirtd daemon is shutdown in destination unexpectedly). Signed-off-by: zhanghailiang --- migration/migration.c | 3

[Qemu-devel] [PATCH v2] qapi-schema: clarify 'colo' state for MigrationStatus

2016-11-02 Thread zhanghailiang
VM can not get into colo state unless users enable 'x-colo' capability for migration, Here it is necessary to clarify this. Suggested-by: Eric Blake Signed-off-by: zhanghailiang --- v2: - Clarify colo state for RunState too as Eric suggested. --- qapi-schema.json | 8 +--- 1 fi

[Qemu-devel] [PATCH v2] migration: fix missing assignment for has_x_checkpoint_delay

2016-11-02 Thread zhanghailiang
cified behavior by reading x_checkpoint_delay without checking has_x_checkpoint_delay. Signed-off-by: zhanghailiang Reviewed-by: Eric Blake --- v2: - fix the commit message as Eric sugguested. --- hmp.c | 1 + migration/migration.c | 1 + 2 files changed, 2 insertions(+) diff --git a/h

[Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay

2016-10-31 Thread zhanghailiang
migrate_parameters'. Signed-off-by: zhanghailiang --- hmp.c | 1 + migration/migration.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hmp.c b/hmp.c index b5e3f54..02103df 100644 --- a/hmp.c +++ b/hmp.c @@ -318,6 +318,7 @@ void hmp_info_migrate_parameters(

[Qemu-devel] [PATCH COLO-Frame (Base) v23 08/18] COLO: Send PVM state to secondary side when do checkpoint

2016-10-27 Thread zhanghailiang
he data to determine how much data should be read in the secondary side. So here, we can get the size of the data by saving it into I/O channel before send it to the secondary side. Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Cc: Dr.

[Qemu-devel] [PATCH COLO-Frame (Base) v23 16/18] docs: Add documentation for COLO feature

2016-10-27 Thread zhanghailiang
Introduce the design of COLO, and how to test it. Signed-off-by: zhanghailiang Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v21: - Fix some minor typos and grammar from Eric --- docs/COLO-FT.txt | 189 +++ 1 file changed, 189

[Qemu-devel] [PATCH COLO-Frame (Base) v23 09/18] COLO: Load VMState into QIOChannelBuffer before restore it

2016-10-27 Thread zhanghailiang
re load VM state, which can ensure the data is intact. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Cc: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v21: - Fix building waring v19: - fix

[Qemu-devel] [PATCH COLO-Frame (Base) v23 14/18] COLO: Implement the process of failover for primary VM

2016-10-27 Thread zhanghailiang
For primary side, if COLO gets failover request from users. To be exact, gets 'x_colo_lost_heartbeat' command. COLO thread will exit the loop while the failover BH does the cleanup work and resumes VM. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Al

[Qemu-devel] [PATCH COLO-Frame (Base) v23 12/18] COLO: Add 'x-colo-lost-heartbeat' command to trigger failover

2016-10-27 Thread zhanghailiang
Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag - Fix comments v19: - Fix title and comment v16: - Fix compile broken due to missing osdep.h v13: - Add Reviewed-by tag v11: - Add more comments for x-colo

[Qemu-devel] [PATCH COLO-Frame (Base) v23 02/18] COLO: migrate COLO related info to secondary node

2016-10-27 Thread zhanghailiang
e the --enable-colo/disable-colo on the source/destination side or not; Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v19: - fix title and comment v16: - Fix compile broken d

[Qemu-devel] [PATCH COLO-Frame (Base) v23 03/18] migration: Enter into COLO mode after migration if COLO is enabled

2016-10-27 Thread zhanghailiang
migration thread. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v23: - Add Reviewed-by tag v22: - Remove unnecessary 'migrate_set_state(&s->state, MIGRATION_STATUS_COLO, MIGRATION_

[Qemu-devel] [PATCH COLO-Frame (Base) v23 18/18] MAINTAINERS: Add maintainer for COLO framework related files

2016-10-27 Thread zhanghailiang
Add myself as co-maintainer of COLO framework, so that I can get CC'ed on future patches and bugs for this feature. Signed-off-by: zhanghailiang --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b01fec0..484e8b8 100644 --- a/MAINTA

[Qemu-devel] [PATCH COLO-Frame (Base) v23 05/18] COLO: Establish a new communicating path for COLO

2016-10-26 Thread zhanghailiang
This new communication path will be used for returning messages from Secondary side to Primary side. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v13: - Remove useless error report v12: - Add

[Qemu-devel] [PATCH COLO-Frame (Base) v23 06/18] COLO: Introduce checkpointing protocol

2016-10-26 Thread zhanghailiang
int, for which the Secondary VM is not running, later we will support 'hybrid' mode. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Cc: Eric Blake Cc: Markus Armbruster Cc: Dr. David Alan Gilbert Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit

[Qemu-devel] [PATCH COLO-Frame (Base) v23 00/18] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-10-26 Thread zhanghailiang
avid Alan Gilbert (git) zhanghailiang (18): migration: Introduce capability 'x-colo' to migration COLO: migrate COLO related info to secondary node migration: Enter into COLO mode after migration if COLO is enabled migration: Switch to COLO process after finishing loadvm COL

[Qemu-devel] [PATCH COLO-Frame (Base) v23 04/18] migration: Switch to COLO process after finishing loadvm

2016-10-26 Thread zhanghailiang
_incoming_co' records the original migration incoming coroutine. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag - Use bool type 'false' instead of int '0' (Amit) v19: - Fix

[Qemu-devel] [PATCH COLO-Frame (Base) v23 15/18] COLO: Implement failover work for secondary VM

2016-10-26 Thread zhanghailiang
If users require SVM to takeover work, COLO incoming thread should exit from loop while failover BH helps backing to migration incoming coroutine. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag

[Qemu-devel] [PATCH COLO-Frame (Base) v23 07/18] COLO: Add a new RunState RUN_STATE_COLO

2016-10-26 Thread zhanghailiang
Guest will enter this state when paused to save/restore VM state under COLO checkpoint. Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Eric Blake Reviewed-by: Amit Shah

[Qemu-devel] [PATCH COLO-Frame (Base) v23 17/18] configure: Support enable/disable COLO feature

2016-10-26 Thread zhanghailiang
configure --enable-colo/--disable-colo to switch COLO support on/off. COLO feature doesn't depend on any other external libraries, So here it is reasonable to enable COLO by default, to avoid re-compile QEMU if users want to use this capability. Signed-off-by: zhanghailiang Signed-off-b

[Qemu-devel] [PATCH COLO-Frame (Base) v23 11/18] COLO: Synchronize PVM's state to SVM periodically

2016-10-26 Thread zhanghailiang
Do checkpoint periodically, the default interval is 200ms. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v12: - Add Reviewed-by tag v11: - Fix wrong sleep time for checkpoint period. (Dave&#

[Qemu-devel] [PATCH COLO-Frame (Base) v23 10/18] COLO: Add checkpoint-delay parameter for migrate-set-parameters

2016-10-26 Thread zhanghailiang
Add checkpoint-delay parameter for migrate-set-parameters, so that we can control the checkpoint frequency when COLO is in periodic mode. Cc: Luiz Capitulino Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH COLO-Frame (Base) v23 13/18] COLO: Introduce state to record failover process

2016-10-26 Thread zhanghailiang
and set the value. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v20: - Convert 'enum COLOFailoverStatus' to qapi v19: - fix comments v11: - fix several typos found by Dave - Add Reviewed-by tag --- include

[Qemu-devel] [PATCH COLO-Frame (Base) v23 01/18] migration: Introduce capability 'x-colo' to migration

2016-10-26 Thread zhanghailiang
arn if colo is supported. The default value for COLO (COarse-Grain LOck Stepping) is disabled. Cc: Juan Quintela Cc: Amit Shah Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Eric Blake Reviewed-by: Amit Shah

[Qemu-devel] [PATCH COLO-Frame (Base) v22 01/17] migration: Introduce capability 'x-colo' to migration

2016-10-26 Thread zhanghailiang
arn if colo is supported. The default value for COLO (COarse-Grain LOck Stepping) is disabled. Cc: Juan Quintela Cc: Amit Shah Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Eric Blake Reviewed-by: Amit Shah

[Qemu-devel] [PATCH COLO-Frame (Base) v22 06/17] COLO: Introduce checkpointing protocol

2016-10-26 Thread zhanghailiang
int, for which the Secondary VM is not running, later we will support 'hybrid' mode. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Cc: Eric Blake Cc: Markus Armbruster Cc: Dr. David Alan Gilbert Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit

[Qemu-devel] [PATCH COLO-Frame (Base) v22 13/17] COLO: Introduce state to record failover process

2016-10-26 Thread zhanghailiang
and set the value. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v20: - Convert 'enum COLOFailoverStatus' to qapi v19: - fix comments v11: - fix several typos found by Dave - Add Reviewed-by tag --- include

[Qemu-devel] [PATCH COLO-Frame (Base) v22 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-10-26 Thread zhanghailiang
: Jason Wang Cc: Dr. David Alan Gilbert (git) zhanghailiang (17): migration: Introduce capability 'x-colo' to migration COLO: migrate COLO related info to secondary node migration: Enter into COLO mode after migration if COLO is enabled migration: Switch to COLO process after finish

[Qemu-devel] [PATCH COLO-Frame (Base) v22 02/17] COLO: migrate COLO related info to secondary node

2016-10-26 Thread zhanghailiang
e the --enable-colo/disable-colo on the source/destination side or not; Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- v22: - Add Reviewed-by tag v19: - fix title and comment v16: - Fix compile broken d

<    1   2   3   4   5   6   7   8   9   10   >