mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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>
This commit is contained in:
parent
9a842f7d3c
commit
456fb0bfe0
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue