[libvirt] Bug - libvirt persists on having dnsmasq

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4. There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one: ~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~ shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail. And this of course breaks things later on: ~~~ SNIP ~~~ virsh # net-start virtnet01 error: Failed to start network virtnet01 error: Cannot find 'dnsmasq' in path: No such file or directory ~~~ SNIP ~~~ and there is no DHCP defined for 'virtnet01' thus there is no reason to bring dnsmasq in. Neither can be new network created and started via virt-manager. Thanks, Zdenek - -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5H2OwACgkQ8MreUbSH7ingtgCePYxU4zroZQo+3xrSxT7/hekN Qc8An3U/nDY/C8Z0oLQ76Za1SrR++0ON =TkKh -----END PGP SIGNATURE-----

On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
And this of course breaks things later on:
~~~ SNIP ~~~ virsh # net-start virtnet01 error: Failed to start network virtnet01 error: Cannot find 'dnsmasq' in path: No such file or directory ~~~ SNIP ~~~
and there is no DHCP defined for 'virtnet01' thus there is no reason to bring dnsmasq in. Neither can be new network created and started via virt-manager.
Thanks, Zdenek
Yet strange enough, 'default' virtual network gets started without any problems. I've tried unsuccessfully hack around this "problem". The far I got was: "error: Cannot find '' in path: No such file or directory". Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net

On 08/14/11 16:49, Zdenek Styblik wrote:
On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
And this of course breaks things later on:
~~~ SNIP ~~~ virsh # net-start virtnet01 error: Failed to start network virtnet01 error: Cannot find 'dnsmasq' in path: No such file or directory ~~~ SNIP ~~~
and there is no DHCP defined for 'virtnet01' thus there is no reason to bring dnsmasq in. Neither can be new network created and started via virt-manager.
Thanks, Zdenek
Yet strange enough, 'default' virtual network gets started without any problems.
I've tried unsuccessfully hack around this "problem". The far I got was: "error: Cannot find '' in path: No such file or directory".
Z.
Also, dnsmasq not required for NAT-ed networks. And libvirt-0.9.3 doesn't have this dependency resp. works as I've written above - no dnsmasq during compilation, no dnsmasq dependency later. May be some of the patches in Changelog introduced this kind of dependency? I've seen patches regarding return-codes from dnsmasq. Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net

On 08/14/2011 10:49 AM, Zdenek Styblik wrote:
On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail. But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile. dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.

On Tue, Aug 16, 2011 at 09:15:12AM -0400, Laine Stump wrote:
On 08/14/2011 10:49 AM, Zdenek Styblik wrote:
On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/16/11 17:38, Daniel P. Berrange wrote:
On Tue, Aug 16, 2011 at 09:15:12AM -0400, Laine Stump wrote:
On 08/14/2011 10:49 AM, Zdenek Styblik wrote:
On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO
Daniel
I'm sorry, but what? I did not understand single word, and I mean it - no irony, no pun. In other words and what I took from the reply, you mean to tell me from libvirt-0.9.4 and on one is forced to have dnsmasq around resp. to use libvirt? Thanks, Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net

On 08/16/11 18:07, Zdenek Styblik wrote: [...]
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO
Daniel
I'm sorry, but what? I did not understand single word, and I mean it - no irony, no pun.
In other words and what I took from the reply, you mean to tell me from libvirt-0.9.4 and on one is forced to have dnsmasq around resp. to use libvirt?
Thanks, Z.
So, let me just repeat whole thing again. Up until libvirt version 0.9.3, libvirt was able to auto-magically detect presence of dnsmasq. And in case dnsmasq was not found during ./configure; libvirt wouldn't try to use it. However, since libvirt version 0.9.4 resp. in libvirt version 0.9.4 this auto-magical detection does not work and libvirt persists on using dnsmasq which is not present. As far as any documentation goes, there is no mentioning of dnsmasq being mandatory(and I've actually mentioned this ~ one year and three months ago). Quite contrary, I would say, as http://libvirt.org/firewall.html says: --- Libvirt will *optionally* also provide DHCP services to the virtual network using DNSMASQ. --- What would be really sufficient for me as reply: "Sadly, dnsmasq is mandatory now. And you will have to deal with it." and I will deal with it. I won't use libvirt anymore, because it makes no sense to use dnsmasq. I don't know what to make from your replies as it seems like you don't want to get blame for this one nor there seems to be will not to make libvirt dnsmasq independent. I blame nobody. I want to know, I want to fix it one way or another, and move on. Best regards, Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net

