Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1bb414af
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,发现更多精彩内容 >>
提交
1bb414af
编写于
6月 07, 2011
作者:
H
Hu Tao
提交者:
Wen Congyang
6月 20, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add new parameters for blkiotune
Add --config, --live and --current for command blkiotune
上级
34e3ec90
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
3 deletion
+30
-3
tools/virsh.c
tools/virsh.c
+23
-3
tools/virsh.pod
tools/virsh.pod
+7
-0
未找到文件。
tools/virsh.c
浏览文件 @
1bb414af
...
@@ -3424,6 +3424,9 @@ static const vshCmdOptDef opts_blkiotune[] = {
...
@@ -3424,6 +3424,9 @@ static const vshCmdOptDef opts_blkiotune[] = {
{
"domain"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"domain name, id or uuid"
)},
{
"domain"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"domain name, id or uuid"
)},
{
"weight"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
{
"weight"
,
VSH_OT_INT
,
VSH_OFLAG_NONE
,
N_
(
"IO Weight in range [100, 1000]"
)},
N_
(
"IO Weight in range [100, 1000]"
)},
{
"config"
,
VSH_OT_BOOL
,
0
,
N_
(
"affect next boot"
)},
{
"live"
,
VSH_OT_BOOL
,
0
,
N_
(
"affect running domain"
)},
{
"current"
,
VSH_OT_BOOL
,
0
,
N_
(
"affect current domain"
)},
{
NULL
,
0
,
0
,
NULL
}
{
NULL
,
0
,
0
,
NULL
}
};
};
...
@@ -3436,6 +3439,23 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
...
@@ -3436,6 +3439,23 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
virTypedParameterPtr
params
=
NULL
,
temp
=
NULL
;
virTypedParameterPtr
params
=
NULL
,
temp
=
NULL
;
bool
ret
=
false
;
bool
ret
=
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_AFFECT_CURRENT
;
}
else
{
if
(
config
)
flags
|=
VIR_DOMAIN_AFFECT_CONFIG
;
if
(
live
)
flags
|=
VIR_DOMAIN_AFFECT_LIVE
;
}
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
return
false
;
return
false
;
...
@@ -3460,7 +3480,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
...
@@ -3460,7 +3480,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
if
(
nparams
==
0
)
{
if
(
nparams
==
0
)
{
/* get the number of blkio parameters */
/* get the number of blkio parameters */
if
(
virDomainGetBlkioParameters
(
dom
,
NULL
,
&
nparams
,
0
)
!=
0
)
{
if
(
virDomainGetBlkioParameters
(
dom
,
NULL
,
&
nparams
,
flags
)
!=
0
)
{
vshError
(
ctl
,
"%s"
,
vshError
(
ctl
,
"%s"
,
_
(
"Unable to get number of blkio parameters"
));
_
(
"Unable to get number of blkio parameters"
));
goto
cleanup
;
goto
cleanup
;
...
@@ -3474,7 +3494,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
...
@@ -3474,7 +3494,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
/* now go get all the blkio parameters */
/* now go get all the blkio parameters */
params
=
vshCalloc
(
ctl
,
nparams
,
sizeof
(
*
params
));
params
=
vshCalloc
(
ctl
,
nparams
,
sizeof
(
*
params
));
if
(
virDomainGetBlkioParameters
(
dom
,
params
,
&
nparams
,
0
)
!=
0
)
{
if
(
virDomainGetBlkioParameters
(
dom
,
params
,
&
nparams
,
flags
)
!=
0
)
{
vshError
(
ctl
,
"%s"
,
_
(
"Unable to get blkio parameters"
));
vshError
(
ctl
,
"%s"
,
_
(
"Unable to get blkio parameters"
));
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -3526,7 +3546,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
...
@@ -3526,7 +3546,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
weight
=
0
;
weight
=
0
;
}
}
}
}
if
(
virDomainSetBlkioParameters
(
dom
,
params
,
nparams
,
0
)
!=
0
)
if
(
virDomainSetBlkioParameters
(
dom
,
params
,
nparams
,
flags
)
!=
0
)
vshError
(
ctl
,
"%s"
,
_
(
"Unable to change blkio parameters"
));
vshError
(
ctl
,
"%s"
,
_
(
"Unable to change blkio parameters"
));
else
else
ret
=
true
;
ret
=
true
;
...
...
tools/virsh.pod
浏览文件 @
1bb414af
...
@@ -734,6 +734,13 @@ value are kilobytes (i.e. blocks of 1024 bytes).
...
@@ -734,6 +734,13 @@ value are kilobytes (i.e. blocks of 1024 bytes).
Display or set the blkio parameters. QEMU/KVM supports I<--weight>.
Display or set the blkio parameters. QEMU/KVM supports I<--weight>.
I<--weight> is in range [100, 1000].
I<--weight> is in range [100, 1000].
If I<--live> is specified, affect 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.
Both I<--live> and I<--current> flags may be given, but I<--current> is
exclusive. If no flag is specified, behavior is different depending
on hypervisor.
=item B<setvcpus> I<domain-id> I<count> optional I<--maximum> I<--config>
=item B<setvcpus> I<domain-id> I<count> optional I<--maximum> I<--config>
I<--live>
I<--live>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录