Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 764245

Summary: app-emulation/libvirt-6.8.0-r2[virt-network] should depend on net-dns/dnsmasq[dhcp,ipv6,script]
Product: Gentoo Linux Reporter: Garry Filakhtov <filakhtov>
Component: Current packagesAssignee: Matthias Maier <tamiko>
Status: RESOLVED FIXED    
Severity: normal CC: ionen, virtualization
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Garry Filakhtov 2021-01-07 07:45:46 UTC
When virt-network flag is enabled for the app-emulation/libvirt package it requires net-dns/dnsmasq[script], which is not enough and is causing the following issue on libvirtd startup:

internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 1: dnsmasq: bad command line options: unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DNSSEC/DBus support)

building net-dns/dnsmasq with dhcp flag enabled fixes this startup problem:

Jan 07 07:39:05 localhost dnsmasq[1316]: started, version 2.82 cachesize 150
Jan 07 07:39:05 localhost dnsmasq[1316]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua no-TFTP no-conntrack ipset no-auth no-DNSSEC no-ID loop-detect no-inotify no-dumpfile
Jan 07 07:39:05 localhost dnsmasq-dhcp[1316]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Jan 07 07:39:05 localhost dnsmasq-dhcp[1316]: DHCP, sockets bound exclusively to interface virbr0
Jan 07 07:39:05 localhost dnsmasq[1316]: reading /etc/resolv.conf
Jan 07 07:39:05 localhost dnsmasq[1316]: using nameserver 127.0.0.53#53
Jan 07 07:39:05 localhost dnsmasq[1316]: read /etc/hosts - 2 addresses
Jan 07 07:39:05 localhost dnsmasq[1316]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Jan 07 07:39:05 localhost dnsmasq-dhcp[1316]: read /var/lib/libvirt/dnsmasq/default.hostsfile

However, given that libvirtd lists DHCP/TFTP/DNSSEC/DBus in the startup error, it might be necessary to enable more flags, i.e. tftp, dnssec and dbus. I haven't been able to confirm or deny if that's the case yet, but as I will provide more details (or probably create additional bug reports) if/when I have them.
Comment 1 Garry Filakhtov 2021-01-07 09:44:38 UTC
Okay, got some further insights. Upon creating a virtual network getting:

Jan 07 09:42:44 localhost dnsmasq[5673]: unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DNSSEC/DBus support) at line 15 of /var/lib/libvirt/dnsmasq/vmnet.conf
Jan 07 09:42:44 localhost dnsmasq[5673]: FAILED to start up
Jan 07 09:42:44 localhost libvirtd[1203]: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/vmnet.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 1: 
                                          dnsmasq: unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DNSSEC/DBus support) at line 15 of /var/lib/libvirt/dnsmasq/vmnet.conf

the vmnet.conf configuration file that's generated by the libvirtd is:

##WARNING:  THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
##OVERWRITTEN AND LOST.  Changes to this configuration should be made using:
##    virsh net-edit vmnet
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
port=0
pid-file=/run/libvirt/network/vmnet.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-option=3
no-resolv
ra-param=*,0,0
dhcp-range=192.168.255.2,192.168.255.254,255.255.255.0
dhcp-no-override
dhcp-authoritative
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/vmnet.hostsfile

and line 15 is about ra-param, which requires IPv6 to be enabled, so we need an ipv6 flag.
Comment 2 Ionen Wolkens gentoo-dev 2021-01-07 15:35:05 UTC
Is it now [ipv6,script] rather than [ipv6,dhcp,script]? Feel free to edit the summary yourself (haven't tested myself).
Comment 3 Garry Filakhtov 2021-01-07 22:13:41 UTC
Sorry, could have been clearer! We need all: script, dhcp and ipv6. Possibly others, but I haven't yet being able to verify that.

net-dns/dnsmasq[ipv6,dhcp,script] was enough for now, but I will be testing other use cases as time permits and see if more is needed.
Comment 4 Larry the Git Cow gentoo-dev 2021-02-11 18:02:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=edef13bed4ae9e00ec30444896b18336a285a52a

commit edef13bed4ae9e00ec30444896b18336a285a52a
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2021-02-11 17:19:01 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2021-02-11 18:01:14 +0000

    app-emulation/libvirt: fix dependency on dnsmasq[dhcp,ipv6,script]
    
    Closes: https://bugs.gentoo.org/764245
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 app-emulation/libvirt/libvirt-7.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)