Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ec4ef72c
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看板
提交
ec4ef72c
编写于
2月 17, 2016
作者:
N
Nikolay Shirokovskiy
提交者:
Daniel P. Berrange
3月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remote: factor out feature checks on connection open
Signed-off-by:
N
Nikolay Shirokovskiy
<
nshirokovskiy@virtuozzo.com
>
上级
88f09b75
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
27 deletion
+24
-27
src/remote/remote_driver.c
src/remote/remote_driver.c
+24
-27
未找到文件。
src/remote/remote_driver.c
浏览文件 @
ec4ef72c
...
...
@@ -540,6 +540,22 @@ remoteClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
reason
);
}
static
bool
remoteConnectSupportsFeatureUnlocked
(
virConnectPtr
conn
,
struct
private_data
*
priv
,
int
feature
)
{
remote_connect_supports_feature_args
args
=
{
feature
};
remote_connect_supports_feature_ret
ret
=
{
0
};
int
rc
;
rc
=
call
(
conn
,
priv
,
0
,
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_args
,
(
char
*
)
&
args
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_ret
,
(
char
*
)
&
ret
);
return
rc
!=
-
1
&&
ret
.
supported
;
}
/* helper macro to ease extraction of arguments from the URI */
#define EXTRACT_URI_ARG_STR(ARG_NAME, ARG_VAR) \
if (STRCASEEQ(var->name, ARG_NAME)) { \
...
...
@@ -1002,18 +1018,9 @@ doRemoteOpen(virConnectPtr conn,
goto
failed
;
if
(
virNetClientKeepAliveIsSupported
(
priv
->
client
))
{
remote_connect_supports_feature_args
args
=
{
VIR_DRV_FEATURE_PROGRAM_KEEPALIVE
};
remote_connect_supports_feature_ret
ret
=
{
0
};
int
rc
;
rc
=
call
(
conn
,
priv
,
0
,
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_args
,
(
char
*
)
&
args
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_ret
,
(
char
*
)
&
ret
);
if
(
rc
!=
-
1
&&
ret
.
supported
)
{
priv
->
serverKeepAlive
=
true
;
}
else
{
priv
->
serverKeepAlive
=
remoteConnectSupportsFeatureUnlocked
(
conn
,
priv
,
VIR_DRV_FEATURE_PROGRAM_KEEPALIVE
);
if
(
!
priv
->
serverKeepAlive
)
{
VIR_INFO
(
"Disabling keepalive protocol since it is not supported"
" by the server"
);
}
...
...
@@ -1052,22 +1059,12 @@ doRemoteOpen(virConnectPtr conn,
/* Set up events */
if
(
!
(
priv
->
eventState
=
virObjectEventStateNew
()))
goto
failed
;
{
remote_connect_supports_feature_args
args
=
{
VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK
};
remote_connect_supports_feature_ret
ret
=
{
0
};
int
rc
;
rc
=
call
(
conn
,
priv
,
0
,
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_args
,
(
char
*
)
&
args
,
(
xdrproc_t
)
xdr_remote_connect_supports_feature_ret
,
(
char
*
)
&
ret
);
if
(
rc
!=
-
1
&&
ret
.
supported
)
{
priv
->
serverEventFilter
=
true
;
}
else
{
VIR_INFO
(
"Avoiding server event filtering since it is not "
"supported by the server"
);
}
priv
->
serverEventFilter
=
remoteConnectSupportsFeatureUnlocked
(
conn
,
priv
,
VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK
);
if
(
!
priv
->
serverEventFilter
)
{
VIR_INFO
(
"Avoiding server event filtering since it is not "
"supported by the server"
);
}
/* Successful. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录