Re: [PATCH] build: fix build --without-network

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

 



On 21.11.2012 15:28, Eric Blake wrote:
> On 11/21/2012 06:59 AM, Ján Tomko wrote:
>> 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)
> 
> I would write this as (iface = iface, 0) for consistent operator spacing
> with the rest of our code.
> 
>> +++ 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);
> 
> Is it any easier to do:
> 
> #ifdef WITH_NETWORK
> # define USE_NETWORK "network"
> #else
> # define USE_NETWORK NULL
> #endif
> 
> rather than repeated nested #ifdef?  But that's cosmetic, so I don't
> care if you don't change it.
> 
> ACK with the formatting nit fixed.
> 
> 
> 

Fixed and pushed.

Michal

I've squashed this in:

diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index 1c42d81..638a6ac 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) (iface=iface,0)
-#  define networkReleaseActualDevice(iface) (iface=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 0123c36..53a772e 100644
--- a/tests/virdrivermoduletest.c
+++ b/tests/virdrivermoduletest.c
@@ -65,7 +65,10 @@ mymain(void)
     virDriverModuleInitialize(abs_builddir "/../src/.libs");

 #ifdef WITH_NETWORK
+# define USE_NETWORK "network"
     TEST("network", NULL);
+#else
+# define USE_NETWORK NULL
 #endif
 #ifdef WITH_STORAGE
     TEST("storage", NULL);
@@ -83,18 +86,10 @@ mymain(void)
     TEST("interface", NULL);
 #endif
 #ifdef WITH_QEMU
-# ifdef WITH_NETWORK
-    TEST("qemu", "network");
-# else
-    TEST("qemu", NULL);
-# endif
+    TEST("qemu", USE_NETWORK);
 #endif
 #ifdef WITH_LXC
-# ifdef WITH_NETWORK
-    TEST("lxc", "network");
-# else
-    TEST("lxc", NULL);
-# endif
+    TEST("lxc", USE_NETWORK);
 #endif
 #ifdef WITH_UML
     TEST("uml", NULL);

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]