Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1870e707
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,发现更多精彩内容 >>
提交
1870e707
编写于
4月 03, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
phyp: Remove virConnectPtr from PHYP_ERROR
上级
ed510fce
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
14 deletion
+14
-14
src/phyp/phyp_driver.c
src/phyp/phyp_driver.c
+14
-14
未找到文件。
src/phyp/phyp_driver.c
浏览文件 @
1870e707
...
...
@@ -63,8 +63,8 @@
#define VIR_FROM_THIS VIR_FROM_PHYP
#define PHYP_ERROR(co
nn, code, ...)
\
virReportErrorHelper(
conn
, VIR_FROM_PHYP, code, __FILE__, __FUNCTION__, \
#define PHYP_ERROR(co
de, ...)
\
virReportErrorHelper(
NULL
, VIR_FROM_PHYP, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
/*
...
...
@@ -92,13 +92,13 @@ phypOpen(virConnectPtr conn,
return
VIR_DRV_OPEN_DECLINED
;
if
(
conn
->
uri
->
server
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Missing server name in phyp:// URI"
));
return
VIR_DRV_OPEN_ERROR
;
}
if
(
conn
->
uri
->
path
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Missing managed system name in phyp:// URI"
));
return
VIR_DRV_OPEN_ERROR
;
}
...
...
@@ -145,13 +145,13 @@ phypOpen(virConnectPtr conn,
*
char_ptr
=
'\0'
;
if
(
escape_specialcharacters
(
conn
->
uri
->
path
,
string
,
len
)
==
-
1
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Error parsing 'path'. Invalid characters."
));
goto
failure
;
}
if
((
session
=
openSSHSession
(
conn
,
auth
,
&
internal_socket
))
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Error while opening SSH session."
));
goto
failure
;
}
...
...
@@ -273,7 +273,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
}
}
else
{
if
(
auth
==
NULL
||
auth
->
cb
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_AUTH_FAILED
,
PHYP_ERROR
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"No authentication callback provided."
));
goto
err
;
}
...
...
@@ -281,7 +281,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
username
=
virRequestUsername
(
auth
,
NULL
,
conn
->
uri
->
server
);
if
(
username
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_AUTH_FAILED
,
"Username request failed"
);
PHYP_ERROR
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"Username request failed"
)
);
goto
err
;
}
}
...
...
@@ -293,7 +293,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
ret
=
getaddrinfo
(
hostname
,
"22"
,
&
hints
,
&
ai
);
if
(
ret
!=
0
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Error while getting %s address info"
),
hostname
);
goto
err
;
}
...
...
@@ -310,7 +310,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
cur
=
cur
->
ai_next
;
}
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Failed to connect to %s"
),
hostname
);
freeaddrinfo
(
ai
);
goto
err
;
...
...
@@ -330,7 +330,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
while
((
rc
=
libssh2_session_startup
(
session
,
sock
))
==
LIBSSH2_ERROR_EAGAIN
)
;
if
(
rc
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
PHYP_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Failure establishing SSH session."
));
goto
disconnect
;
}
...
...
@@ -353,7 +353,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
||
rc
==
LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
||
rc
==
LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED
)
{
if
(
auth
==
NULL
||
auth
->
cb
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_AUTH_FAILED
,
PHYP_ERROR
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"No authentication callback provided."
));
goto
disconnect
;
}
...
...
@@ -361,7 +361,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
password
=
virRequestPassword
(
auth
,
username
,
conn
->
uri
->
server
);
if
(
password
==
NULL
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_AUTH_FAILED
,
"Password request failed"
);
PHYP_ERROR
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"Password request failed"
)
);
goto
disconnect
;
}
...
...
@@ -371,7 +371,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
LIBSSH2_ERROR_EAGAIN
)
;
if
(
rc
)
{
PHYP_ERROR
(
conn
,
VIR_ERR_AUTH_FAILED
,
PHYP_ERROR
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"Authentication failed"
));
goto
disconnect
;
}
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录