[meta-virtualization] [PATCH 3/4] libvirt: change how we make updates to the dnsmasq configuration

Bruce Ashfield bruce.ashfield at gmail.com
Wed Nov 23 11:24:33 PST 2016


On Tue, Nov 22, 2016 at 1:56 PM, Mark Asselstine <
mark.asselstine at windriver.com> wrote:

> Our old approach of making the default configuration of dnsmasq use
> 'bind-dynamic' has some negative side effects. ie. by making this
> change when meta-virtualization is used but when libvirtd is not
> installed in the rootfs we prevent dnsmasq from binding to all
> interfaces (which is the expected/builtin default behavior of
> dnsmasq). The results can also be non-deterministic when multiple
> instances of dnsmasq are being run (which instance configured with
> bind-dynamic should attend to new network interfaces?)
>
> Additionally our approach modifies the default dnsmasq configuration
> file which ideally should have now changes, allowing dnsmasq to be
> configured using its builtin configuration values and also allowing
> for other instances of dnsmasq to better reuse the default
> configuration file.
>
> These changes allow for better coexistence of libvirt with packages
> like lxc which run their own instances of dnsmasq.
>
> Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
> ---
>  recipes-extended/libvirt/libvirt/dnsmasq.libvirt-daemon | 2 ++
>  recipes-extended/libvirt/libvirt_1.3.5.bb               | 6 ++++++
>  2 files changed, 8 insertions(+)
>  create mode 100644 recipes-extended/libvirt/
> libvirt/dnsmasq.libvirt-daemon
>
> diff --git a/recipes-extended/libvirt/libvirt/dnsmasq.libvirt-daemon
> b/recipes-extended/libvirt/libvirt/dnsmasq.libvirt-daemon
> new file mode 100644
> index 0000000..a7c3059
> --- /dev/null
> +++ b/recipes-extended/libvirt/libvirt/dnsmasq.libvirt-daemon
> @@ -0,0 +1,2 @@
> +bind-interfaces
> +except-interface=virbr0
> diff --git a/recipes-extended/libvirt/libvirt_1.3.5.bb
> b/recipes-extended/libvirt/libvirt_1.3.5.bb
> index c848c99..b8e8159 100644
> --- a/recipes-extended/libvirt/libvirt_1.3.5.bb
> +++ b/recipes-extended/libvirt/libvirt_1.3.5.bb
> @@ -37,6 +37,7 @@ SRC_URI = "http://libvirt.org/sources/
> libvirt-${PV}.tar.gz;name=libvirt \
>             file://0001-qemu-Let-empty-default-VNC-password-work-as-document.patch
> \
>             file://0001-ptest-add-missing-test_helper-files.patch \
>             file://0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch
> \
> +           file://dnsmasq.libvirt-daemon \
>            "
>
>  SRC_URI[libvirt.md5sum] = "f9dc1e63d559eca50ae0ee798a4c6c6d"
> @@ -112,6 +113,7 @@ FILES_${PN}-libvirtd = " \
>         ${sbindir}/libvirtd \
>         ${systemd_unitdir}/system/* \
>         ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '',
> '${libexecdir}/libvirt-guests.sh', d)} \
> +       ${sysconfdir}/dnsmasq.d/libvirt-daemon \
>

I'm not a packaging expert .. but should one package be installing config
files for another ?
Wouldn't this imply that libvirt really needs to be a distro feature, and
then we can make all
the behaviour changes trigger off a single variable ?

My point is .. from the libvirt package, I'm not aware of how dnsmasq sees
this file "libvirt-daemon".. what exactly does it do ? Does it match on the
executable
name ? Are all the files in dnsmasq.d always processed on startup of
dnsmasq ?
.. what if there are competing settings from other packages ?

Bruce


>          "
>
>  FILES_${PN}-virsh = "${bindir}/virsh"
> @@ -258,6 +260,10 @@ do_install_append() {
>         for i in `find ${D}${libdir} -type f -name *.la`; do
>             sed -i -e 's#-L${B}/src/.libs##g' $i
>         done
> +
> +       # ensure dnsmasq doesn't default to listenning on all interfaces
> +       install -d ${D}/${sysconfdir}/dnsmasq.d
> +       install -m 644 ${WORKDIR}/dnsmasq.libvirt-daemon
> ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon
>  }
>
>  EXTRA_OECONF += " \
> --
> 2.7.4
>
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-virtualization/attachments/20161123/1a89974f/attachment.html>


More information about the meta-virtualization mailing list