[libvirt] [PATCHv4 2/2] v8.0: put dnsmasq parameters into conf-file

Laine Stump laine at laine.org
Tue Dec 11 11:27:46 UTC 2012


On 12/06/2012 12:20 PM, Gene Czarcinski wrote:
> Updated per Laine Stump's review commands and rebased 6 Dec 2012.
>
> This patch changes how parameters are passed to dnsmasq.  Instead of
> being on the command line, the parameters are put into a file (one
> parameter per line) and a commandline --conf-file= specifies the
> location of the file.  The file is located in the same directory as
> the leases file.
>
> Putting the dnsmasq parameters into a configuration file
> allows them to be examined and more easily understood than
> examining the command lines displayed by "ps ax".  This is
> especially true when a number of networks have been started.
>
> I suspect that when the use of dnsmasq was originally done,
> the command line was simple but has gotten more complicated
> over time and will likely become even more complicated in the
> future.
>
> I believe that if use of dnsmasq was done today with
> the current requirements for dnsmasq, a configuration file
> would have been used.  Many (most?) daemons use configuration
> files as oppose to large number of command line parameters.
>
> One potential addition to dnsmasq parameters is to specify
> the reverse-lookup queries which are not to be passed on up
> the chain.  For IPv4, such queries are rather simple and
> take the form:
>     <ipv4_address>.in-addr.arpa
> but ipv6 queries involve a lot longer specification.  The
> IPv6 query will be of the form:
>     <ipv6_address>.ip6.arpa
> where the above query expands to a 44 character string which is
> specified by --local=/<ipv6_address>.ip6.arpa/ which is
> certainly a lot of clutter to add to the command line.
>
> Note: The test conf files have all been renamed .conf instead of .argv.
> ---
>  src/network/bridge_driver.c                        | 189 +++++++++++++--------
>  src/network/bridge_driver.h                        |  13 +-
>  src/util/dnsmasq.h                                 |   4 +-
>  tests/networkxml2argvdata/dhcp6-nat-network.argv   |  15 --
>  tests/networkxml2argvdata/dhcp6-nat-network.conf   |  19 +++
>  tests/networkxml2argvdata/dhcp6-network.argv       |  15 --
>  tests/networkxml2argvdata/dhcp6-network.conf       |  19 +++
>  .../dhcp6host-routed-network.argv                  |  13 --
>  .../dhcp6host-routed-network.conf                  |  17 ++
>  tests/networkxml2argvdata/isolated-network.argv    |  16 --
>  tests/networkxml2argvdata/isolated-network.conf    |  20 +++
>  .../networkxml2argvdata/nat-network-dns-hosts.argv |  10 --
>  .../networkxml2argvdata/nat-network-dns-hosts.conf |  14 ++
>  .../nat-network-dns-srv-record-minimal.argv        |  19 ---
>  .../nat-network-dns-srv-record-minimal.conf        |  23 +++
>  .../nat-network-dns-srv-record.argv                |  14 --
>  .../nat-network-dns-srv-record.conf                |  18 ++
>  .../nat-network-dns-txt-record.argv                |  13 --
>  .../nat-network-dns-txt-record.conf                |  18 ++
>  tests/networkxml2argvdata/nat-network.argv         |  15 --
>  tests/networkxml2argvdata/nat-network.conf         |  19 +++
>  tests/networkxml2argvdata/netboot-network.argv     |  19 ---
>  tests/networkxml2argvdata/netboot-network.conf     |  23 +++
>  .../networkxml2argvdata/netboot-proxy-network.argv |  17 --
>  .../networkxml2argvdata/netboot-proxy-network.conf |  21 +++
>  tests/networkxml2argvdata/routed-network.argv      |   8 -
>  tests/networkxml2argvdata/routed-network.conf      |  12 ++
>  tests/networkxml2argvtest.c                        |  42 +----
>  28 files changed, 349 insertions(+), 296 deletions(-)
>  delete mode 100644 tests/networkxml2argvdata/dhcp6-nat-network.argv
>  create mode 100644 tests/networkxml2argvdata/dhcp6-nat-network.conf
>  delete mode 100644 tests/networkxml2argvdata/dhcp6-network.argv
>  create mode 100644 tests/networkxml2argvdata/dhcp6-network.conf
>  delete mode 100644 tests/networkxml2argvdata/dhcp6host-routed-network.argv
>  create mode 100644 tests/networkxml2argvdata/dhcp6host-routed-network.conf
>  delete mode 100644 tests/networkxml2argvdata/isolated-network.argv
>  create mode 100644 tests/networkxml2argvdata/isolated-network.conf
>  delete mode 100644 tests/networkxml2argvdata/nat-network-dns-hosts.argv
>  create mode 100644 tests/networkxml2argvdata/nat-network-dns-hosts.conf
>  delete mode 100644 tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
>  create mode 100644 tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.conf
>  delete mode 100644 tests/networkxml2argvdata/nat-network-dns-srv-record.argv
>  create mode 100644 tests/networkxml2argvdata/nat-network-dns-srv-record.conf
>  delete mode 100644 tests/networkxml2argvdata/nat-network-dns-txt-record.argv
>  create mode 100644 tests/networkxml2argvdata/nat-network-dns-txt-record.conf
>  delete mode 100644 tests/networkxml2argvdata/nat-network.argv
>  create mode 100644 tests/networkxml2argvdata/nat-network.conf
>  delete mode 100644 tests/networkxml2argvdata/netboot-network.argv
>  create mode 100644 tests/networkxml2argvdata/netboot-network.conf
>  delete mode 100644 tests/networkxml2argvdata/netboot-proxy-network.argv
>  create mode 100644 tests/networkxml2argvdata/netboot-proxy-network.conf
>  delete mode 100644 tests/networkxml2argvdata/routed-network.argv
>  create mode 100644 tests/networkxml2argvdata/routed-network.conf


Oops. *This* is the patch where I moved networkxml2argv* to
networkxml2conf* :-)

Anyway, there's a lot of change in this patch, but it's almost all very
mechanical, and running make check verifies that the changes to the test
data is correct.

ACK. Now that the prerequisites are all pushed, I pushed this too.




More information about the libvir-list mailing list