[Qemu-devel] [PATCH COLO-Frame v15 38/38] COLO: Add block replication into colo process

2016-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 --- migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v15 36/38] filter-buffer: make filter_buffer_flush() public

2016-02-21 Thread zhanghailiang
We will use it in COLO to flush the buffered packets. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- include/net/filter.h | 2 ++ net/filter-buffer.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/filter.h b/include

[Qemu-devel] [PATCH COLO-Frame v15 13/38] COLO: Load VMState into qsb before restore it

2016-02-21 Thread zhanghailiang
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 --- v13: - Fix the define of colo_get_cmd_value() to use 'Error **errp' instead of return

[Qemu-devel] [PATCH COLO-Frame v15 27/38] migration/savevm: Add new helpers to process the different stages of loadvm

2016-02-21 Thread zhanghailiang
, we make qemu_loadvm_state_main() API public. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - Split from patch 'COLO: Separate the process of saving/loading ram and device state --- include/sysemu/sysemu.h | 3 +++ migration/savevm.c

[Qemu-devel] [PATCH COLO-Frame v15 35/38] COLO: manage the status of buffer filters for PVM

2016-02-21 Thread zhanghailiang
Enable all buffer filters that added by COLO while go into COLO process, and disable them while exit COLO. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v15: - Re-implement colo_set_filter_status() based on COLOBufferFilters list. - Fix the title of this patch

[Qemu-devel] [PATCH COLO-Frame v15 28/38] migration/savevm: Export two helper functions for savevm process

2016-02-21 Thread zhanghailiang
We add a new helper functions qemu_savevm_live_state(), and make qemu_save_device_state() public. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - New patch split from previous 'COLO: Separate the process of saving/loading ram and device state --- include/sysemu/sysemu.h

[Qemu-devel] [PATCH COLO-Frame v15 16/38] COLO: synchronize PVM's state to SVM periodically

2016-02-21 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 --- v12: - Add Reviewed-by tag v11: - Fix wrong sleep time for checkpoint period. (Dave's comment) --- migration/colo.c | 12 ++

[Qemu-devel] [PATCH COLO-Frame v15 21/38] qmp event: Add COLO_EXIT event to notify users while exited from COLO

2016-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 --- v13: - Remove optional 'error' string for this event. (I doubted it was usefull for users, Since users shouldn't

[Qemu-devel] [PATCH COLO-Frame v15 37/38] COLO: flush buffered packets in checkpoint process or exit COLO

2016-02-21 Thread zhanghailiang
. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v15: - Re-implement colo_flush_filter_packets() based on COLOBufferFilters list --- migration/colo.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 4c39204..a2d489b

[Qemu-devel] [PATCH COLO-Frame v15 26/38] savevm: Introduce two helper functions for save/find loadvm_handlers entry

2016-02-21 Thread zhanghailiang
emory leak. We need to check if we have the section info in loadvm_handlers list before save it. For normal migration, it is harmless. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v14: - Add Reviewed-by tag - v13: - New patch --- migration/savevm.c

[Qemu-devel] [PATCH COLO-Frame v15 33/38] net: Add notifier/callback for netdev init

2016-02-21 Thread zhanghailiang
We can register some callback for this notifier, this will be used by COLO to register a callback which will add each netdev a buffer filter. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- include/net/net.h | 4 net/net.c | 33

[Qemu-devel] [PATCH COLO-Frame v15 25/38] COLO: Update the global runstate after going into colo state

2016-02-21 Thread zhanghailiang
If we start qemu with -S, the runstate will change from 'prelaunch' to 'running' after going into colo state. So it is necessary to update the global runstate after going into colo state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gil

[Qemu-devel] [PATCH COLO-Frame v15 34/38] COLO/filter: add each netdev a buffer filter

2016-02-21 Thread zhanghailiang
don't enable COLO while configure qemu, these buffer-filters will not be added. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v15: - call object_new_with_props() directly to add filter in colo_add_buffer_filter. (Jason's suggestion) v14: - New patch --- include

[Qemu-devel] [PATCH COLO-Frame v15 22/38] COLO failover: Shutdown related socket fd when do failover

2016-02-21 Thread zhanghailiang
s to wake up the blocking operation in failover BH. 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 --- v13: -

[Qemu-devel] [PATCH COLO-Frame v15 32/38] filter-buffer: Accept zero interval

2016-02-21 Thread zhanghailiang
We may want to accept zero interval when VM FT solutions like MC or COLO use this filter to release packets on demand. Signed-off-by: zhanghailiang Reviewed-by: Yang Hongyang Cc: Jason Wang Cc: Yang Hongyang --- net/filter-buffer.c | 10 -- 1 file changed, 10 deletions(-) diff --git

[Qemu-devel] [PATCH COLO-Frame v15 19/38] COLO: Implement failover work for Primary VM

2016-02-21 Thread zhanghailiang
For PVM, if there is failover request from users. The 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 Alan Gilbert --- v13: - Add Reviewed-by tag v12: - Fix error report and

[Qemu-devel] [PATCH COLO-Frame v15 18/38] COLO failover: Introduce state to record failover process

2016-02-21 Thread zhanghailiang
set the value. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v11: - fix several typos found by Dave - Add Reviewed-by tag --- include/migration/failover.h | 10 ++ migration/colo-failover.c| 37 + migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v15 29/38] COLO: Separate the process of saving/loading ram and device state

