提交 10462d5c 编写于 作者: D Daniel P. Berrange

Rename interface MAC address replacement APIs

Rename ifaceReplaceMacAddress to virNetDevReplaceMacAddress
and ifaceRestoreMacAddress to virNetDevRestoreMacAddress.

* util/interface.c, util/interface.h, util/virnetdevmacvlan.c:
  Rename APIs
上级 d2fed854
......@@ -586,8 +586,8 @@ ifaceIsVirtualFunction;
virNetDevMacVLanCreate;
virNetDevMacVLanDelete;
ifaceMacvtapLinkDump;
ifaceReplaceMacAddress;
ifaceRestoreMacAddress;
virNetDevReplaceMacAddress;
virNetDevRestoreMacAddress;
# interface_conf.h
......
......@@ -554,7 +554,7 @@ ifaceGetNthParent(int ifindex ATTRIBUTE_UNUSED,
#endif
/**
* ifaceReplaceMacAddress:
* virNetDevReplaceMacAddress:
* @macaddress: new MAC address for interface
* @linkdev: name of interface
* @stateDir: directory to store old MAC address
......@@ -563,9 +563,9 @@ ifaceGetNthParent(int ifindex ATTRIBUTE_UNUSED,
*
*/
int
ifaceReplaceMacAddress(const unsigned char *macaddress,
const char *linkdev,
const char *stateDir)
virNetDevReplaceMacAddress(const char *linkdev,
const unsigned char *macaddress,
const char *stateDir)
{
unsigned char oldmac[6];
char *path = NULL;
......@@ -595,7 +595,7 @@ ifaceReplaceMacAddress(const unsigned char *macaddress,
}
/**
* ifaceRestoreMacAddress:
* virNetDevRestoreMacAddress:
* @linkdev: name of interface
* @stateDir: directory containing old MAC address
*
......@@ -603,8 +603,8 @@ ifaceReplaceMacAddress(const unsigned char *macaddress,
*
*/
int
ifaceRestoreMacAddress(const char *linkdev,
const char *stateDir)
virNetDevRestoreMacAddress(const char *linkdev,
const char *stateDir)
{
int rc;
char *oldmacname = NULL;
......
......@@ -49,12 +49,15 @@ int ifaceGetNthParent(int ifindex, const char *ifname, unsigned int nthParent,
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(6);
int ifaceReplaceMacAddress(const unsigned char *macaddress,
const char *linkdev,
const char *stateDir);
int ifaceRestoreMacAddress(const char *linkdev,
const char *stateDir);
int virNetDevReplaceMacAddress(const char *linkdev,
const unsigned char *macaddress,
const char *stateDir)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK;
int virNetDevRestoreMacAddress(const char *linkdev,
const char *stateDir)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int ifaceIsVirtualFunction(const char *ifname);
......
......@@ -497,9 +497,8 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
* emulate their switch in firmware.
*/
if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) {
if (ifaceReplaceMacAddress(macaddress, linkdev, stateDir) < 0) {
if (virNetDevReplaceMacAddress(linkdev, macaddress, stateDir) < 0)
return -1;
}
}
if (tgifname) {
......@@ -604,7 +603,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
{
int ret = 0;
if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) {
ifaceRestoreMacAddress(linkdev, stateDir);
ignore_value(virNetDevRestoreMacAddress(linkdev, stateDir));
}
if (ifname) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册