netfilter: print filter info associate with the netdev

When execute "info network", print filter info also.
add a info_str member to NetFilterState, store specific filters
info.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Yang Hongyang 2015-10-07 11:52:19 +08:00 committed by Jason Wang
parent 7ef7bc8586
commit a4960f52e7
3 changed files with 32 additions and 0 deletions

View file

@ -1179,10 +1179,21 @@ void qmp_netdev_del(const char *id, Error **errp)
void print_net_client(Monitor *mon, NetClientState *nc)
{
NetFilterState *nf;
monitor_printf(mon, "%s: index=%d,type=%s,%s\n", nc->name,
nc->queue_index,
NetClientOptionsKind_lookup[nc->info->type],
nc->info_str);
if (!QTAILQ_EMPTY(&nc->filters)) {
monitor_printf(mon, "filters:\n");
}
QTAILQ_FOREACH(nf, &nc->filters, next) {
monitor_printf(mon, " - %s: type=%s%s\n",
object_get_canonical_path_component(OBJECT(nf)),
object_get_typename(OBJECT(nf)),
nf->info_str);
}
}
RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,