mirror of https://gitee.com/openkylin/libvirt.git
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.
This commit is contained in:
parent
45147ca37f
commit
474b1c1487
|
@ -1,9 +1,10 @@
|
||||||
#
|
#
|
||||||
|
# These symbols are dependent on WITH_MACVTAP.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
# macvtap.h
|
# macvtap.h
|
||||||
delMacvtap;
|
delMacvtap;
|
||||||
openMacvtapTap;
|
openMacvtapTap;
|
||||||
virVMOperationTypeFromString;
|
|
||||||
virVMOperationTypeToString;
|
|
||||||
vpAssociatePortProfileId;
|
vpAssociatePortProfileId;
|
||||||
vpDisassociatePortProfileId;
|
vpDisassociatePortProfileId;
|
||||||
|
|
|
@ -504,6 +504,11 @@ virLogStartup;
|
||||||
virLogUnlock;
|
virLogUnlock;
|
||||||
|
|
||||||
|
|
||||||
|
# macvtap.h
|
||||||
|
virVMOperationTypeFromString;
|
||||||
|
virVMOperationTypeToString;
|
||||||
|
|
||||||
|
|
||||||
# memory.h
|
# memory.h
|
||||||
virAlloc;
|
virAlloc;
|
||||||
virAllocN;
|
virAllocN;
|
||||||
|
|
|
@ -11879,6 +11879,7 @@ cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WITH_MACVTAP
|
||||||
static void
|
static void
|
||||||
qemudVPAssociatePortProfiles(virDomainDefPtr def) {
|
qemudVPAssociatePortProfiles(virDomainDefPtr def) {
|
||||||
int i;
|
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. */
|
/* Finish is the third and final step, and it runs on the destination host. */
|
||||||
static virDomainPtr
|
static virDomainPtr
|
||||||
|
|
|
@ -57,11 +57,6 @@ struct _virVirtualPortProfileParams {
|
||||||
} u;
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# if defined(WITH_MACVTAP)
|
|
||||||
|
|
||||||
# include "internal.h"
|
|
||||||
|
|
||||||
enum virVMOperationType {
|
enum virVMOperationType {
|
||||||
VIR_VM_OP_CREATE,
|
VIR_VM_OP_CREATE,
|
||||||
VIR_VM_OP_SAVE,
|
VIR_VM_OP_SAVE,
|
||||||
|
@ -75,6 +70,10 @@ enum virVMOperationType {
|
||||||
VIR_VM_OP_LAST
|
VIR_VM_OP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if WITH_MACVTAP
|
||||||
|
|
||||||
|
# include "internal.h"
|
||||||
|
|
||||||
int openMacvtapTap(const char *ifname,
|
int openMacvtapTap(const char *ifname,
|
||||||
const unsigned char *macaddress,
|
const unsigned char *macaddress,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
|
@ -90,11 +89,9 @@ void delMacvtap(const char *ifname,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
virVirtualPortProfileParamsPtr virtPortProfile);
|
virVirtualPortProfileParamsPtr virtPortProfile);
|
||||||
|
|
||||||
# endif /* WITH_MACVTAP */
|
# define MACVTAP_MODE_PRIVATE_STR "private"
|
||||||
|
# define MACVTAP_MODE_VEPA_STR "vepa"
|
||||||
# define MACVTAP_MODE_PRIVATE_STR "private"
|
# define MACVTAP_MODE_BRIDGE_STR "bridge"
|
||||||
# define MACVTAP_MODE_VEPA_STR "vepa"
|
|
||||||
# define MACVTAP_MODE_BRIDGE_STR "bridge"
|
|
||||||
|
|
||||||
int vpAssociatePortProfileId(const char *macvtap_ifname,
|
int vpAssociatePortProfileId(const char *macvtap_ifname,
|
||||||
const unsigned char *macvtap_macaddr,
|
const unsigned char *macvtap_macaddr,
|
||||||
|
@ -109,6 +106,8 @@ int vpDisassociatePortProfileId(const char *macvtap_ifname,
|
||||||
const virVirtualPortProfileParamsPtr virtPort,
|
const virVirtualPortProfileParamsPtr virtPort,
|
||||||
enum virVMOperationType vmOp);
|
enum virVMOperationType vmOp);
|
||||||
|
|
||||||
|
# endif /* WITH_MACVTAP */
|
||||||
|
|
||||||
VIR_ENUM_DECL(virVirtualPort)
|
VIR_ENUM_DECL(virVirtualPort)
|
||||||
VIR_ENUM_DECL(virVMOperation)
|
VIR_ENUM_DECL(virVMOperation)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue