This patchset adds support for the following user defined metadata
fields for network filters.
- <title>: A short description of the filter.
- <description>: Any documentation that the user wants to store.
- <metadata>: Other metadata in XML form.
Two new public APIs have been added to work with these fields:
- virNWFilterGetMetadata()
- virNWFilterSetMetadata()
This is a v2 of:
https://listman.redhat.com/archives/libvir-list/2023-September/241788.html
Diff to v1:
- Added test cases in tests/nwfilterxml2xmltest.c
- Implemented test driver for nwfilter
- Added an API testcase tests/nwfiltermetadatatest.c
- Merged patches as instructed
K Shiva Kiran (11):
nwfilter_conf: Add schema and parser logic for nwfilter metadata
nwfilter_conf: Introduce public API to get/set user metadata
nwfilter: Implement RPC
virsh: Add new command `nwfilter-desc`
virsh: Add new command `nwfilter-metadata`
virsh: Add option --title for nwfilter-list
virnwfilterobj: Add obj get and set methods for nwfilter metadata
nwfilter_driver: Add Driver implementation for metadata
test_driver: Implement test driver for network filters
test_driver: Implement test driver for metadata APIs
NEWS: Introduce user-defined metadata fields for NWFilter object
NEWS.rst | 18 +
docs/formatnwfilter.rst | 31 ++
docs/manpages/virsh.rst | 93 ++++-
include/libvirt/libvirt-nwfilter.h | 27 ++
include/libvirt/virterror.h | 1 +
src/conf/nwfilter_conf.c | 35 +-
src/conf/nwfilter_conf.h | 8 +
src/conf/schemas/nwfilter.rng | 9 +
src/conf/virnwfilterobj.c | 148 ++++++++
src/conf/virnwfilterobj.h | 13 +
src/driver-nwfilter.h | 15 +
src/libvirt-nwfilter.c | 154 ++++++++
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 6 +
src/nwfilter/nwfilter_driver.c | 61 ++++
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 34 +-
src/remote_protocol-structs | 19 +
src/test/test_driver.c | 287 ++++++++++++++-
src/util/virerror.c | 3 +
tests/meson.build | 1 +
tests/nwfiltermetadatatest.c | 297 ++++++++++++++++
tests/nwfilterxml2xmlin/metadata-test.xml | 12 +
tests/nwfilterxml2xmlout/metadata-test.xml | 10 +
tests/nwfilterxml2xmltest.c | 1 +
tools/virsh-nwfilter.c | 387 ++++++++++++++++++++-
tools/virsh-util.c | 25 ++
tools/virsh-util.h | 9 +
28 files changed, 1698 insertions(+), 10 deletions(-)
create mode 100644 tests/nwfiltermetadatatest.c
create mode 100644 tests/nwfilterxml2xmlin/metadata-test.xml
create mode 100644 tests/nwfilterxml2xmlout/metadata-test.xml
--
2.42.0