net/colo-compare.c: Add secondary old packet detection

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>
This commit is contained in:
Zhang Chen 2020-10-16 13:52:07 +08:00 committed by Jason Wang
parent ec081984f4
commit 17475df2c1

View File

@ -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;
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;
}
result = g_queue_find_custom(&conn->primary_list,
&s->compare_timeout,
(GCompareFunc)colo_old_packet_check_one);
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;
}
/*