mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
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
This commit is contained in:
parent
d2fed854c0
commit
10462d5c78
@ -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 virNetDevReplaceMacAddress(const char *linkdev,
|
||||
const unsigned char *macaddress,
|
||||
const char *stateDir)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
int ifaceRestoreMacAddress(const char *linkdev,
|
||||
const char *stateDir);
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user