From 5fbba3d6594aab91a26c255776b80d454682d535 Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Mon, 3 Sep 2018 12:38:56 +0800 Subject: filter: Add handle_event method for NetFilterClass Filter needs to process the event of checkpoint/failover or other event passed by COLO frame. Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/net.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'net/net.c') diff --git a/net/net.c b/net/net.c index cdcd5cf634..c66847ed76 100644 --- a/net/net.c +++ b/net/net.c @@ -1335,6 +1335,25 @@ void hmp_info_network(Monitor *mon, const QDict *qdict) } } +void colo_notify_filters_event(int event, Error **errp) +{ + NetClientState *nc; + NetFilterState *nf; + NetFilterClass *nfc = NULL; + Error *local_err = NULL; + + QTAILQ_FOREACH(nc, &net_clients, next) { + QTAILQ_FOREACH(nf, &nc->filters, next) { + nfc = NETFILTER_GET_CLASS(OBJECT(nf)); + nfc->handle_event(nf, event, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + } + } +} + void qmp_set_link(const char *name, bool up, Error **errp) { NetClientState *ncs[MAX_QUEUE_NUM]; -- cgit v1.2.3