build: fix build --without-network

bridge_driver.h: silence gcc warnings:
statement with no effect [-Wunused-value]
unused variable 'net' [-Wunused-variable]

virdrivermoduletest.c: don't require network driver module
if it hasn't been built.
This commit is contained in:
Ján Tomko 2012-11-21 14:59:47 +01:00 committed by Michal Privoznik
parent a703566201
commit 5efacd7813
2 changed files with 7 additions and 4 deletions

View File

@ -53,8 +53,8 @@ int networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network,
# else # else
/* Define no-op replacements that don't drag in any link dependencies. */ /* Define no-op replacements that don't drag in any link dependencies. */
# define networkAllocateActualDevice(iface) 0 # define networkAllocateActualDevice(iface) 0
# define networkNotifyActualDevice(iface) 0 # define networkNotifyActualDevice(iface) (iface=iface, 0)
# define networkReleaseActualDevice(iface) 0 # define networkReleaseActualDevice(iface) (iface=iface, 0)
# define networkGetNetworkAddress(netname, netaddr) (-2) # define networkGetNetworkAddress(netname, netaddr) (-2)
# define networkBuildDhcpDaemonCommandLine(network, cmdout, pidfile, dctx) 0 # define networkBuildDhcpDaemonCommandLine(network, cmdout, pidfile, dctx) 0
# endif # endif

View File

@ -65,7 +65,10 @@ mymain(void)
virDriverModuleInitialize(abs_builddir "/../src/.libs"); virDriverModuleInitialize(abs_builddir "/../src/.libs");
#ifdef WITH_NETWORK #ifdef WITH_NETWORK
# define USE_NETWORK "network"
TEST("network", NULL); TEST("network", NULL);
#else
# define USE_NETWORK NULL
#endif #endif
#ifdef WITH_STORAGE #ifdef WITH_STORAGE
TEST("storage", NULL); TEST("storage", NULL);
@ -83,10 +86,10 @@ mymain(void)
TEST("interface", NULL); TEST("interface", NULL);
#endif #endif
#ifdef WITH_QEMU #ifdef WITH_QEMU
TEST("qemu", "network"); TEST("qemu", USE_NETWORK);
#endif #endif
#ifdef WITH_LXC #ifdef WITH_LXC
TEST("lxc", "network"); TEST("lxc", USE_NETWORK);
#endif #endif
#ifdef WITH_UML #ifdef WITH_UML
TEST("uml", NULL); TEST("uml", NULL);