|
@@ -15,6 +15,7 @@
|
|
|
#include "net/vhost_net.h"
|
|
|
#include "qom/object_interfaces.h"
|
|
|
#include "qemu/iov.h"
|
|
|
+#include "qapi/string-output-visitor.h"
|
|
|
|
|
|
ssize_t qemu_netfilter_receive(NetFilterState *nf,
|
|
|
NetFilterDirection direction,
|
|
@@ -134,6 +135,9 @@ static void netfilter_complete(UserCreatable *uc, Error **errp)
|
|
|
NetFilterClass *nfc = NETFILTER_GET_CLASS(uc);
|
|
|
int queues;
|
|
|
Error *local_err = NULL;
|
|
|
+ char *str, *info;
|
|
|
+ ObjectProperty *prop;
|
|
|
+ StringOutputVisitor *ov;
|
|
|
|
|
|
if (!nf->netdev_id) {
|
|
|
error_setg(errp, "Parameter 'netdev' is required");
|
|
@@ -167,6 +171,22 @@ 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) {
|
|
|
+ if (!strcmp(prop->name, "type")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ ov = string_output_visitor_new(false);
|
|
|
+ object_property_get(OBJECT(nf), string_output_get_visitor(ov),
|
|
|
+ prop->name, errp);
|
|
|
+ str = string_output_get_string(ov);
|
|
|
+ string_output_visitor_cleanup(ov);
|
|
|
+ info = g_strdup_printf(",%s=%s", prop->name, str);
|
|
|
+ g_strlcat(nf->info_str, info, sizeof(nf->info_str));
|
|
|
+ g_free(str);
|
|
|
+ g_free(info);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static void netfilter_finalize(Object *obj)
|