[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V2 09/10] net/colo-compare.c: Add secondary old packet detection
From: |
Zhang Chen |
Subject: |
[PATCH V2 09/10] net/colo-compare.c: Add secondary old packet detection |
Date: |
Fri, 16 Oct 2020 13:52:07 +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>
---
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 1263203e7f..0c87fd9e33 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.17.1
- [PATCH V2 00/10] COLO project queued patches 20-Oct, Zhang Chen, 2020/10/16
- [PATCH V2 02/10] Optimize seq_sorter function for colo-compare, Zhang Chen, 2020/10/16
- [PATCH V2 01/10] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup, Zhang Chen, 2020/10/16
- [PATCH V2 03/10] Reduce the time of checkpoint for COLO, Zhang Chen, 2020/10/16
- [PATCH V2 04/10] Fix the qemu crash when guest shutdown in COLO mode, Zhang Chen, 2020/10/16
- [PATCH V2 05/10] colo-compare: fix missing compare_seq initialization, Zhang Chen, 2020/10/16
- [PATCH V2 06/10] colo-compare: check mark in mutual exclusion, Zhang Chen, 2020/10/16
- [PATCH V2 07/10] net/colo-compare.c: Fix compare_timeout format issue, Zhang Chen, 2020/10/16
- [PATCH V2 08/10] net/colo-compare.c: Change the timer clock type, Zhang Chen, 2020/10/16
- [PATCH V2 09/10] net/colo-compare.c: Add secondary old packet detection,
Zhang Chen <=
- [PATCH V2 10/10] net/colo-compare.c: Increase default queued packet scan frequency, Zhang Chen, 2020/10/16
- Re: [PATCH V2 00/10] COLO project queued patches 20-Oct, Jason Wang, 2020/10/19