diff options
author | Zhang Chen <zhangckid@gmail.com> | 2018-09-03 12:38:56 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2018-10-19 11:15:03 +0800 |
commit | 5fbba3d6594aab91a26c255776b80d454682d535 (patch) | |
tree | cd9e0d43ab0bfc20b2cf633063e7cf710e07ce96 /net/net.c | |
parent | d1955d22197615eb65ec7b7ddc1242e5103f5b50 (diff) | |
download | qemu-5fbba3d6594aab91a26c255776b80d454682d535.zip |
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.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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]; |