network: Register dnsmasq with resolved only when really requested

An incorrect check for domainRegister caused the DNS server for a
virtual domain to be registered with systemd-resolved even if
register='no' attribute was present. Only omitting the attribute
completely would disable the registration.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2024-05-09 16:16:57 +02:00
parent 632eb94e43
commit dda10ac8ac

View File

@ -2016,7 +2016,9 @@ networkStartNetworkVirtual(virNetworkDriverState *driver,
dnsmasqStarted = true;
if (def->domain && def->domainRegister && dnsServer) {
if (def->domain &&
def->domainRegister == VIR_TRISTATE_BOOL_YES &&
dnsServer) {
unsigned int link;
int rc;