Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
8bd8bcac
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,发现更多精彩内容 >>
提交
8bd8bcac
编写于
4月 03, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netcf: Remove virConnectPtr from interfaceReportError
上级
7ece483d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
src/interface/netcf_driver.c
src/interface/netcf_driver.c
+18
-18
未找到文件。
src/interface/netcf_driver.c
浏览文件 @
8bd8bcac
...
...
@@ -33,8 +33,8 @@
#define VIR_FROM_THIS VIR_FROM_INTERFACE
#define interfaceReportError(co
nn, dom, net, code, ...)
\
virReportErrorHelper(
conn
, VIR_FROM_THIS, code, __FILE__, \
#define interfaceReportError(co
de, ...)
\
virReportErrorHelper(
NULL
, VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
/* Main driver state */
...
...
@@ -101,11 +101,11 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struct netcf *ncf, virInterfac
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
ncf
,
&
errmsg
,
&
details
);
if
(
errcode
!=
NETCF_NOERROR
)
{
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"couldn't find interface named '%s' (netcf: %s - %s)"
,
ifinfo
->
name
,
errmsg
,
details
?
details
:
""
);
}
else
{
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
VIR_ERR_NO_INTERFACE
,
interfaceReportError
(
VIR_ERR_NO_INTERFACE
,
"couldn't find interface named '%s'"
,
ifinfo
->
name
);
}
}
...
...
@@ -181,7 +181,7 @@ static int interfaceNumOfInterfaces(virConnectPtr conn)
if
(
count
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"%s (netcf: %s - %s)"
,
_
(
"failed to get number of interfaces on host"
),
errmsg
,
details
?
details
:
""
);
...
...
@@ -202,7 +202,7 @@ static int interfaceListInterfaces(virConnectPtr conn, char **const names, int n
if
(
count
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"%s (netcf: %s - %s)"
,
_
(
"failed to list host interfaces"
),
errmsg
,
details
?
details
:
""
);
...
...
@@ -223,7 +223,7 @@ static int interfaceNumOfDefinedInterfaces(virConnectPtr conn)
if
(
count
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"%s (netcf: %s - %s)"
,
_
(
"failed to get number of defined interfaces on host"
),
errmsg
,
details
?
details
:
""
);
...
...
@@ -244,7 +244,7 @@ static int interfaceListDefinedInterfaces(virConnectPtr conn, char **const names
if
(
count
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"%s (netcf: %s - %s)"
,
_
(
"failed to list host defined interfaces"
),
errmsg
,
details
?
details
:
""
);
...
...
@@ -268,11 +268,11 @@ static virInterfacePtr interfaceLookupByName(virConnectPtr conn,
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
if
(
errcode
!=
NETCF_NOERROR
)
{
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"couldn't find interface named '%s' (netcf: %s - %s)"
,
name
,
errmsg
,
details
?
details
:
""
);
}
else
{
interfaceReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_NO_INTERFACE
,
interfaceReportError
(
VIR_ERR_NO_INTERFACE
,
"couldn't find interface named '%s'"
,
name
);
}
goto
cleanup
;
...
...
@@ -300,19 +300,19 @@ static virInterfacePtr interfaceLookupByMACString(virConnectPtr conn,
if
(
niface
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"couldn't find interface with MAC address '%s' (netcf: %s - %s)"
,
macstr
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
}
if
(
niface
==
0
)
{
interfaceReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_NO_INTERFACE
,
interfaceReportError
(
VIR_ERR_NO_INTERFACE
,
"couldn't find interface with MAC address '%s'"
,
macstr
);
goto
cleanup
;
}
if
(
niface
>
1
)
{
interfaceReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_MULTIPLE_INTERFACES
,
interfaceReportError
(
VIR_ERR_MULTIPLE_INTERFACES
,
"%s"
,
_
(
"multiple interfaces with matching MAC address"
));
goto
cleanup
;
}
...
...
@@ -350,7 +350,7 @@ static char *interfaceGetXMLDesc(virInterfacePtr ifinfo,
if
(
!
xmlstr
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"could not get interface XML description (netcf: %s - %s)"
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
...
...
@@ -404,7 +404,7 @@ static virInterfacePtr interfaceDefineXML(virConnectPtr conn,
if
(
!
iface
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
conn
,
NULL
,
NULL
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"could not get interface XML description (netcf: %s - %s)"
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
...
...
@@ -437,7 +437,7 @@ static int interfaceUndefine(virInterfacePtr ifinfo) {
if
(
ret
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"failed to undefine interface %s (netcf: %s - %s)"
,
ifinfo
->
name
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
...
...
@@ -468,7 +468,7 @@ static int interfaceCreate(virInterfacePtr ifinfo,
if
(
ret
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"failed to create (start) interface %s (netcf: %s - %s)"
,
ifinfo
->
name
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
...
...
@@ -499,7 +499,7 @@ static int interfaceDestroy(virInterfacePtr ifinfo,
if
(
ret
<
0
)
{
const
char
*
errmsg
,
*
details
;
int
errcode
=
ncf_error
(
driver
->
netcf
,
&
errmsg
,
&
details
);
interfaceReportError
(
ifinfo
->
conn
,
NULL
,
ifinfo
,
netcf_to_vir_err
(
errcode
),
interfaceReportError
(
netcf_to_vir_err
(
errcode
),
"failed to destroy (stop) interface %s (netcf: %s - %s)"
,
ifinfo
->
name
,
errmsg
,
details
?
details
:
""
);
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录