forked from pool/libvirt
122 lines
3.4 KiB
Diff
122 lines
3.4 KiB
Diff
commit 474b1c1487828a17fe9e1025901334d9820ea350
|
|
Author: Matthias Bolte <matthias.bolte@googlemail.com>
|
|
Date: Wed Dec 1 15:43:40 2010 +0100
|
|
|
|
Fix undefined symbol errors when macvtap support is disabled
|
|
|
|
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.
|
|
|
|
Index: libvirt-0.8.6/src/libvirt_macvtap.syms
|
|
===================================================================
|
|
--- libvirt-0.8.6.orig/src/libvirt_macvtap.syms
|
|
+++ libvirt-0.8.6/src/libvirt_macvtap.syms
|
|
@@ -1,9 +1,10 @@
|
|
#
|
|
+# These symbols are dependent on WITH_MACVTAP.
|
|
+#
|
|
+
|
|
|
|
# macvtap.h
|
|
delMacvtap;
|
|
openMacvtapTap;
|
|
-virVMOperationTypeFromString;
|
|
-virVMOperationTypeToString;
|
|
vpAssociatePortProfileId;
|
|
vpDisassociatePortProfileId;
|
|
Index: libvirt-0.8.6/src/libvirt_private.syms
|
|
===================================================================
|
|
--- libvirt-0.8.6.orig/src/libvirt_private.syms
|
|
+++ libvirt-0.8.6/src/libvirt_private.syms
|
|
@@ -503,6 +503,11 @@ virLogStartup;
|
|
virLogUnlock;
|
|
|
|
|
|
+# macvtap.h
|
|
+virVMOperationTypeFromString;
|
|
+virVMOperationTypeToString;
|
|
+
|
|
+
|
|
# memory.h
|
|
virAlloc;
|
|
virAllocN;
|
|
Index: libvirt-0.8.6/src/qemu/qemu_driver.c
|
|
===================================================================
|
|
--- libvirt-0.8.6.orig/src/qemu/qemu_driver.c
|
|
+++ libvirt-0.8.6/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
|
|
Index: libvirt-0.8.6/src/util/macvtap.h
|
|
===================================================================
|
|
--- libvirt-0.8.6.orig/src/util/macvtap.h
|
|
+++ libvirt-0.8.6/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 ch
|
|
const virVirtualPortProfileParamsPtr virtPort,
|
|
enum virVMOperationType vmOp);
|
|
|
|
+# endif /* WITH_MACVTAP */
|
|
+
|
|
VIR_ENUM_DECL(virVirtualPort)
|
|
VIR_ENUM_DECL(virVMOperation)
|
|
|