2011/8/16 Zdenek Styblik <stybla@turnovfree.net>:
On 08/16/11 18:07, Zdenek Styblik wrote: [...]
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO
Daniel
I'm sorry, but what? I did not understand single word, and I mean it - no irony, no pun.
In other words and what I took from the reply, you mean to tell me from libvirt-0.9.4 and on one is forced to have dnsmasq around resp. to use libvirt?
Thanks, Z.
So, let me just repeat whole thing again.
Up until libvirt version 0.9.3, libvirt was able to auto-magically detect presence of dnsmasq. And in case dnsmasq was not found during ./configure; libvirt wouldn't try to use it.
Actually I think that's not true. I think the code just accidentally ignored it when dnsmasq could not be started. This commit (part of libvirt 0.9.4) http://libvirt.org/git/?p=libvirt.git;a=commit;h=85a954cebbbb3ae6210a779a5f3... fixed this. I didn't test it but this seems to be the cause for the problem you're describing.
However, since libvirt version 0.9.4 resp. in libvirt version 0.9.4 this auto-magical detection does not work and libvirt persists on using dnsmasq which is not present.
True, because a bug was fixed. It may look to you as there was a feature that's broken now, but that's not the case, I think. The code is expecting dnsmasq to be available when a virtual network is used. A simple solution for you might be to revert commit 85a954cebbbb3ae6210a779a5f3b29559ec5f862 and go back to exploiting the bug, that made it work for you as you expect it.
I don't know what to make from your replies as it seems like you don't want to get blame for this one nor there seems to be will not to make libvirt dnsmasq independent.
I don't think that this is the case here. I think Dan and Laine weren't aware that there was a bug fixed in libvirt 0.9.4 that gave you the impression that dnsmasq was optional.
I blame nobody. I want to know, I want to fix it one way or another, and move on.
One could argue that the virtual network code could be more fine grained and only start dnsmasq when it's really necessary, as this is what you expect from it. Currently it tries to start dnsmasq when the network contains an <ip> element. See http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/network/bridge_driver.c#l... You might suggest that it only should start/require dnsmasq when there is a <dhcp> element or something DNS related that really makes dnsmasq necessary. -- Matthias Bolte http://photron.blogspot.com

On 08/16/11 20:00, Matthias Bolte wrote:
2011/8/16 Zdenek Styblik <stybla@turnovfree.net>:
On 08/16/11 18:07, Zdenek Styblik wrote: [...]
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO
Daniel
I'm sorry, but what? I did not understand single word, and I mean it - no irony, no pun.
In other words and what I took from the reply, you mean to tell me from libvirt-0.9.4 and on one is forced to have dnsmasq around resp. to use libvirt?
Thanks, Z.
So, let me just repeat whole thing again.
Up until libvirt version 0.9.3, libvirt was able to auto-magically detect presence of dnsmasq. And in case dnsmasq was not found during ./configure; libvirt wouldn't try to use it.
Actually I think that's not true. I think the code just accidentally ignored it when dnsmasq could not be started. This commit (part of libvirt 0.9.4)
http://libvirt.org/git/?p=libvirt.git;a=commit;h=85a954cebbbb3ae6210a779a5f3...
fixed this. I didn't test it but this seems to be the cause for the problem you're describing.
However, since libvirt version 0.9.4 resp. in libvirt version 0.9.4 this auto-magical detection does not work and libvirt persists on using dnsmasq which is not present.
True, because a bug was fixed. It may look to you as there was a feature that's broken now, but that's not the case, I think. The code is expecting dnsmasq to be available when a virtual network is used.
A simple solution for you might be to revert commit 85a954cebbbb3ae6210a779a5f3b29559ec5f862 and go back to exploiting the bug, that made it work for you as you expect it.
I don't know what to make from your replies as it seems like you don't want to get blame for this one nor there seems to be will not to make libvirt dnsmasq independent.
I don't think that this is the case here. I think Dan and Laine weren't aware that there was a bug fixed in libvirt 0.9.4 that gave you the impression that dnsmasq was optional.
I blame nobody. I want to know, I want to fix it one way or another, and move on.
One could argue that the virtual network code could be more fine grained and only start dnsmasq when it's really necessary, as this is what you expect from it. Currently it tries to start dnsmasq when the network contains an <ip> element. See
http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/network/bridge_driver.c#l...
You might suggest that it only should start/require dnsmasq when there is a <dhcp> element or something DNS related that really makes dnsmasq necessary.
Matthias, thank you for exhaustive reply. I have nothing, but really nothing, to argue about. I mean, I agree 100% with everything you've written. I hope I was not being jerky beyond limits. Thanks again, Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net

