On Sun, Jul 14, 2019 at 08:04:00PM -0400, Cole Robinson wrote:
This maps to XML like:
<network
xmlns:dnsmasq='http://libvirt.org/schemas/network/dnsmasq/1.0'>
...
<dnsmasq:options>
<dnsmasq:option value="foo=bar"/>
<dnsmasq:option
value="cname=*.foo.example.com,master.example.com"/>
</dnsmasq:options>
</network>
To dnsmasq config options
...
foo=bar
cname=*.foo.example.com,master.example.com
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/schemas/network.rng | 11 ++
src/network/bridge_driver.c | 130 +++++++++++++++++-
src/network/bridge_driver.h | 12 ++
tests/Makefile.am | 14 +-
.../networkxml2confdata/dnsmasq-options.conf | 18 +++
tests/networkxml2confdata/dnsmasq-options.xml | 15 ++
tests/networkxml2conftest.c | 8 +-
tests/networkxml2xmlin/dnsmasq-options.xml | 15 ++
tests/networkxml2xmlout/dnsmasq-options.xml | 17 +++
tests/networkxml2xmltest.c | 11 +-
10 files changed, 239 insertions(+), 12 deletions(-)
create mode 100644 tests/networkxml2confdata/dnsmasq-options.conf
create mode 100644 tests/networkxml2confdata/dnsmasq-options.xml
create mode 100644 tests/networkxml2xmlin/dnsmasq-options.xml
create mode 100644 tests/networkxml2xmlout/dnsmasq-options.xml
+static int
+networkDnsmasqDefNamespaceParse(xmlXPathContextPtr ctxt,
+ void **data)
+{
+ networkDnsmasqXmlNsDefPtr nsdata = NULL;
+ int ret = -1;
+
+ if (xmlXPathRegisterNs(ctxt, BAD_CAST "dnsmasq",
+ BAD_CAST DNSMASQ_NAMESPACE_HREF) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to register xml namespace '%s'"),
+ DNSMASQ_NAMESPACE_HREF);
+ return -1;
+ }
This breaks the build on Debian in Jenkins and Ubuntu 18 on travis:
https://ci.centos.org/view/libvirt/job/libvirt-build/systems=libvirt-debi...
https://travis-ci.org/libvirt/libvirt/jobs/560399203
Jano
+
+ if (VIR_ALLOC(nsdata) < 0)
+ return -1;
+
+ if (networkDnsmasqDefNamespaceParseOptions(nsdata, ctxt))
+ goto cleanup;
+
+ if (nsdata->noptions > 0)
+ VIR_STEAL_PTR(*data, nsdata);
+
+ ret = 0;
+
+ cleanup:
+ networkDnsmasqDefNamespaceFree(nsdata);
+ return ret;
+}