Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1b051d86
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看板
提交
1b051d86
编写于
12月 20, 2011
作者:
H
Hu Tao
提交者:
Eric Blake
12月 20, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add virDomain{G, S}etNumaParameters support to the remote driver
上级
c57ca570
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
160 addition
and
1 deletion
+160
-1
daemon/remote.c
daemon/remote.c
+65
-0
src/remote/remote_driver.c
src/remote/remote_driver.c
+50
-0
src/remote/remote_protocol.x
src/remote/remote_protocol.x
+23
-1
src/remote_protocol-structs
src/remote_protocol-structs
+22
-0
未找到文件。
daemon/remote.c
浏览文件 @
1b051d86
...
...
@@ -1626,6 +1626,71 @@ cleanup:
return
rv
;
}
static
int
remoteDispatchDomainGetNumaParameters
(
virNetServerPtr
server
ATTRIBUTE_UNUSED
,
virNetServerClientPtr
client
ATTRIBUTE_UNUSED
,
virNetMessagePtr
msg
ATTRIBUTE_UNUSED
,
virNetMessageErrorPtr
rerr
,
remote_domain_get_numa_parameters_args
*
args
,
remote_domain_get_numa_parameters_ret
*
ret
)
{
virDomainPtr
dom
=
NULL
;
virTypedParameterPtr
params
=
NULL
;
int
nparams
=
args
->
nparams
;
unsigned
int
flags
;
int
rv
=
-
1
;
struct
daemonClientPrivate
*
priv
=
virNetServerClientGetPrivateData
(
client
);
if
(
!
priv
->
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
flags
=
args
->
flags
;
if
(
nparams
>
REMOTE_DOMAIN_NUMA_PARAMETERS_MAX
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"nparams too large"
));
goto
cleanup
;
}
if
(
VIR_ALLOC_N
(
params
,
nparams
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
if
(
!
(
dom
=
get_nonnull_domain
(
priv
->
conn
,
args
->
dom
)))
goto
cleanup
;
if
(
virDomainGetNumaParameters
(
dom
,
params
,
&
nparams
,
flags
)
<
0
)
goto
cleanup
;
/* In this case, we need to send back the number of parameters
* supported
*/
if
(
args
->
nparams
==
0
)
{
ret
->
nparams
=
nparams
;
goto
success
;
}
if
(
remoteSerializeTypedParameters
(
params
,
nparams
,
&
ret
->
params
.
params_val
,
&
ret
->
params
.
params_len
,
flags
)
<
0
)
goto
cleanup
;
success:
rv
=
0
;
cleanup:
if
(
rv
<
0
)
virNetMessageSaveError
(
rerr
);
virTypedParameterArrayClear
(
params
,
nparams
);
VIR_FREE
(
params
);
if
(
dom
)
virDomainFree
(
dom
);
return
rv
;
}
static
int
remoteDispatchDomainGetBlkioParameters
(
virNetServerPtr
server
ATTRIBUTE_UNUSED
,
virNetServerClientPtr
client
ATTRIBUTE_UNUSED
,
...
...
src/remote/remote_driver.c
浏览文件 @
1b051d86
...
...
@@ -1537,6 +1537,54 @@ done:
return
rv
;
}
static
int
remoteDomainGetNumaParameters
(
virDomainPtr
domain
,
virTypedParameterPtr
params
,
int
*
nparams
,
unsigned
int
flags
)
{
int
rv
=
-
1
;
remote_domain_get_numa_parameters_args
args
;
remote_domain_get_numa_parameters_ret
ret
;
struct
private_data
*
priv
=
domain
->
conn
->
privateData
;
remoteDriverLock
(
priv
);
make_nonnull_domain
(
&
args
.
dom
,
domain
);
args
.
nparams
=
*
nparams
;
args
.
flags
=
flags
;
memset
(
&
ret
,
0
,
sizeof
ret
);
if
(
call
(
domain
->
conn
,
priv
,
0
,
REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS
,
(
xdrproc_t
)
xdr_remote_domain_get_numa_parameters_args
,
(
char
*
)
&
args
,
(
xdrproc_t
)
xdr_remote_domain_get_numa_parameters_ret
,
(
char
*
)
&
ret
)
==
-
1
)
goto
done
;
/* Handle the case when the caller does not know the number of parameters
* and is asking for the number of parameters supported
*/
if
(
*
nparams
==
0
)
{
*
nparams
=
ret
.
nparams
;
rv
=
0
;
goto
cleanup
;
}
if
(
remoteDeserializeTypedParameters
(
ret
.
params
.
params_val
,
ret
.
params
.
params_len
,
REMOTE_DOMAIN_NUMA_PARAMETERS_MAX
,
params
,
nparams
)
<
0
)
goto
cleanup
;
rv
=
0
;
cleanup:
xdr_free
((
xdrproc_t
)
xdr_remote_domain_get_numa_parameters_ret
,
(
char
*
)
&
ret
);
done:
remoteDriverUnlock
(
priv
);
return
rv
;
}
static
int
remoteDomainGetBlkioParameters
(
virDomainPtr
domain
,
virTypedParameterPtr
params
,
int
*
nparams
,
...
...
@@ -4637,6 +4685,8 @@ static virDriver remote_driver = {
.
nodeSuspendForDuration
=
remoteNodeSuspendForDuration
,
/* 0.9.8 */
.
domainSetBlockIoTune
=
remoteDomainSetBlockIoTune
,
/* 0.9.8 */
.
domainGetBlockIoTune
=
remoteDomainGetBlockIoTune
,
/* 0.9.8 */
.
domainSetNumaParameters
=
remoteDomainSetNumaParameters
,
/* 0.9.9 */
.
domainGetNumaParameters
=
remoteDomainGetNumaParameters
,
/* 0.9.9 */
};
static
virNetworkDriver
network_driver
=
{
...
...
src/remote/remote_protocol.x
浏览文件 @
1b051d86
...
...
@@ -128,6 +128,9 @@ const REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX = 16;
/* Upper limit on list of blockio tuning parameters. */
const
REMOTE_DOMAIN_BLOCK_IO_TUNE_PARAMETERS_MAX
=
16
;
/* Upper limit on list of numa parameters. */
const
REMOTE_DOMAIN_NUMA_PARAMETERS_MAX
=
16
;
/* Upper limit on list of node cpu stats. */
const
REMOTE_NODE_CPU_STATS_MAX
=
16
;
...
...
@@ -547,6 +550,23 @@ struct remote_domain_block_resize_args {
unsigned
int
flags
;
};
struct
remote_domain_set_numa_parameters_args
{
remote_nonnull_domain
dom
;
remote_typed_param
params
<
REMOTE_DOMAIN_NUMA_PARAMETERS_MAX
>
;
unsigned
int
flags
;
};
struct
remote_domain_get_numa_parameters_args
{
remote_nonnull_domain
dom
;
int
nparams
;
unsigned
int
flags
;
};
struct
remote_domain_get_numa_parameters_ret
{
remote_typed_param
params
<
REMOTE_DOMAIN_NUMA_PARAMETERS_MAX
>
;
int
nparams
;
};
struct
remote_domain_block_stats_args
{
remote_nonnull_domain
dom
;
remote_nonnull_string
path
;
...
...
@@ -2605,7 +2625,9 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_BLOCK_RESIZE
=
251
,
/* autogen autogen */
REMOTE_PROC_DOMAIN_SET_BLOCK_IO_TUNE
=
252
,
/* autogen autogen */
REMOTE_PROC_DOMAIN_GET_BLOCK_IO_TUNE
=
253
/* skipgen skipgen */
REMOTE_PROC_DOMAIN_GET_BLOCK_IO_TUNE
=
253
,
/* skipgen skipgen */
REMOTE_PROC_DOMAIN_SET_NUMA_PARAMETERS
=
254
,
/* autogen autogen */
REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS
=
255
/* skipgen skipgen */
/*
* Notice how the entries are grouped in sets of 10 ?
...
...
src/remote_protocol-structs
浏览文件 @
1b051d86
...
...
@@ -270,6 +270,26 @@ struct remote_domain_block_resize_args {
uint64_t
size
;
u_int
flags
;
};
struct
remote_domain_set_numa_parameters_args
{
remote_nonnull_domain
dom
;
struct
{
u_int
params_len
;
remote_typed_param
*
params_val
;
}
params
;
u_int
flags
;
};
struct
remote_domain_get_numa_parameters_args
{
remote_nonnull_domain
dom
;
int
nparams
;
u_int
flags
;
};
struct
remote_domain_get_numa_parameters_ret
{
struct
{
u_int
params_len
;
remote_typed_param
*
params_val
;
}
params
;
int
nparams
;
};
struct
remote_domain_block_stats_args
{
remote_nonnull_domain
dom
;
remote_nonnull_string
path
;
...
...
@@ -2044,4 +2064,6 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_BLOCK_RESIZE
=
251
,
REMOTE_PROC_DOMAIN_SET_BLOCK_IO_TUNE
=
252
,
REMOTE_PROC_DOMAIN_GET_BLOCK_IO_TUNE
=
253
,
REMOTE_PROC_DOMAIN_SET_NUMA_PARAMETERS
=
254
,
REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS
=
255
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录