mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
virNetDevMacVLanCreateWithVPortProfile: Drop @ret
Usually, this variable is used to hold the return value for a function of ours. Well, this is not the case. Its use does not match our pattern and therefore it is very misleading. Drop it and define an alternative @rc variable, but only in that single block where it is needed. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
42712002fd
commit
9aea8cd4ae
@ -994,7 +994,6 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
|
|||||||
int retries, do_retry = 0;
|
int retries, do_retry = 0;
|
||||||
uint32_t macvtapMode;
|
uint32_t macvtapMode;
|
||||||
const char *ifnameCreated = NULL;
|
const char *ifnameCreated = NULL;
|
||||||
int ret;
|
|
||||||
int vf = -1;
|
int vf = -1;
|
||||||
bool vnet_hdr = flags & VIR_NETDEV_MACVLAN_VNET_HDR;
|
bool vnet_hdr = flags & VIR_NETDEV_MACVLAN_VNET_HDR;
|
||||||
|
|
||||||
@ -1028,6 +1027,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ifnameRequested) {
|
if (ifnameRequested) {
|
||||||
|
int rc;
|
||||||
bool isAutoName
|
bool isAutoName
|
||||||
= (STRPREFIX(ifnameRequested, MACVTAP_NAME_PREFIX) ||
|
= (STRPREFIX(ifnameRequested, MACVTAP_NAME_PREFIX) ||
|
||||||
STRPREFIX(ifnameRequested, MACVLAN_NAME_PREFIX));
|
STRPREFIX(ifnameRequested, MACVLAN_NAME_PREFIX));
|
||||||
@ -1035,11 +1035,11 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
|
|||||||
VIR_INFO("Requested macvtap device name: %s", ifnameRequested);
|
VIR_INFO("Requested macvtap device name: %s", ifnameRequested);
|
||||||
virMutexLock(&virNetDevMacVLanCreateMutex);
|
virMutexLock(&virNetDevMacVLanCreateMutex);
|
||||||
|
|
||||||
if ((ret = virNetDevExists(ifnameRequested)) < 0) {
|
if ((rc = virNetDevExists(ifnameRequested)) < 0) {
|
||||||
virMutexUnlock(&virNetDevMacVLanCreateMutex);
|
virMutexUnlock(&virNetDevMacVLanCreateMutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (rc) {
|
||||||
if (isAutoName)
|
if (isAutoName)
|
||||||
goto create_name;
|
goto create_name;
|
||||||
virReportSystemError(EEXIST,
|
virReportSystemError(EEXIST,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user