Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
2979bbfb
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看板
提交
2979bbfb
编写于
9月 21, 2018
作者:
S
Simon Kobyda
提交者:
Michal Privoznik
9月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: Implement vshTable API to domblkinfo
Signed-off-by:
N
Simon Kobyda
<
skobyda@redhat.com
>
上级
b9057c63
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
6 deletion
+11
-6
tools/virsh-domain-monitor.c
tools/virsh-domain-monitor.c
+11
-6
未找到文件。
tools/virsh-domain-monitor.c
浏览文件 @
2979bbfb
...
@@ -460,6 +460,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -460,6 +460,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
char
*
cap
=
NULL
;
char
*
cap
=
NULL
;
char
*
alloc
=
NULL
;
char
*
alloc
=
NULL
;
char
*
phy
=
NULL
;
char
*
phy
=
NULL
;
vshTablePtr
table
=
NULL
;
if
(
!
(
dom
=
virshCommandOptDomain
(
ctl
,
cmd
,
NULL
)))
if
(
!
(
dom
=
virshCommandOptDomain
(
ctl
,
cmd
,
NULL
)))
return
false
;
return
false
;
...
@@ -483,11 +484,10 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -483,11 +484,10 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
if
(
ndisks
<
0
)
if
(
ndisks
<
0
)
goto
cleanup
;
goto
cleanup
;
/* print the title */
/* title */
vshPrintExtra
(
ctl
,
"%-10s %-15s %-15s %-15s
\n
"
,
_
(
"Target"
),
table
=
vshTableNew
(
_
(
"Target"
),
_
(
"Capacity"
),
_
(
"Allocation"
),
_
(
"Physical"
),
NULL
);
_
(
"Capacity"
),
_
(
"Allocation"
),
_
(
"Physical"
));
if
(
!
table
)
vshPrintExtra
(
ctl
,
"-----------------------------"
goto
cleanup
;
"------------------------
\n
"
);
for
(
i
=
0
;
i
<
ndisks
;
i
++
)
{
for
(
i
=
0
;
i
<
ndisks
;
i
++
)
{
ctxt
->
node
=
disks
[
i
];
ctxt
->
node
=
disks
[
i
];
...
@@ -512,11 +512,15 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -512,11 +512,15 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
if
(
!
cmdDomblkinfoGet
(
ctl
,
&
info
,
&
cap
,
&
alloc
,
&
phy
,
human
))
if
(
!
cmdDomblkinfoGet
(
ctl
,
&
info
,
&
cap
,
&
alloc
,
&
phy
,
human
))
goto
cleanup
;
goto
cleanup
;
vshPrint
(
ctl
,
"%-10s %-15s %-15s %-15s
\n
"
,
target
,
cap
,
alloc
,
phy
);
if
(
vshTableRowAppend
(
table
,
target
,
cap
,
alloc
,
phy
,
NULL
)
<
0
)
goto
cleanup
;
VIR_FREE
(
target
);
VIR_FREE
(
target
);
VIR_FREE
(
protocol
);
VIR_FREE
(
protocol
);
}
}
vshTablePrintToStdout
(
table
,
ctl
);
}
else
{
}
else
{
if
(
virDomainGetBlockInfo
(
dom
,
device
,
&
info
,
0
)
<
0
)
if
(
virDomainGetBlockInfo
(
dom
,
device
,
&
info
,
0
)
<
0
)
goto
cleanup
;
goto
cleanup
;
...
@@ -531,6 +535,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -531,6 +535,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
ret
=
true
;
ret
=
true
;
cleanup:
cleanup:
vshTableFree
(
table
);
VIR_FREE
(
cap
);
VIR_FREE
(
cap
);
VIR_FREE
(
alloc
);
VIR_FREE
(
alloc
);
VIR_FREE
(
phy
);
VIR_FREE
(
phy
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录