Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5ee59220
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,体验更适合开发者的 AI 搜索 >>
提交
5ee59220
编写于
3月 17, 2010
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add migrate-setmaxdowntime command to virsh
上级
7f4f1dd4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
72 addition
and
0 deletion
+72
-0
tools/virsh.c
tools/virsh.c
+66
-0
tools/virsh.pod
tools/virsh.pod
+6
-0
未找到文件。
tools/virsh.c
浏览文件 @
5ee59220
...
...
@@ -227,6 +227,8 @@ static vshCmdOpt *vshCommandOpt(const vshCmd *cmd, const char *name);
static
int
vshCommandOptInt
(
const
vshCmd
*
cmd
,
const
char
*
name
,
int
*
found
);
static
char
*
vshCommandOptString
(
const
vshCmd
*
cmd
,
const
char
*
name
,
int
*
found
);
static
long
long
vshCommandOptLongLong
(
const
vshCmd
*
cmd
,
const
char
*
name
,
int
*
found
);
#if 0
static int vshCommandOptStringList(const vshCmd *cmd, const char *name, char ***data);
#endif
...
...
@@ -2827,6 +2829,51 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd)
return
ret
;
}
/*
* "migrate-setmaxdowntime" command
*/
static
const
vshCmdInfo
info_migrate_setmaxdowntime
[]
=
{
{
"help"
,
N_
(
"set maximum tolerable downtime"
)},
{
"desc"
,
N_
(
"Set maximum tolerable downtime of a domain which is being live-migrated to another host."
)},
{
NULL
,
NULL
}
};
static
const
vshCmdOptDef
opts_migrate_setmaxdowntime
[]
=
{
{
"domain"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"domain name, id or uuid"
)},
{
"downtime"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"maximum tolerable downtime (in milliseconds) for migration"
)},
{
NULL
,
0
,
0
,
NULL
}
};
static
int
cmdMigrateSetMaxDowntime
(
vshControl
*
ctl
,
const
vshCmd
*
cmd
)
{
virDomainPtr
dom
=
NULL
;
long
long
downtime
;
int
found
;
int
ret
=
FALSE
;
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
,
TRUE
))
return
FALSE
;
if
(
!
(
dom
=
vshCommandOptDomain
(
ctl
,
cmd
,
NULL
)))
return
FALSE
;
downtime
=
vshCommandOptLongLong
(
cmd
,
"downtime"
,
&
found
);
if
(
!
found
||
downtime
<
1
)
{
vshError
(
ctl
,
"%s"
,
_
(
"migrate: Invalid downtime"
));
goto
done
;
}
if
(
virDomainMigrateSetMaxDowntime
(
dom
,
downtime
,
0
))
goto
done
;
ret
=
TRUE
;
done:
virDomainFree
(
dom
);
return
ret
;
}
/*
* "net-autostart" command
*/
...
...
@@ -7767,6 +7814,7 @@ static const vshCmdDef commands[] = {
{
"hostname"
,
cmdHostname
,
NULL
,
info_hostname
},
{
"list"
,
cmdList
,
opts_list
,
info_list
},
{
"migrate"
,
cmdMigrate
,
opts_migrate
,
info_migrate
},
{
"migrate-setmaxdowntime"
,
cmdMigrateSetMaxDowntime
,
opts_migrate_setmaxdowntime
,
info_migrate_setmaxdowntime
},
{
"net-autostart"
,
cmdNetworkAutostart
,
opts_network_autostart
,
info_network_autostart
},
{
"net-create"
,
cmdNetworkCreate
,
opts_network_create
,
info_network_create
},
...
...
@@ -8107,6 +8155,24 @@ vshCommandOptString(const vshCmd *cmd, const char *name, int *found)
return
arg
&&
arg
->
data
&&
*
arg
->
data
?
arg
->
data
:
NULL
;
}
/*
* Returns option as long long
*/
static
long
long
vshCommandOptLongLong
(
const
vshCmd
*
cmd
,
const
char
*
name
,
int
*
found
)
{
vshCmdOpt
*
arg
=
vshCommandOpt
(
cmd
,
name
);
int
num_found
=
FALSE
;
long
long
res
=
0
;
char
*
end_p
=
NULL
;
if
((
arg
!=
NULL
)
&&
(
arg
->
data
!=
NULL
))
num_found
=
!
virStrToLong_ll
(
arg
->
data
,
&
end_p
,
10
,
&
res
);
if
(
found
)
*
found
=
num_found
;
return
res
;
}
#if 0
static int
vshCommandOptStringList(const vshCmd *cmd, const char *name, char ***data)
...
...
tools/virsh.pod
浏览文件 @
5ee59220
...
...
@@ -334,6 +334,12 @@ leaves the domain paused on the destination host. The I<desturi> is the
connection URI of the destination host, and I<migrateuri> is the
migration URI, which usually can be omitted.
=item B<migrate-setmaxdowntime> I<domain-id> I<downtime>
Set maximum tolerable downtime for a domain which is being live-migrated to
another host. The I<downtime> is a number of milliseconds the guest is allowed
to be down at the end of live migration.
=item B<reboot> I<domain-id>
Reboot a domain. This acts just as if the domain had the B<reboot>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录