summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Bolte <matthias.bolte@googlemail.com>2010-12-01 15:43:40 +0100
committerDiego Elio Pettenò <flameeyes@gmail.com>2010-12-01 21:10:58 +0100
commit76808dda17ba9910b1b6679d47fc4273afbde10c (patch)
treea7591aaeebd8a80d36dab08c1d74c22ece84c96f
parentFix warning when macvtap support is disabled (diff)
downloadlibvirt-v0.8.6-gentoo.tar.gz
libvirt-v0.8.6-gentoo.tar.bz2
libvirt-v0.8.6-gentoo.zip
Fix undefined symbol errors when macvtap support is disabledv0.8.6-gentoo-1v0.8.6-gentoo
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.
-rw-r--r--src/libvirt_macvtap.syms5
-rw-r--r--src/libvirt_private.syms5
-rw-r--r--src/qemu/qemu_driver.c5
-rw-r--r--src/util/macvtap.h19
4 files changed, 22 insertions, 12 deletions
diff --git a/src/libvirt_macvtap.syms b/src/libvirt_macvtap.syms
index 107b7da05..b48565b9c 100644
--- a/src/libvirt_macvtap.syms
+++ b/src/libvirt_macvtap.syms
@@ -1,9 +1,10 @@
#
+# These symbols are dependent on WITH_MACVTAP.
+#
+
# macvtap.h
delMacvtap;
openMacvtapTap;
-virVMOperationTypeFromString;
-virVMOperationTypeToString;
vpAssociatePortProfileId;
vpDisassociatePortProfileId;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ef33f8626..1421b9996 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -503,6 +503,11 @@ virLogStartup;
virLogUnlock;
+# macvtap.h
+virVMOperationTypeFromString;
+virVMOperationTypeToString;
+
+
# memory.h
virAlloc;
virAllocN;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4877692e8..4ab9a8dd8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11869,6 +11869,7 @@ cleanup:
return ret;
}
+#if WITH_MACVTAP
static void
qemudVPAssociatePortProfiles(virDomainDefPtr def) {
int i;
@@ -11903,6 +11904,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
diff --git a/src/util/macvtap.h b/src/util/macvtap.h
index 389d1fd35..3ae2c2402 100644
--- a/src/util/macvtap.h
+++ b/src/util/macvtap.h
@@ -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)