Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
42af2443
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,发现更多精彩内容 >>
提交
42af2443
编写于
5月 17, 2011
作者:
H
Hu Tao
提交者:
Eric Blake
5月 17, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: add parameters --live, --config and --current to cmd schedinfo
This enables user to modify cpu.shares even when domain is inactive.
上级
bb9f1bbf
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
36 addition
and
5 deletion
+36
-5
tools/virsh.c
tools/virsh.c
+26
-2
tools/virsh.pod
tools/virsh.pod
+10
-3
未找到文件。
tools/virsh.c
浏览文件 @
42af2443
...
@@ -1596,6 +1596,9 @@ static const vshCmdOptDef opts_schedinfo[] = {
...
@@ -1596,6 +1596,9 @@ static const vshCmdOptDef opts_schedinfo[] = {
{
"set"
,
VSH_OT_STRING
,
VSH_OFLAG_NONE
,
N_
(
"parameter=value"
)},
{
"set"
,
VSH_OT_STRING
,
VSH_OFLAG_NONE
,
N_
(
"parameter=value"
)},
{
"weight"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
N_
(
"weight for XEN_CREDIT"
)},
{
"weight"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
N_
(
"weight for XEN_CREDIT"
)},
{
"cap"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
N_
(
"cap for XEN_CREDIT"
)},
{
"cap"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
N_
(
"cap for XEN_CREDIT"
)},
{
"current"
,
VSH_OT_BOOL
,
0
,
N_
(
"get/set current scheduler info"
)},
{
"config"
,
VSH_OT_BOOL
,
0
,
N_
(
"get/set value to be used on next boot"
)},
{
"live"
,
VSH_OT_BOOL
,
0
,
N_
(
"get/set value from running domain"
)},
{
NULL
,
0
,
0
,
NULL
}
{
NULL
,
0
,
0
,
NULL
}
};
};
...
@@ -1703,6 +1706,23 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -1703,6 +1706,23 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
int
update
=
0
;
int
update
=
0
;
int
i
,
ret
;
int
i
,
ret
;
bool
ret_val
=
false
;
bool
ret_val
=
false
;
unsigned
int
flags
=
0
;
int
current
=
vshCommandOptBool
(
cmd
,
"current"
);
int
config
=
vshCommandOptBool
(
cmd
,
"config"
);
int
live
=
vshCommandOptBool
(
cmd
,
"live"
);
if
(
current
)
{
if
(
live
||
config
)
{
vshError
(
ctl
,
"%s"
,
_
(
"--current must be specified exclusively"
));
return
false
;
}
flags
=
VIR_DOMAIN_SCHEDPARAM_CURRENT
;
}
else
{
if
(
config
)
flags
|=
VIR_DOMAIN_SCHEDPARAM_CONFIG
;
if
(
live
)
flags
|=
VIR_DOMAIN_SCHEDPARAM_LIVE
;
}
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
return
false
;
return
false
;
...
@@ -1712,7 +1732,7 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -1712,7 +1732,7 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
/* Print SchedulerType */
/* Print SchedulerType */
schedulertype
=
virDomainGetSchedulerType
(
dom
,
&
nparams
);
schedulertype
=
virDomainGetSchedulerType
(
dom
,
&
nparams
);
if
(
schedulertype
!=
NULL
){
if
(
schedulertype
!=
NULL
){
vshPrint
(
ctl
,
"%-15s: %s
\n
"
,
_
(
"Scheduler"
),
vshPrint
(
ctl
,
"%-15s: %s
\n
"
,
_
(
"Scheduler"
),
schedulertype
);
schedulertype
);
VIR_FREE
(
schedulertype
);
VIR_FREE
(
schedulertype
);
...
@@ -1741,6 +1761,10 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -1741,6 +1761,10 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
/* Update parameters & refresh data */
/* Update parameters & refresh data */
if
(
update
)
{
if
(
update
)
{
if
(
flags
||
current
)
ret
=
virDomainSetSchedulerParametersFlags
(
dom
,
params
,
nparams
,
flags
);
else
ret
=
virDomainSetSchedulerParameters
(
dom
,
params
,
nparams
);
ret
=
virDomainSetSchedulerParameters
(
dom
,
params
,
nparams
);
if
(
ret
==
-
1
)
if
(
ret
==
-
1
)
goto
cleanup
;
goto
cleanup
;
...
...
tools/virsh.pod
浏览文件 @
42af2443
...
@@ -570,11 +570,14 @@ This is roughly equivalent to doing a hibernate on a running computer,
...
@@ -570,11 +570,14 @@ This is roughly equivalent to doing a hibernate on a running computer,
with all the same limitations. Open network connections may be
with all the same limitations. Open network connections may be
severed upon restore, as TCP timeouts may have expired.
severed upon restore, as TCP timeouts may have expired.
=item B<schedinfo> optional I<--set> B<parameter=value> I<domain-id>
=item B<schedinfo> optional I<--set> B<parameter=value> I<domain-id> I<--config>
I<--live> I<--current>
=item B<schedinfo> optional I<--weight> B<number> optional I<--cap> B<number> I<domain-id>
=item B<schedinfo> optional I<--weight> B<number> optional I<--cap> B<number>
I<domain-id>
Allows you to show (and set) the domain scheduler parameters. The parameters available for each hypervisor are:
Allows you to show (and set) the domain scheduler parameters. The parameters
available for each hypervisor are:
LXC, QEMU/KVM (posix scheduler): cpu_shares
LXC, QEMU/KVM (posix scheduler): cpu_shares
...
@@ -582,6 +585,10 @@ Xen (credit scheduler): weight, cap
...
@@ -582,6 +585,10 @@ Xen (credit scheduler): weight, cap
ESX (allocation scheduler): reservation, limit, shares
ESX (allocation scheduler): reservation, limit, shares
If I<--live> is specified, set scheduler information of a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
If I<--current> is specified, affect the current guest state.
B<Note>: The cpu_shares parameter has a valid value range of 0-262144; Negative
B<Note>: The cpu_shares parameter has a valid value range of 0-262144; Negative
values are wrapped to positive, and larger values are capped at the maximum.
values are wrapped to positive, and larger values are capped at the maximum.
Therefore, -1 is a useful shorthand for 262144.
Therefore, -1 is a useful shorthand for 262144.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录