On 08/02/2012 04:11 AM, Daniel P. Berrange wrote:
On Wed, Aug 01, 2012 at 05:52:42PM -0600, Eric Blake wrote:
> The recent changes to test exported symbols flushed out the fact
> that we were unconditionally linking against symbols that were
> only conditionally compiled under HAVE_AVAHI.
>
> * src/Makefile.am (libvirt_net_rpc_server_la_SOURCES): Compile
> virnetservermdns unconditionally.
> * configure.ac (HAVE_AVAHI): Drop unused automake conditional.
> * src/rpc/virnetservermdns.c: Add fallbacks when Avahi is not
> present.
>
> ---
>
> Definitely more involved than splitting out a separate .syms file, so
> I'm not sure whether this approach is better than the v1 approach.
> But I did promise to propose this alternative, so here it is. I tested
> both with and without avahi development libraries present.
>
> configure.ac | 1 -
> src/Makefile.am | 8 +---
> src/rpc/virnetservermdns.c | 98 ++++++++++++++++++++++++++++++++++++++++++----
> 3 files changed, 91 insertions(+), 16 deletions(-)
Hmm, there should be a change to src/rpc/virnetserver.c to
remove the avahi conditionals there I think.
I will have to do that as a followup patch; this patch made creation of
a new object always fail, but the virnetserver code assumes that if the
object creation call exists, then it is usable. So it is not just a
trivial removal of #ifdef HAVE_AVAHI, but some actual changes to the
fallback code to be a useful no-op.
If everything
still operates when avahi is disabled, then I think I prefer
this patch, even though it is more complex, because it means
the HAVE_AVAHI conditionals don't spread across the source
tree to every user of this API.
ACK
I've gone ahead and pushed this, for build reasons, while working on the
followup.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org