diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2015-10-13 13:37:44 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-11-18 21:13:49 +0100 |
commit | 456fb0bfe0b27c54d316be7fe3b362247f732656 (patch) | |
tree | 02712aa526b0eb20b88a265a4d81a371a8727c65 /net | |
parent | 9a842f7d3ce421b39c7edbfe2c47efeac5db6c28 (diff) |
net: Convert net filter code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/filter.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/filter.c b/net/filter.c index 326f2b5ac8..1365bad026 100644 --- a/net/filter.c +++ b/net/filter.c @@ -137,6 +137,7 @@ static void netfilter_complete(UserCreatable *uc, Error **errp) Error *local_err = NULL; char *str, *info; ObjectProperty *prop; + ObjectPropertyIterator *iter; StringOutputVisitor *ov; if (!nf->netdev_id) { @@ -173,7 +174,8 @@ static void netfilter_complete(UserCreatable *uc, Error **errp) QTAILQ_INSERT_TAIL(&nf->netdev->filters, nf, next); /* generate info str */ - QTAILQ_FOREACH(prop, &OBJECT(nf)->properties, node) { + iter = object_property_iter_init(OBJECT(nf)); + while ((prop = object_property_iter_next(iter))) { if (!strcmp(prop->name, "type")) { continue; } @@ -187,6 +189,7 @@ static void netfilter_complete(UserCreatable *uc, Error **errp) g_free(str); g_free(info); } + object_property_iter_free(iter); } static void netfilter_finalize(Object *obj) |