On 08/16/2011 02:00 PM, Matthias Bolte wrote:
On 08/16/11 18:07, Zdenek Styblik wrote: [...]
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though. We already have an option to disable the virtual network driver. I don't think we want to have a separate option for dnsmasq, since that is an integral part of hte network driver IMHO
Daniel I'm sorry, but what? I did not understand single word, and I mean it - no irony, no pun.
In other words and what I took from the reply, you mean to tell me from libvirt-0.9.4 and on one is forced to have dnsmasq around resp. to use libvirt?
Thanks, Z.
So, let me just repeat whole thing again.
Up until libvirt version 0.9.3, libvirt was able to auto-magically detect presence of dnsmasq. And in case dnsmasq was not found during ./configure; libvirt wouldn't try to use it. Actually I think that's not true. I think the code just accidentally ignored it when dnsmasq could not be started. This commit (part of
2011/8/16 Zdenek Styblik<stybla@turnovfree.net>: libvirt 0.9.4)
http://libvirt.org/git/?p=libvirt.git;a=commit;h=85a954cebbbb3ae6210a779a5f3...
fixed this. I didn't test it but this seems to be the cause for the problem you're describing.
However, since libvirt version 0.9.4 resp. in libvirt version 0.9.4 this auto-magical detection does not work and libvirt persists on using dnsmasq which is not present. True, because a bug was fixed. It may look to you as there was a feature that's broken now, but that's not the case, I think. The code is expecting dnsmasq to be available when a virtual network is used.
A simple solution for you might be to revert commit 85a954cebbbb3ae6210a779a5f3b29559ec5f862 and go back to exploiting the bug, that made it work for you as you expect it.
I don't know what to make from your replies as it seems like you don't want to get blame for this one nor there seems to be will not to make libvirt dnsmasq independent. I don't think that this is the case here. I think Dan and Laine weren't aware that there was a bug fixed in libvirt 0.9.4 that gave you the impression that dnsmasq was optional.
Correct, since I always build on machines that have dnsmasq installed, and the specfile requires it, I was unaware that a build could be done without dnsmasq, and definitely would have considered it a bug if I'd known that was the case.
I blame nobody. I want to know, I want to fix it one way or another, and move on. One could argue that the virtual network code could be more fine grained and only start dnsmasq when it's really necessary, as this is what you expect from it. Currently it tries to start dnsmasq when the network contains an<ip> element. See
http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/network/bridge_driver.c#l...
You might suggest that it only should start/require dnsmasq when there is a<dhcp> element or something DNS related that really makes dnsmasq necessary.
I think this was discussed awhile back, and stated that we want a DNS server "whenever possible" even if DHCP isn't needed, which translates into "when an <ip> is defined for the network". If having dnsmasq installed is too heavyweight, you can always construct your own bridge outside of libvirt, and use type='bridge' for your interfaces rather than type='network'. (We might want to revisit all of this, since the virtual networks are now used for more than just the "linux bridge+dhcp+dns+iptables" setup.)

On 08/16/11 15:15, Laine Stump wrote:
On 08/14/2011 10:49 AM, Zdenek Styblik wrote:
On 08/14/11 16:17, Zdenek Styblik wrote:
Hi,
I've noticed libvirt is persisting to have dnsmasq present and use it. Version of libvirt in question is 0.9.4.
There is no dnsmasq present on the Host during libvirt compilation, yet it seems to me ./configure wrongfully finds one:
~~~ SNIP ~~~ configure:46087: checking for dnsmasq configure:46119: result: dnsmasq ~~~ SNIP ~~~
shouldn't there be "result: no"? As far as I remember - no dnsmasq present during compilation, no usage of it later. However I might have missed something - change in behavior, requirements etc. This is possible. Still, if required "component" is missing, I say compilation resp. configure should fail.
Well, libvirt.spec has had Require: dnsmasq for at least a couple years, so any install of a libvirt rpm should fail when dnsmasq isn't present. I don't know for certain how long the BuildRequires: dnsmasq has been there, but certainly for at least a year (the last time the line was modified), so any rpm builds should also fail.
But of course if you're running ./autogen.sh and then make, that doesn't involve the specfile.
dnsmasq really is an integral part of the network driver; I don't know that it makes any sense to "fix" things so it can be built without dnsmasq. It's probably a good idea to make the failure complete though.
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
I've been clear on what I'm doing. I'm compiling libvirt as ever before. And until libvirt-0.9.3 dnsmasq was not mandatory. I'm running libvirt-0.9.3 *without* dnsmasq right now and just fine. Z. -- Zdenek Styblik email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net
participants (4)
-
Daniel P. Berrange
-
Laine Stump
-
Matthias Bolte
-
Zdenek Styblik