[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] 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.
---
 src/network/bridge_driver.h |    4 ++--
 tests/virdrivermoduletest.c |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index 0fae275..1c42d81 100644
--- a/src/network/bridge_driver.h
+++ b/src/network/bridge_driver.h
@@ -53,8 +53,8 @@ int networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network,
 # else
 /* Define no-op replacements that don't drag in any link dependencies.  */
 #  define networkAllocateActualDevice(iface) 0
-#  define networkNotifyActualDevice(iface) 0
-#  define networkReleaseActualDevice(iface) 0
+#  define networkNotifyActualDevice(iface) (iface=iface,0)
+#  define networkReleaseActualDevice(iface) (iface=iface,0)
 #  define networkGetNetworkAddress(netname, netaddr) (-2)
 #  define networkBuildDhcpDaemonCommandLine(network, cmdout, pidfile, dctx) 0
 # endif
diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c
index 9c14e79..0123c36 100644
--- a/tests/virdrivermoduletest.c
+++ b/tests/virdrivermoduletest.c
@@ -83,10 +83,18 @@ mymain(void)
     TEST("interface", NULL);
 #endif
 #ifdef WITH_QEMU
+# ifdef WITH_NETWORK
     TEST("qemu", "network");
+# else
+    TEST("qemu", NULL);
+# endif
 #endif
 #ifdef WITH_LXC
+# ifdef WITH_NETWORK
     TEST("lxc", "network");
+# else
+    TEST("lxc", NULL);
+# endif
 #endif
 #ifdef WITH_UML
     TEST("uml", NULL);
-- 
1.7.8.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]