2016-02-21 Thread zhanghailiang
during checkpoint. Besides, we move the colo_flush_ram_cache to the proper position after the above change. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - split two new patches from this patch - Some minor fixes from Dave v13: - Re-use some existed helper functions to realize

[Qemu-devel] [PATCH COLO-Frame v15 12/38] ram/COLO: Record the dirty pages that SVM received

2016-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. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v12: - Add Reviewed-by tag v11: - Split a new helper function from

[Qemu-devel] [PATCH COLO-Frame v15 31/38] net/filter: Add a 'status' property for filter object

2016-02-21 Thread zhanghailiang
With this property, users can control if this filter is 'enable' or 'disable'. The default behavior for filter is enabled. We will skip the disabled filter when delivering packets in net layer. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyan

[Qemu-devel] [PATCH COLO-Frame v15 30/38] COLO: Split qemu_savevm_state_begin out of checkpoint process

2016-02-21 Thread zhanghailiang
data transferring in the later checkpoint. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Fix some minor issues found by Dave - Add Reviewed-by tag --- migration/colo.c | 51 --- 1 file

[Qemu-devel] [PATCH COLO-Frame v15 04/38] migration: Integrate COLO checkpoint process into migration

2016-02-21 Thread zhanghailiang
Add a migrate state: MIGRATION_STATUS_COLO, enter this migration state after the first live migration successfully finished. We reuse migration thread, so if colo is enabled by user, migration thread will go into the process of colo. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian

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

2016-02-21 Thread zhanghailiang
saving/loading ram and device. (patch 32) - Fix some other comments from Dave and Markus. zhanghailiang (38): configure: Add parameter for configure to enable/disable COLO support migration: Introduce capability 'x-colo' to migration COLO: migrate colo related info to secondary n

[Qemu-devel] [PATCH COLO-Frame v15 17/38] COLO failover: Introduce a new command to trigger a failover

2016-02-21 Thread zhanghailiang
e PVM, the Primary side will exit COLO mode and take over operation. If sent to the Secondary, the secondary will run failover work, then take over server operation to become the new Primary. Cc: Luiz Capitulino Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by:

[Qemu-devel] [PATCH COLO-Frame v15 24/38] COLO: Process shutdown command for VM in COLO state

2016-02-21 Thread zhanghailiang
If VM is in COLO FT state, we should do some extra work before normal shutdown process. SVM will ignore the shutdown command if this command is issued directly to it, PVM will send the shutdown command to SVM if it gets this command. Cc: Paolo Bonzini Signed-off-by: zhanghailiang Signed-off-by

