[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/17] net/colo-compare.c: Add secondary old packet detection
From: |
Jason Wang |
Subject: |
[PULL 10/17] net/colo-compare.c: Add secondary old packet detection |
Date: |
Wed, 11 Nov 2020 21:11:34 +0800 |
From: Zhang Chen <chen.zhang@intel.com>
Detect queued secondary packet to sync VM state in time.
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/colo-compare.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 1263203..0c87fd9 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -636,19 +636,26 @@ void colo_compare_unregister_notifier(Notifier *notify)
static int colo_old_packet_check_one_conn(Connection *conn,
CompareState *s)
{
- GList *result = NULL;
-
- result = g_queue_find_custom(&conn->primary_list,
- &s->compare_timeout,
- (GCompareFunc)colo_old_packet_check_one);
+ if (!g_queue_is_empty(&conn->primary_list)) {
+ if (g_queue_find_custom(&conn->primary_list,
+ &s->compare_timeout,
+ (GCompareFunc)colo_old_packet_check_one))
+ goto out;
+ }
- if (result) {
- /* Do checkpoint will flush old packet */
- colo_compare_inconsistency_notify(s);
- return 0;
+ if (!g_queue_is_empty(&conn->secondary_list)) {
+ if (g_queue_find_custom(&conn->secondary_list,
+ &s->compare_timeout,
+ (GCompareFunc)colo_old_packet_check_one))
+ goto out;
}
return 1;
+
+out:
+ /* Do checkpoint will flush old packet */
+ colo_compare_inconsistency_notify(s);
+ return 0;
}
/*
--
2.7.4
- [PULL 00/17] Net patches, Jason Wang, 2020/11/11
- [PULL 01/17] virtio-net: Set mac address to hardware if the peer is vdpa, Jason Wang, 2020/11/11
- [PULL 02/17] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup, Jason Wang, 2020/11/11
- [PULL 04/17] Reduce the time of checkpoint for COLO, Jason Wang, 2020/11/11
- [PULL 06/17] colo-compare: fix missing compare_seq initialization, Jason Wang, 2020/11/11
- [PULL 07/17] colo-compare: check mark in mutual exclusion, Jason Wang, 2020/11/11
- [PULL 03/17] Optimize seq_sorter function for colo-compare, Jason Wang, 2020/11/11
- [PULL 05/17] Fix the qemu crash when guest shutdown in COLO mode, Jason Wang, 2020/11/11
- [PULL 08/17] net/colo-compare.c: Fix compare_timeout format issue, Jason Wang, 2020/11/11
- [PULL 09/17] net/colo-compare.c: Change the timer clock type, Jason Wang, 2020/11/11
- [PULL 10/17] net/colo-compare.c: Add secondary old packet detection,
Jason Wang <=
- [PULL 11/17] net/colo-compare.c: Increase default queued packet scan frequency, Jason Wang, 2020/11/11
- [PULL 13/17] net/l2tpv3: Remove redundant check in net_init_l2tpv3(), Jason Wang, 2020/11/11
- [PULL 12/17] net: remove an assert call in eth_get_gso_type, Jason Wang, 2020/11/11
- [PULL 14/17] hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer, Jason Wang, 2020/11/11
- [PULL 15/17] hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers(), Jason Wang, 2020/11/11
- [PULL 16/17] hw/net/can/ctucan_core: Handle big-endian hosts, Jason Wang, 2020/11/11
- [PULL 17/17] hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers, Jason Wang, 2020/11/11
- Re: [PULL 00/17] Net patches, Peter Maydell, 2020/11/11