Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
de796a32
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de796a32
编写于
7月 06, 2011
作者:
L
Laine Stump
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
util: rename err_exit to cleanup in interface.c
This brings it in line with the recommendations in HACKING.
上级
107ee906
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
src/util/interface.c
src/util/interface.c
+18
-18
未找到文件。
src/util/interface.c
浏览文件 @
de796a32
...
@@ -156,7 +156,7 @@ static int chgIfaceFlags(const char *ifname, short flagclear, short flagset) {
...
@@ -156,7 +156,7 @@ static int chgIfaceFlags(const char *ifname, short flagclear, short flagset) {
rc
=
getFlags
(
fd
,
ifname
,
&
ifr
);
rc
=
getFlags
(
fd
,
ifname
,
&
ifr
);
if
(
rc
!=
0
)
if
(
rc
!=
0
)
goto
err_exit
;
goto
cleanup
;
flags
=
(
ifr
.
ifr_flags
&
flagmask
)
|
flagset
;
flags
=
(
ifr
.
ifr_flags
&
flagmask
)
|
flagset
;
...
@@ -167,7 +167,7 @@ static int chgIfaceFlags(const char *ifname, short flagclear, short flagset) {
...
@@ -167,7 +167,7 @@ static int chgIfaceFlags(const char *ifname, short flagclear, short flagset) {
rc
=
errno
;
rc
=
errno
;
}
}
err_exit
:
cleanup
:
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
return
rc
;
return
rc
;
}
}
...
@@ -241,7 +241,7 @@ ifaceCheck(bool reportError, const char *ifname,
...
@@ -241,7 +241,7 @@ ifaceCheck(bool reportError, const char *ifname,
_
(
"invalid interface name %s"
),
_
(
"invalid interface name %s"
),
ifname
);
ifname
);
rc
=
EINVAL
;
rc
=
EINVAL
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
ioctl
(
fd
,
SIOCGIFHWADDR
,
&
ifr
)
<
0
)
{
if
(
ioctl
(
fd
,
SIOCGIFHWADDR
,
&
ifr
)
<
0
)
{
...
@@ -250,12 +250,12 @@ ifaceCheck(bool reportError, const char *ifname,
...
@@ -250,12 +250,12 @@ ifaceCheck(bool reportError, const char *ifname,
_
(
"coud not get MAC address of interface %s"
),
_
(
"coud not get MAC address of interface %s"
),
ifname
);
ifname
);
rc
=
errno
;
rc
=
errno
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
memcmp
(
&
ifr
.
ifr_hwaddr
.
sa_data
,
macaddr
,
VIR_MAC_BUFLEN
)
!=
0
)
{
if
(
memcmp
(
&
ifr
.
ifr_hwaddr
.
sa_data
,
macaddr
,
VIR_MAC_BUFLEN
)
!=
0
)
{
rc
=
ENODEV
;
rc
=
ENODEV
;
goto
err_exit
;
goto
cleanup
;
}
}
}
}
...
@@ -265,7 +265,7 @@ ifaceCheck(bool reportError, const char *ifname,
...
@@ -265,7 +265,7 @@ ifaceCheck(bool reportError, const char *ifname,
rc
=
ENODEV
;
rc
=
ENODEV
;
}
}
err_exit
:
cleanup
:
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
return
rc
;
return
rc
;
...
@@ -318,7 +318,7 @@ ifaceGetIndex(bool reportError, const char *ifname, int *ifindex)
...
@@ -318,7 +318,7 @@ ifaceGetIndex(bool reportError, const char *ifname, int *ifindex)
_
(
"invalid interface name %s"
),
_
(
"invalid interface name %s"
),
ifname
);
ifname
);
rc
=
EINVAL
;
rc
=
EINVAL
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
ioctl
(
fd
,
SIOCGIFINDEX
,
&
ifreq
)
>=
0
)
if
(
ioctl
(
fd
,
SIOCGIFINDEX
,
&
ifreq
)
>=
0
)
...
@@ -331,7 +331,7 @@ ifaceGetIndex(bool reportError, const char *ifname, int *ifindex)
...
@@ -331,7 +331,7 @@ ifaceGetIndex(bool reportError, const char *ifname, int *ifindex)
rc
=
ENODEV
;
rc
=
ENODEV
;
}
}
err_exit
:
cleanup
:
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
return
rc
;
return
rc
;
...
@@ -368,17 +368,17 @@ ifaceGetVlanID(const char *vlanifname, int *vlanid) {
...
@@ -368,17 +368,17 @@ ifaceGetVlanID(const char *vlanifname, int *vlanid) {
if
(
virStrcpyStatic
(
vlanargs
.
device1
,
vlanifname
)
==
NULL
)
{
if
(
virStrcpyStatic
(
vlanargs
.
device1
,
vlanifname
)
==
NULL
)
{
rc
=
EINVAL
;
rc
=
EINVAL
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
ioctl
(
fd
,
SIOCGIFVLAN
,
&
vlanargs
)
!=
0
)
{
if
(
ioctl
(
fd
,
SIOCGIFVLAN
,
&
vlanargs
)
!=
0
)
{
rc
=
errno
;
rc
=
errno
;
goto
err_exit
;
goto
cleanup
;
}
}
*
vlanid
=
vlanargs
.
u
.
VID
;
*
vlanid
=
vlanargs
.
u
.
VID
;
err_exit
:
cleanup
:
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
return
rc
;
return
rc
;
...
@@ -576,7 +576,7 @@ ifaceMacvtapLinkAdd(const char *type,
...
@@ -576,7 +576,7 @@ ifaceMacvtapLinkAdd(const char *type,
if
(
nlComm
(
nl_msg
,
&
recvbuf
,
&
recvbuflen
,
0
)
<
0
)
{
if
(
nlComm
(
nl_msg
,
&
recvbuf
,
&
recvbuflen
,
0
)
<
0
)
{
rc
=
-
1
;
rc
=
-
1
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
recvbuf
==
NULL
)
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
recvbuf
==
NULL
)
...
@@ -615,7 +615,7 @@ ifaceMacvtapLinkAdd(const char *type,
...
@@ -615,7 +615,7 @@ ifaceMacvtapLinkAdd(const char *type,
goto
malformed_resp
;
goto
malformed_resp
;
}
}
err_exit
:
cleanup
:
nlmsg_free
(
nl_msg
);
nlmsg_free
(
nl_msg
);
VIR_FREE
(
recvbuf
);
VIR_FREE
(
recvbuf
);
...
@@ -700,7 +700,7 @@ ifaceLinkDel(const char *ifname)
...
@@ -700,7 +700,7 @@ ifaceLinkDel(const char *ifname)
if
(
nlComm
(
nl_msg
,
&
recvbuf
,
&
recvbuflen
,
0
)
<
0
)
{
if
(
nlComm
(
nl_msg
,
&
recvbuf
,
&
recvbuflen
,
0
)
<
0
)
{
rc
=
-
1
;
rc
=
-
1
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
recvbuf
==
NULL
)
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
recvbuf
==
NULL
)
...
@@ -729,7 +729,7 @@ ifaceLinkDel(const char *ifname)
...
@@ -729,7 +729,7 @@ ifaceLinkDel(const char *ifname)
goto
malformed_resp
;
goto
malformed_resp
;
}
}
err_exit
:
cleanup
:
nlmsg_free
(
nl_msg
);
nlmsg_free
(
nl_msg
);
VIR_FREE
(
recvbuf
);
VIR_FREE
(
recvbuf
);
...
@@ -832,13 +832,13 @@ ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int ifindex,
...
@@ -832,13 +832,13 @@ ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int ifindex,
pid
=
getPidFunc
();
pid
=
getPidFunc
();
if
(
pid
==
0
)
{
if
(
pid
==
0
)
{
rc
=
-
1
;
rc
=
-
1
;
goto
err_exit
;
goto
cleanup
;
}
}
}
}
if
(
nlComm
(
nl_msg
,
recvbuf
,
&
recvbuflen
,
pid
)
<
0
)
{
if
(
nlComm
(
nl_msg
,
recvbuf
,
&
recvbuflen
,
pid
)
<
0
)
{
rc
=
-
1
;
rc
=
-
1
;
goto
err_exit
;
goto
cleanup
;
}
}
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
*
recvbuf
==
NULL
)
if
(
recvbuflen
<
NLMSG_LENGTH
(
0
)
||
*
recvbuf
==
NULL
)
...
@@ -875,7 +875,7 @@ ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int ifindex,
...
@@ -875,7 +875,7 @@ ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int ifindex,
if
(
rc
!=
0
)
if
(
rc
!=
0
)
VIR_FREE
(
*
recvbuf
);
VIR_FREE
(
*
recvbuf
);
err_exit
:
cleanup
:
nlmsg_free
(
nl_msg
);
nlmsg_free
(
nl_msg
);
return
rc
;
return
rc
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录