[Qemu-devel] [PATCH COLO-Frame v15 15/38] COLO: Add checkpoint-delay parameter for migrate-set-parameters

2016-02-21 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 v15 07/38] COLO: Implement colo checkpoint protocol

2016-02-21 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 --- v14: - Rename '

[Qemu-devel] [PATCH COLO-Frame v15 10/38] COLO: Save PVM state to secondary side when do checkpoint

2016-02-21 Thread zhanghailiang
the size of VM state, so in master, we use qsb to store VM state temporarily, get the data size by call qsb_get_length() and then migrate the data to the qsb in the secondary side. Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH COLO-Frame v15 20/38] COLO: Implement failover work for Secondary VM

2016-02-21 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 --- v12: - Improve error message that suggested by Dave

[Qemu-devel] [PATCH COLO-Frame v15 23/38] COLO failover: Don't do failover during loading VM's state

2016-02-21 Thread zhanghailiang
We should not do failover work while the main thread is loading VM's state, otherwise it will destroy the consistent of VM's memory and device state. Here we add a new failover status 'RELAUNCH' which means we should relaunch the process of failover. Signed-off-by: zhanghai

[Qemu-devel] [PATCH COLO-Frame v15 06/38] COLO/migration: Create a new communication path from destination to source

2016-02-21 Thread zhanghailiang
This new communication path will be used for returning messages from destination to source. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Remove useless error report v12: - Add Reviewed-by tag v11: - Rebase master to use

[Qemu-devel] [PATCH COLO-Frame v15 14/38] COLO: Flush PVM's cached RAM into SVM's memory

2016-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. Si

[Qemu-devel] [PATCH COLO-Frame v15 09/38] QEMUSizedBuffer: Introduce two help functions for qsb

2016-02-21 Thread zhanghailiang
m the file into qsb, this is used to get VM state from socket into a buffer. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v11: - size_t'ify these two help functions (Dave's suggestion) --- include/migration/qemu-file.h | 3 ++- migra

[Qemu-devel] [PATCH COLO-Frame v15 08/38] COLO: Add a new RunState RUN_STATE_COLO

2016-02-21 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 --- qapi-schema.json | 5

[Qemu-devel] [PATCH COLO-Frame v15 05/38] migration: Integrate COLO checkpoint process into loadvm

2016-02-21 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 --- v12: - Add Reviewed-by tag v11: - We moved the place of bdrv_invalidate_cache_all(), but done the deleting work in other patch. F

[Qemu-devel] [PATCH COLO-Frame v15 01/38] configure: Add parameter for configure to enable/disable COLO support

2016-02-21 Thread zhanghailiang
configure --enable-colo/--disable-colo to switch COLO support on/off. COLO support is On by default. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v11: - Turn COLO on in default (Eric's suggestion) --- configure

[Qemu-devel] [PATCH COLO-Frame v15 11/38] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily

2016-02-21 Thread zhanghailiang
7;s state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v12: - Fix minor error in error_report (Dave's comment) - Add Reviewed-by tag v11: - Rename 'host_cache' to 'colo_cache' (Dave's suggestion) v

[Qemu-devel] [PATCH COLO-Frame v15 03/38] COLO: migrate colo related info to secondary node

2016-02-21 Thread zhanghailiang
/destination; Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v14: - Adjust the place of calling colo_info_init() v11: - Add Reviewed-by tag v10: - Use VMSTATE_BOOL instead of VMSTATE_UNIT32 for 'colo_requested

[Qemu-devel] [PATCH COLO-Frame v15 02/38] migration: Introduce capability 'x-colo' to migration

2016-02-21 Thread zhanghailiang
earn if colo is supported. 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 --- v14: - Fix the date of Copyright to 2016 v10: - Rename capability 'colo' to

[Qemu-devel] [PATCH COLO-Frame v14 39/40] COLO: flush buffered packets in checkpoint process or exit COLO

2016-02-06 Thread zhanghailiang
. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- migration/colo.c | 16 1 file changed, 16 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 86a7638..afbb0e1 100644 --- a/migration/colo.c +++ b/migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v14 40/40] COLO: Add block replication into colo process

