aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorZhang Chen <zhangckid@gmail.com>2018-09-03 12:38:56 +0800
committerJason Wang <jasowang@redhat.com>2018-10-19 11:15:03 +0800
commit5fbba3d6594aab91a26c255776b80d454682d535 (patch)
treecd9e0d43ab0bfc20b2cf633063e7cf710e07ce96 /net/net.c
parentd1955d22197615eb65ec7b7ddc1242e5103f5b50 (diff)
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 <zhang.zhanghailiang@huawei.com> Signed-off-by: Zhang Chen <zhangckid@gmail.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c19
1 files changed, 19 insertions, 0 deletions
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];