]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix undefined symbol errors when macvtap support is disabled
authorMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 1 Dec 2010 14:43:40 +0000 (15:43 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 1 Dec 2010 16:08:08 +0000 (17:08 +0100)
Use macvtap specific functions depending on WITH_MACVTAP.

Use #if instead of #ifdef to check for WITH_MACVTAP, because
WITH_MACVTAP is always defined with value 0 or 1.

Also export virVMOperationType{To|From}String unconditional,
because they are used unconditional in the domain config code.

src/libvirt_macvtap.syms
src/libvirt_private.syms
src/qemu/qemu_driver.c
src/util/macvtap.h

index 107b7da05fb275c36a7f7d8a6d56f7483b673020..b48565b9cfb84671764cd525d3843a2671a31db6 100644 (file)
@@ -1,9 +1,10 @@
 #
+# These symbols are dependent on WITH_MACVTAP.
+#
+
 
 # macvtap.h
 delMacvtap;
 openMacvtapTap;
-virVMOperationTypeFromString;
-virVMOperationTypeToString;
 vpAssociatePortProfileId;
 vpDisassociatePortProfileId;
index 310d8f415e629b49e47d3cd7cc248dafb26cbe5b..3c1c823d44c59f0160f2d2b44748adb3af5303c7 100644 (file)
@@ -504,6 +504,11 @@ virLogStartup;
 virLogUnlock;
 
 
+# macvtap.h
+virVMOperationTypeFromString;
+virVMOperationTypeToString;
+
+
 # memory.h
 virAlloc;
 virAllocN;
index fcb90a36356cb459bdebe6af3e27f46ee78dde07..73b1e3ff8192b786ab55a17ef278e37efaf1d570 100644 (file)
@@ -11879,6 +11879,7 @@ cleanup:
     return ret;
 }
 
+#if WITH_MACVTAP
 static void
 qemudVPAssociatePortProfiles(virDomainDefPtr def) {
     int i;
@@ -11913,6 +11914,10 @@ err_exit:
         }
     }
 }
+#else /* !WITH_MACVTAP */
+static void
+qemudVPAssociatePortProfiles(virDomainDefPtr def ATTRIBUTE_UNUSED) { }
+#endif /* WITH_MACVTAP */
 
 /* Finish is the third and final step, and it runs on the destination host. */
 static virDomainPtr
index 389d1fd35efc94f01bb786e1625c2d6ca0a9fb9a..3ae2c24029e94e4c3b1e7a3cac30709099a43d6a 100644 (file)
@@ -57,11 +57,6 @@ struct _virVirtualPortProfileParams {
     } u;
 };
 
-
-# if defined(WITH_MACVTAP)
-
-#  include "internal.h"
-
 enum virVMOperationType {
     VIR_VM_OP_CREATE,
     VIR_VM_OP_SAVE,
@@ -75,6 +70,10 @@ enum virVMOperationType {
     VIR_VM_OP_LAST
 };
 
+# if WITH_MACVTAP
+
+#  include "internal.h"
+
 int openMacvtapTap(const char *ifname,
                    const unsigned char *macaddress,
                    const char *linkdev,
@@ -90,11 +89,9 @@ void delMacvtap(const char *ifname,
                 const char *linkdev,
                 virVirtualPortProfileParamsPtr virtPortProfile);
 
-# endif /* WITH_MACVTAP */
-
-# define MACVTAP_MODE_PRIVATE_STR  "private"
-# define MACVTAP_MODE_VEPA_STR     "vepa"
-# define MACVTAP_MODE_BRIDGE_STR   "bridge"
+#  define MACVTAP_MODE_PRIVATE_STR  "private"
+#  define MACVTAP_MODE_VEPA_STR     "vepa"
+#  define MACVTAP_MODE_BRIDGE_STR   "bridge"
 
 int vpAssociatePortProfileId(const char *macvtap_ifname,
                              const unsigned char *macvtap_macaddr,
@@ -109,6 +106,8 @@ int vpDisassociatePortProfileId(const char *macvtap_ifname,
                                 const virVirtualPortProfileParamsPtr virtPort,
                                 enum virVMOperationType vmOp);
 
+# endif /* WITH_MACVTAP */
+
 VIR_ENUM_DECL(virVirtualPort)
 VIR_ENUM_DECL(virVMOperation)