2016-02-06 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 --- v14: - Remove the trace call --- migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v14 36/40] net/filter: Add a helper to traverse all the filters

2016-02-06 Thread zhanghailiang
Add a new API qemu_foreach_netfilter(), it will traverse all the filters, and call the callback function. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch split from previous version. --- include/net/net.h | 4 net/net.c | 24

[Qemu-devel] [PATCH COLO-Frame v14 38/40] filter-buffer: make filter_buffer_flush() public

2016-02-06 Thread zhanghailiang
We will use it in COLO to flush the buffered packets. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- include/net/filter.h | 2 ++ net/filter-buffer.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/filter.h b/include

[Qemu-devel] [PATCH COLO-Frame v14 32/40] net/filter: Introduce a helper to add a filter to the netdev

2016-02-06 Thread zhanghailiang
We add a new helper function netdev_add_filter(), this function can help adding a filter object to a netdev. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- include/net/filter.h | 7 +++ net/filter.c | 34 ++ 2 files changed, 41

[Qemu-devel] [PATCH COLO-Frame v14 33/40] filter-buffer: Accept zero interval

2016-02-06 Thread zhanghailiang
We may want to accept zero interval when VM FT solutions like MC or COLO use this filter to release packets on demand. Signed-off-by: zhanghailiang Reviewed-by: Yang Hongyang Cc: Jason Wang Cc: Yang Hongyang --- net/filter-buffer.c | 10 -- 1 file changed, 10 deletions(-) diff --git

[Qemu-devel] [PATCH COLO-Frame v14 28/40] migration/savevm: Export two helper functions for savevm process

2016-02-06 Thread zhanghailiang
We add a new helper functions qemu_savevm_live_state(), and make qemu_save_device_state() public. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - New patch split from previous 'COLO: Separate the process of saving/loading ram and device state' --- include/sysem

[Qemu-devel] [PATCH COLO-Frame v14 35/40] COLO/filter: add each netdev a buffer filter

2016-02-06 Thread zhanghailiang
don't enable COLO while configure qemu, these buffer-filters will not be added. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- include/migration/colo.h | 2 ++ include/net/filter.h | 2 ++ migration/colo-comm.c| 5 + migration/c

[Qemu-devel] [PATCH COLO-Frame v14 34/40] net: Add notifier/callback for netdev init

2016-02-06 Thread zhanghailiang
We can register some callback for this notifier, this will be used by COLO to register a callback which will add each netdev a buffer filter. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- include/net/net.h | 4 net/net.c | 33

[Qemu-devel] [PATCH COLO-Frame v14 29/40] COLO: Separate the process of saving/loading ram and device state

2016-02-06 Thread zhanghailiang
checkpoint. Besides, we move the colo_flush_ram_cache to the proper position after the above change. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - split two new patches from this patch - Some minor fixes from Dave v13: - Re-use some existed helper functions to realize saving

[Qemu-devel] [PATCH COLO-Frame v14 37/40] COLO: enable buffer filters for PVM

2016-02-06 Thread zhanghailiang
Enable all buffer filters that added by COLO while go into COLO process, and disable them while exit COLO. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v14: - New patch --- migration/colo.c | 32 1 file changed, 32 insertions(+) diff

[Qemu-devel] [PATCH COLO-Frame v14 21/40] qmp event: Add COLO_EXIT event to notify users while exited from COLO

