Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0ec9a8c2
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看板
提交
0ec9a8c2
编写于
9月 29, 2011
作者:
X
Xu He Jie
提交者:
Eric Blake
9月 29, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: Add 'reset' command for virsh
Signed-off-by:
N
Xu He Jie
<
xuhj@linux.vnet.ibm.com
>
上级
df1a0055
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
0 deletion
+47
-0
tools/virsh.c
tools/virsh.c
+39
-0
tools/virsh.pod
tools/virsh.pod
+8
-0
未找到文件。
tools/virsh.c
浏览文件 @
0ec9a8c2
...
@@ -3191,6 +3191,44 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
...
@@ -3191,6 +3191,44 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
return
ret
;
return
ret
;
}
}
/*
* "reset" command
*/
static
const
vshCmdInfo
info_reset
[]
=
{
{
"help"
,
N_
(
"reset a domain"
)},
{
"desc"
,
N_
(
"Reset the target domain as if by power button"
)},
{
NULL
,
NULL
}
};
static
const
vshCmdOptDef
opts_reset
[]
=
{
{
"domain"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"domain name, id or uuid"
)},
{
NULL
,
0
,
0
,
NULL
}
};
static
bool
cmdReset
(
vshControl
*
ctl
,
const
vshCmd
*
cmd
)
{
virDomainPtr
dom
;
bool
ret
=
true
;
const
char
*
name
;
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
return
false
;
if
(
!
(
dom
=
vshCommandOptDomain
(
ctl
,
cmd
,
&
name
)))
return
false
;
if
(
virDomainReset
(
dom
,
0
)
==
0
)
{
vshPrint
(
ctl
,
_
(
"Domain %s was reset
\n
"
),
name
);
}
else
{
vshError
(
ctl
,
_
(
"Failed to reset domain %s"
),
name
);
ret
=
false
;
}
virDomainFree
(
dom
);
return
ret
;
}
/*
/*
* "destroy" command
* "destroy" command
*/
*/
...
@@ -13665,6 +13703,7 @@ static const vshCmdDef domManagementCmds[] = {
...
@@ -13665,6 +13703,7 @@ static const vshCmdDef domManagementCmds[] = {
{
"migrate-getspeed"
,
cmdMigrateGetMaxSpeed
,
{
"migrate-getspeed"
,
cmdMigrateGetMaxSpeed
,
opts_migrate_getspeed
,
info_migrate_getspeed
,
0
},
opts_migrate_getspeed
,
info_migrate_getspeed
,
0
},
{
"reboot"
,
cmdReboot
,
opts_reboot
,
info_reboot
,
0
},
{
"reboot"
,
cmdReboot
,
opts_reboot
,
info_reboot
,
0
},
{
"reset"
,
cmdReset
,
opts_reset
,
info_reset
,
0
},
{
"restore"
,
cmdRestore
,
opts_restore
,
info_restore
,
0
},
{
"restore"
,
cmdRestore
,
opts_restore
,
info_restore
,
0
},
{
"resume"
,
cmdResume
,
opts_resume
,
info_resume
,
0
},
{
"resume"
,
cmdResume
,
opts_resume
,
info_resume
,
0
},
{
"save"
,
cmdSave
,
opts_save
,
info_save
,
0
},
{
"save"
,
cmdSave
,
opts_save
,
info_save
,
0
},
...
...
tools/virsh.pod
浏览文件 @
0ec9a8c2
...
@@ -790,6 +790,14 @@ domain actually reboots.
...
@@ -790,6 +790,14 @@ domain actually reboots.
The exact behavior of a domain when it reboots is set by the
The exact behavior of a domain when it reboots is set by the
I<on_reboot> parameter in the domain's XML definition.
I<on_reboot> parameter in the domain's XML definition.
=item B<reset> I<domain-id>
Reset a domain immediately without any guest shutdown. B<reset>
emulates the power reset button on a machine, where all guest
hardware sees the RST line set and reinitializes internal state.
B<Note>: Reset without any guest OS shutdown risks data loss.
=item B<restore> I<state-file> [I<--bypass-cache>] [I<--xml> B<file>]
=item B<restore> I<state-file> [I<--bypass-cache>] [I<--xml> B<file>]
[{I<--running> | I<--paused>}]
[{I<--running> | I<--paused>}]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录