Commits
colo-with-virt…
Name already in use
Commits on Jul 6, 2017
-
net/colo-compare.c: Adjust net queue pop order for performance
The packet_enqueue() use g_queue_push_tail() to enqueue net packet, so it is more efficent way use g_queue_pop_head() to get packet for compare. That will improve the success rate of comparison. In my test the performance of ftp put 1000M file will increase 10%. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo-compare.c: Optimize unpredictable tcp options comparison
When network is busy, some tcp options(like sack) will unpredictable occur in primary side or secondary side. it will make packet size not same, but the two packet's payload is identical. colo just care about packet payload, so we skip the option field. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo-compare.c: compare tcp packet base on sequence number
If primary packet's sequence number not same with secondary packet's sequence number, no need to compare the packet other field. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo-compare.c: Add checkpoint min period to optimize performance
If colo-compare find out the first different packet that means the following packet almost is different. we needn't do a lot of checkpoint in this time, so we set the no-need-checkpoint peroid, default just set 3 second. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Commits on Jul 3, 2017
-
docs/colo-proxy.txt: Update colo-proxy usage of net driver with vnet_…
…header Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare
COLO-Proxy just focus on packet payload, so we skip vnet header. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo.c: Add vnet packet parse feature in colo-proxy
Make colo-compare and filter-rewriter can parse vnet packet. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/colo-compare.c: Change compare_chr_send() parameter
This patch change the compare_chr_send() parameter from CharBackend to CompareState, we can get more information like vnet_hdr(We use it to support packet with vnet_header). Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/filter-mirror.c: Add new option to enable vnet support for filter…
…-redirector We add the vnet_hdr_support option for filter-redirector, default is disabled. If you use virtio-net-pci net driver or other driver needs vnet_hdr, please enable it. Because colo-compare or other modules needs the vnet_hdr_len to parse packet, we add this new option send the len to others. You can use it for example: -object filter-redirector,id=r0,netdev=hn0,queue=tx,outdev=red0,vnet_hdr_support Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net/filter-mirror.c: Make filter mirror support vnet support.
We add the vnet_hdr_support option for filter-mirror, default is disabled. If you use virtio-net-pci or other driver needs vnet_hdr, please enable it. You can use it for example: -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0,vnet_hdr_support If it has vnet_hdr_support flag, we will change the sending packet format from struct {int size; const uint8_t buf[];} to {int size; int vnet_hdr_len; const uint8_t buf[];}. make other module(like colo-compare) know how to parse net packet correctly. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> -
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
net: Add vnet_hdr_len arguments in NetClientState
Add vnet_hdr_len arguments in NetClientState that make other module get real vnet_hdr_len easily. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Commits on Jun 8, 2017
-
COLO-compare: Optimize tcp compare for option field
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Commits on Apr 22, 2017
-
char: Fix removing wrong GSource that be found by fd_in_tag
We use fd_in_tag to find a GSource, fd_in_tag is return value of g_source_attach(GSource *source, GMainContext *context), the return value is unique only in the same context, so we may get the same values with different 'context' parameters. It is no problem to find the right fd_in_tag by using g_main_context_find_source_by_id(GMainContext *context, guint source_id) while there is only one default main context. But colo-compare tries to create/use its own context, and if we pass wrong 'context' parameter with right fd_in_tag, we will find a wrong GSource to handle. We tried to fix the related codes in commit b43decb, but it didn't fix the bug completely, because we still have some codes didn't pass *right* context parameter for remove_fd_in_watch(). Let's fix it by record the GSource directly instead of fd_in_tag. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-
replication: Remove the replication after failover
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
nbd/replication: implement .bdrv_get_info() for nbd and replication d…
…river Without this callback, there will be an error reports in the primary side: "qemu-system-x86_64: Couldn't determine the cluster size of the target image, which has no backing file: Operation not supported Aborting, since this may create an unusable destination image" For nbd driver, 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-block/2017-02/msg00825.html '[PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server'. Cc: Eric Blake <eblake@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
-
replication: Implement block replication for shared disk case
Just as the scenario of non-shared disk block replication, we are going to implement block replication from many basic blocks that are already in QEMU. The architecture is: virtio-blk || .---------- / || | Secondary / || '---------- / || virtio-blk / || | | || replication(5) | NBD --------> NBD (2) | | client || server ---> hidden disk <-- active disk(4) | ^ || | | replication(1) || | | | || | | +-----------------' || | (3) |drive-backup sync=none || | --------. | +-----------------+ || | Primary | | | || backing | --------' | | || | V | | +-------------------------------------------+ | | shared disk | <----------+ +-------------------------------------------+ 1) Primary writes will read original data and forward it to Secondary QEMU. 2) The hidden-disk is created automatically. It buffers the original content that is modified by the primary VM. It should also be an empty disk, and the driver supports bdrv_make_empty() and backing file. 3) Primary write requests will be written to Shared disk. 4) Secondary write requests will be buffered in the active disk and it will overwrite the existing sector content in the buffer. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> -
replication: fix code logic with the new shared_disk option
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 <stefanha@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
replication: Split out backup_do_checkpoint() from secondary_do_check…
…point() The helper backup_do_checkpoint() will be used for primary related codes. Here we split it out from secondary_do_checkpoint(). Besides, it is unnecessary to call backup_do_checkpoint() in replication starting and normally stop replication path. We only need call it while do real checkpointing. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
replication: add shared-disk and shared-disk-id options
We use these two options to identify which disk is shared Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
docs/block-replication: Add description for shared-disk case
Introuduce the scenario of shared-disk block replication and how to use it. Reviewed-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
-
COLO: Update the global runstate after going into colo state
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 <zhang.zhanghailiang@huawei.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
-
COLO: quick failover process by kick COLO thread
COLO thread may sleep at qemu_sem_wait(&s->colo_checkpoint_sem), while failover works begin, It's better to wakeup it to quick the process. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
COLO: notify net filters about checkpoint/failover event
Notify all net filters about the checkpoint and failover event. Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
filter-rewriter: handle checkpoint and failover event
After one round of checkpoint, the states between PVM and SVM become consistent, so it is unnecessary to adjust the sequence of net packets for old connections, besides, while failover happens, filter-rewriter needs to check if it still needs to adjust sequence of net packets. Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
filter: Add handle_event method for NetFilterClass
Filter needs to process the event of checkpoint/failover or other event passed by COLO frame. Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
COLO: flush host dirty ram from cache
Don't need to flush all VM's ram from cache, only flush the dirty pages since last checkpoint Cc: Juan Quintela <quintela@redhat.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
-
COLO: Split qemu_savevm_state_begin out of checkpoint process
It is unnecessary to call qemu_savevm_state_begin() in every checkpoint process. It mainly sets up devices and does the first device state pass. These data will not change during the later checkpoint process. So, we split it out of colo_do_checkpoint_transaction(), in this way, we can reduce these data transferring in the subsequent checkpoint. Cc: Juan Quintela <quintela@redhat.com> Sgned-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>
-
COLO: Separate the process of saving/loading ram and device state
We separate the process of saving/loading ram and device state when do checkpoint. We add new helpers for save/load ram/device. With this change, we can directly transfer RAM from primary side to secondary side without using channel-buffer as assistant, which also reduce the size of extra memory was used during checkpoint. Besides, we move the colo_flush_ram_cache to the proper position after the above change. Cc: Juan Quintela <quintela@redhat.com> 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>