2016-02-06 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 --- v13: - Remove optional 'error' string for this event. (I doubted it was usefull for users, Since users shouldn't int

[Qemu-devel] [PATCH COLO-Frame v14 31/40] net/filter: Add a 'status' property for filter object

2016-02-06 Thread zhanghailiang
With this property, users can control if this filter is 'enable' or 'disable'. The default behavior for filter is enabled. We will skip the disabled filter when delivering packets in net layer. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- include/net/

[Qemu-devel] [PATCH COLO-Frame v14 26/40] savevm: Introduce two helper functions for save/find loadvm_handlers entry

2016-02-06 Thread zhanghailiang
emory leak. We need to check if we have the section info in loadvm_handlers list before save it. For normal migration, it is harmless. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v14: - Add Reviewed-by tag - v13: - New patch --- migration/savevm.c

[Qemu-devel] [PATCH COLO-Frame v14 23/40] COLO failover: Don't do failover during loading VM's state

2016-02-06 Thread zhanghailiang
We should not do failover work while the main thread is loading VM's state, otherwise it will destroy the consistent of VM's memory and device state. Here we add a new failover status 'RELAUNCH' which means we should relaunch the process of failover. Signed-off-by: zhanghai

[Qemu-devel] [PATCH COLO-Frame v14 17/40] COLO failover: Introduce a new command to trigger a failover

2016-02-06 Thread zhanghailiang
e PVM, the Primary side will exit COLO mode and take over operation. If sent to the Secondary, the secondary will run failover work, then take over server operation to become the new Primary. Cc: Luiz Capitulino Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by:

[Qemu-devel] [PATCH COLO-Frame v14 27/40] migration/savevm: Add new helpers to process the different stages of loadvm

2016-02-06 Thread zhanghailiang
, we make qemu_loadvm_state_main() API public. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian --- v14: - Split from patch 'COLO: Separate the process of saving/loading ram and device state' --- include/sysemu/sysemu.h | 3 +++ migration/savevm.c

[Qemu-devel] [PATCH COLO-Frame v14 10/40] COLO: Save PVM state to secondary side when do checkpoint

2016-02-06 Thread zhanghailiang
the size of VM state, so in master, we use qsb to store VM state temporarily, get the data size by call qsb_get_length() and then migrate the data to the qsb in the secondary side. Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH COLO-Frame v14 22/40] COLO failover: Shutdown related socket fd when do failover

2016-02-06 Thread zhanghailiang
s to wake up the blocking operation in failover BH. 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 --- v13: -

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

2016-02-06 Thread zhanghailiang
the VM's downtime during checkpoint v14: - Re-implement the network processing based on netfilter (Jason Wang) - Rename 'COLOCommand' to 'COLOMessage'. (Markus's suggestion) - Split two new patches (patch 27/28) from patch 29 - Fix some other comments from Dave and M

[Qemu-devel] [PATCH COLO-Frame v14 30/40] COLO: Split qemu_savevm_state_begin out of checkpoint process

2016-02-06 Thread zhanghailiang
data transferring in the later checkpoint. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Fix some minor issues found by Dave - Add Reviewed-by tag --- migration/colo.c | 51 --- 1 file

[Qemu-devel] [PATCH COLO-Frame v14 24/40] COLO: Process shutdown command for VM in COLO state

2016-02-06 Thread zhanghailiang
If VM is in COLO FT state, we should do some extra work before normal shutdown process. SVM will ignore the shutdown command if this command is issued directly to it, PVM will send the shutdown command to SVM if it gets this command. Cc: Paolo Bonzini Signed-off-by: zhanghailiang Signed-off-by

[Qemu-devel] [PATCH COLO-Frame v14 13/40] COLO: Load VMState into qsb before restore it

2016-02-06 Thread zhanghailiang
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 --- v13: - Fix the define of colo_get_cmd_value() to use 'Error **errp' instead of return

[Qemu-devel] [PATCH COLO-Frame v14 11/40] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily

2016-02-06 Thread zhanghailiang
7;s state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v12: - Fix minor error in error_report (Dave's comment) - Add Reviewed-by tag v11: - Rename 'host_cache' to 'colo_cache' (Dave's suggestion) v

[Qemu-devel] [PATCH COLO-Frame v14 04/40] migration: Integrate COLO checkpoint process into migration

