Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
4cbcaffb
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看板
提交
4cbcaffb
编写于
3月 12, 2015
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: domain: Add --print-xml flag for command change-media
Allow printing the XML that would be used mostly for debugging purposes.
上级
1cc82093
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
4 deletion
+16
-4
tools/virsh-domain.c
tools/virsh-domain.c
+13
-4
tools/virsh.pod
tools/virsh.pod
+3
-0
未找到文件。
tools/virsh-domain.c
浏览文件 @
4cbcaffb
...
...
@@ -12274,6 +12274,10 @@ static const vshCmdOptDef opts_change_media[] = {
.
type
=
VSH_OT_BOOL
,
.
help
=
N_
(
"force media changing"
)
},
{.
name
=
"print-xml"
,
.
type
=
VSH_OT_BOOL
,
.
help
=
N_
(
"print XML document rather than change media"
)
},
{.
name
=
NULL
}
};
...
...
@@ -12354,12 +12358,17 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
if
(
!
(
disk_xml
=
vshPrepareDiskXML
(
disk_node
,
source
,
path
,
prepare_type
)))
goto
cleanup
;
if
(
virDomainUpdateDeviceFlags
(
dom
,
disk_xml
,
flags
)
!=
0
)
{
vshError
(
ctl
,
_
(
"Failed to complete action %s on media"
),
action
);
goto
cleanup
;
if
(
vshCommandOptBool
(
cmd
,
"print-xml"
))
{
vshPrint
(
ctl
,
"%s"
,
disk_xml
);
}
else
{
if
(
virDomainUpdateDeviceFlags
(
dom
,
disk_xml
,
flags
)
!=
0
)
{
vshError
(
ctl
,
_
(
"Failed to complete action %s on media"
),
action
);
goto
cleanup
;
}
vshPrint
(
ctl
,
_
(
"succeeded to complete action %s on media
\n
"
),
action
);
}
vshPrint
(
ctl
,
_
(
"succeeded to complete action %s on media
\n
"
),
action
);
ret
=
true
;
cleanup:
...
...
tools/virsh.pod
浏览文件 @
4cbcaffb
...
...
@@ -2597,6 +2597,7 @@ expected.
=item B<change-media> I<domain> I<path> [I<--eject>] [I<--insert>]
[I<--update>] [I<source>] [I<--force>] [[I<--live>] [I<--config>] | [I<--current>]]
[I<--print-xml>]
Change media of CDROM or floppy drive. I<path> can be the fully-qualified path
or the unique target name (<target dev='hdc'>) of the disk device. I<source>
...
...
@@ -2620,6 +2621,8 @@ the hypervisor's implementation.
Both I<--live> and I<--config> flags may be given, but I<--current> is
exclusive. If no flag is specified, behavior is different depending
on hypervisor.
If I<--print-xml> is specified, the XML that would be used to change media is
printed instead of changing the media.
=back
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录