2016-02-06 Thread zhanghailiang
Add a migrate state: MIGRATION_STATUS_COLO, enter this migration state after the first live migration successfully finished. We reuse migration thread, so if colo is enabled by user, migration thread will go into the process of colo. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian

[Qemu-devel] [PATCH COLO-Frame v14 25/40] COLO: Update the global runstate after going into colo state

2016-02-06 Thread zhanghailiang
If we start qemu with -S, the runstate will change from 'prelaunch' to 'running' after going into colo state. So it is necessary to update the global runstate after going into colo state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gil

[Qemu-devel] [PATCH COLO-Frame v14 18/40] COLO failover: Introduce state to record failover process

2016-02-06 Thread zhanghailiang
set the value. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v11: - fix several typos found by Dave - Add Reviewed-by tag --- include/migration/failover.h | 10 ++ migration/colo-failover.c| 37 + migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v14 03/40] COLO: migrate colo related info to secondary node

2016-02-06 Thread zhanghailiang
/destination; Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v14: - Adjust the place of calling colo_info_init() v11: - Add Reviewed-by tag v10: - Use VMSTATE_BOOL instead of VMSTATE_UNIT32 for 'colo_requested

[Qemu-devel] [PATCH COLO-Frame v14 05/40] migration: Integrate COLO checkpoint process into loadvm

2016-02-06 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 --- v12: - Add Reviewed-by tag v11: - We moved the place of bdrv_invalidate_cache_all(), but done the deleting work in other patch. F

[Qemu-devel] [PATCH COLO-Frame v14 19/40] COLO: Implement failover work for Primary VM

2016-02-06 Thread zhanghailiang
For PVM, if there is failover request from users. The 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 Alan Gilbert --- v13: - Add Reviewed-by tag v12: - Fix error report and

[Qemu-devel] [PATCH COLO-Frame v14 07/40] COLO: Implement colo checkpoint protocol

2016-02-06 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 --- v14: - Rename '

[Qemu-devel] [PATCH COLO-Frame v14 12/40] ram/COLO: Record the dirty pages that SVM received

2016-02-06 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. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v12: - Add Reviewed-by tag v11: - Split a new helper function from

[Qemu-devel] [PATCH COLO-Frame v14 15/40] COLO: Add checkpoint-delay parameter for migrate-set-parameters

2016-02-06 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 v14 02/40] migration: Introduce capability 'x-colo' to migration

2016-02-06 Thread zhanghailiang
earn if colo is supported. 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 --- v14: - Fix the date of Copyright to 2016 v10: - Rename capability 'colo' to

[Qemu-devel] [PATCH COLO-Frame v14 16/40] COLO: synchronize PVM's state to SVM periodically

2016-02-06 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 --- v12: - Add Reviewed-by tag v11: - Fix wrong sleep time for checkpoint period. (Dave's review comment) --- migration/colo.c

[Qemu-devel] [PATCH COLO-Frame v14 20/40] COLO: Implement failover work for Secondary VM

2016-02-06 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 --- v12: - Improve error message that suggested by Dave

[Qemu-devel] [PATCH COLO-Frame v14 08/40] COLO: Add a new RunState RUN_STATE_COLO

2016-02-06 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 --- qapi-schema.json | 5

[Qemu-devel] [PATCH COLO-Frame v14 09/40] QEMUSizedBuffer: Introduce two help functions for qsb

2016-02-06 Thread zhanghailiang
m the file into qsb, this is used to get VM state from socket into a buffer. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v11: - size_t'ify these two help functions (Dave's suggestion) --- include/migration/qemu-file.h | 3 ++- migra

[Qemu-devel] [PATCH COLO-Frame v14 14/40] COLO: Flush PVM's cached RAM into SVM's memory

2016-02-06 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. Si

[Qemu-devel] [PATCH COLO-Frame v14 06/40] COLO/migration: Create a new communication path from destination to source

2016-02-06 Thread zhanghailiang
This new communication path will be used for returning messages from destination to source. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Remove useless error report v12: - Add Reviewed-by tag v11: - Rebase master to use

[Qemu-devel] [PATCH COLO-Frame v14 01/40] configure: Add parameter for configure to enable/disable COLO support

2016-02-06 Thread zhanghailiang
configure --enable-colo/--disable-colo to switch COLO support on/off. COLO support is On by default. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v11: - Turn COLO on in default (Eric's suggestion) --- configure

[Qemu-devel] [PATCH v4 3/4] filter-buffer: Accept zero interval

2016-02-04 Thread zhanghailiang
We may want to accept zero interval when VM FT solutions like MC or COLO use this filter to release packets on demand. Signed-off-by: zhanghailiang Reviewed-by: Yang Hongyang --- net/filter-buffer.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/net/filter-buffer.c b/net/filter

[Qemu-devel] [PATCH v4 2/4] net/filter: Introduce a helper to add a filter to the netdev

2016-02-04 Thread zhanghailiang
We add a new helper function netdev_add_default_filter(), this function can help adding a filter object to a netdev. Besides, we add a is_default member for struct NetFilterState to indicate whether the filter is default or not. Signed-off-by: zhanghailiang --- v4: - Rename netdev_add_filter

[Qemu-devel] [PATCH v4 0/4] Netfilter: Add each netdev a default filter

2016-02-04 Thread zhanghailiang
- Re-implement netdev_add_filter() by re-using object_object() (Jason) - Send patch 'net/filter: Fix the output information for command 'info network' as an independent one. (Jason) zhanghailiang (4): net/filter: Add a 'status' property for filter object net/filte

[Qemu-devel] [PATCH v4 4/4] net/filter: Add a default filter to each netdev

2016-02-04 Thread zhanghailiang
during COLO state in future. Signed-off-by: zhanghailiang --- v4: - Rname DEFAULT_FILTER_TYPE to DEFAULT_FILTER_ID v2: - Add codes that generate id automatically for default filter (Jason's suggestion) - Some other minor fixes. --- include/net/filter.h | 4 net/net.c

[Qemu-devel] [PATCH v4 1/4] net/filter: Add a 'status' property for filter object

2016-02-04 Thread zhanghailiang
With this property, users can control if this filter is 'enable' or 'disable'. The default behavior for filter is enabled. We will skip the disabled filter when delivering packets in net layer. Signed-off-by: zhanghailiang --- v2: - Squash previous patch 3 into this patch

[Qemu-devel] [PATCH v2 3/6] savevm: Split load vm state function qemu_loadvm_state

2016-02-04 Thread zhanghailiang
qemu_loadvm_state is too long, and we can simplify it by splitting up with three helper functions. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- migration/savevm.c | 156 +++-- 1 file changed, 92

[Qemu-devel] [PATCH v2 1/6] ram: Split host_from_stream_offset() into two helper functions

2016-02-04 Thread zhanghailiang
: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- include/exec/ram_addr.h | 8 ++-- migration/ram.c | 40 +--- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index

[Qemu-devel] [PATCH v2 0/6] Some improvments and small fixes for migration

2016-02-04 Thread zhanghailiang
Patch 1 ~ patch 4 are picked from COLO and live memory snapshot series, They are just small improvements for migration codes. Patch 5, 6 are small fixes for migration releated documention. v2: - Fix a typo (Amit) - A better commit description from Dave for patch 2 zhanghailiang (6): ram

[Qemu-devel] [PATCH v2 2/6] migration: Rename the'file' member of MigrationState

2016-02-04 Thread zhanghailiang
Rename the 'file' memory of MigrationState to 'to_dst_file' to be consistent with to_src_file, from_src_file and from_dst_file. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- include/migration/migration.h | 2 +- migration/exec

[Qemu-devel] [PATCH v2 4/6] migration/ram: Fix some helper functions' parameter to use PageSearchStatus

2016-02-04 Thread zhanghailiang
helper functions. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- migration/ram.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index b541ceb..3cdfea4 1006

[Qemu-devel] [PATCH v2 5/6] qmp-commands.hx: Fix the missing options for migration parameters commands

2016-02-04 Thread zhanghailiang
at we cann't set x-cpu-throttle-initial and x-cpu-throttle-increment through migrate-set-parameters qmp command. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- qmp-commands.hx | 18 ++ 1 file changed, 14 insertions(+), 4 deletion

[Qemu-devel] [PATCH v2 6/6] qmp-commands.hx: Document the missing options for migration capability commands

2016-02-04 Thread zhanghailiang
Add the missing descriptions for the options of migration capability commands, and fix the example for query-migrate-capabilities command. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah --- qmp-commands.hx | 15 ++- 1 file changed, 14

[Qemu-devel] [PATCH v3 3/4] filter-buffer: Accept zero interval

2016-02-01 Thread zhanghailiang
We may want to accept zero interval when VM FT solutions like MC or COLO use this filter to release packets on demand. Signed-off-by: zhanghailiang Reviewed-by: Yang Hongyang --- net/filter-buffer.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/net/filter-buffer.c b/net/filter

[Qemu-devel] [PATCH v3 0/4] Netfilter: Add each netdev a default filter

2016-02-01 Thread zhanghailiang
bject_object() (Jason) - Send patch 'net/filter: Fix the output information for command 'info network' as an independent one. (Jason) zhanghailiang (4): net/filter: Add a 'status' property for filter object net/filter: Introduce a helper to add a filter to the ne

[Qemu-devel] [PATCH v3 1/4] net/filter: Add a 'status' property for filter object

2016-02-01 Thread zhanghailiang
With this property, users can control if this filter is 'enable' or 'disable'. The default behavior for filter is enabled. We will skip the disabled filter when delivering packets in net layer. Signed-off-by: zhanghailiang --- v2: - Squash previous patch 3 into this patch

[Qemu-devel] [PATCH v3 4/4] net/filter: Add a default filter to each netdev

2016-02-01 Thread zhanghailiang
during COLO state in future. Signed-off-by: zhanghailiang --- v2: - Add codes that generate id automatically for default filter (Jason's suggestion) - Some other minor fixes. --- include/net/filter.h | 4 net/net.c| 23 +++ 2 files changed, 27 inser

[Qemu-devel] [PATCH v3 2/4] net/filter: Introduce a helper to add a filter to the netdev

2016-02-01 Thread zhanghailiang
We add a new helper function netdev_add_filter(), this function can help adding a filter object to a netdev. Besides, we add a is_default member for struct NetFilterState to indicate whether the filter is default or not. Signed-off-by: zhanghailiang --- v3: - Use object_new_with_props() instead

[Qemu-devel] [PATCH RFC v2 5/5] net/filter: Add a default filter to each netdev

2016-01-27 Thread zhanghailiang
during COLO state in future. Signed-off-by: zhanghailiang --- v2: - Add codes that generate id automatically for default filter (Jason's suggestion) - Some other minor fixes. --- include/net/filter.h | 4 net/net.c| 23 +++ 2 files changed, 27 inser

[Qemu-devel] [PATCH RFC v2 3/5] net/filter: Introduce a helper to add a filter to the netdev

2016-01-27 Thread zhanghailiang
We add a new helper function netdev_add_filter(), this function can help adding a filter object to a netdev. Besides, we add a is_default member for struct NetFilterState to indicate whether the filter is default or not. Signed-off-by: zhanghailiang --- v2: -Re-implement netdev_add_filter() by

[Qemu-devel] [PATCH RFC v2 2/5] vl: Make object_create() public

2016-01-27 Thread zhanghailiang
Make the helper object_create() public and fix its first parameter to accept NULL value. Signed-off-by: zhanghailiang Cc: Paolo Bonzini --- v2: - New patch --- include/qemu-common.h | 2 ++ vl.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include

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