Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
f4bdf2e3
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,发现更多精彩内容 >>
提交
f4bdf2e3
编写于
5月 03, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: volume: Add --bytes to 'vol-info'
上级
784b9cc8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
22 addition
and
5 deletion
+22
-5
tools/virsh-volume.c
tools/virsh-volume.c
+19
-4
tools/virsh.pod
tools/virsh.pod
+3
-1
未找到文件。
tools/virsh-volume.c
浏览文件 @
f4bdf2e3
...
@@ -992,6 +992,10 @@ static const vshCmdInfo info_vol_info[] = {
...
@@ -992,6 +992,10 @@ static const vshCmdInfo info_vol_info[] = {
static
const
vshCmdOptDef
opts_vol_info
[]
=
{
static
const
vshCmdOptDef
opts_vol_info
[]
=
{
VIRSH_COMMON_OPT_VOLUME_VOL
,
VIRSH_COMMON_OPT_VOLUME_VOL
,
VIRSH_COMMON_OPT_POOL_OPTIONAL
,
VIRSH_COMMON_OPT_POOL_OPTIONAL
,
{.
name
=
"bytes"
,
.
type
=
VSH_OT_BOOL
,
.
help
=
N_
(
"sizes are represented in bytes rather than pretty units"
)
},
{.
name
=
NULL
}
{.
name
=
NULL
}
};
};
...
@@ -1000,6 +1004,7 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -1000,6 +1004,7 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
{
{
virStorageVolInfo
info
;
virStorageVolInfo
info
;
virStorageVolPtr
vol
;
virStorageVolPtr
vol
;
bool
bytes
=
vshCommandOptBool
(
cmd
,
"bytes"
);
bool
ret
=
true
;
bool
ret
=
true
;
if
(
!
(
vol
=
virshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
NULL
)))
if
(
!
(
vol
=
virshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
NULL
)))
...
@@ -1014,11 +1019,21 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
...
@@ -1014,11 +1019,21 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Type:"
),
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Type:"
),
virshVolumeTypeToString
(
info
.
type
));
virshVolumeTypeToString
(
info
.
type
));
if
(
bytes
)
{
vshPrint
(
ctl
,
"%-15s %llu %s
\n
"
,
_
(
"Capacity:"
),
info
.
capacity
,
_
(
"bytes"
));
}
else
{
val
=
vshPrettyCapacity
(
info
.
capacity
,
&
unit
);
val
=
vshPrettyCapacity
(
info
.
capacity
,
&
unit
);
vshPrint
(
ctl
,
"%-15s %2.2lf %s
\n
"
,
_
(
"Capacity:"
),
val
,
unit
);
vshPrint
(
ctl
,
"%-15s %2.2lf %s
\n
"
,
_
(
"Capacity:"
),
val
,
unit
);
}
if
(
bytes
)
{
vshPrint
(
ctl
,
"%-15s %llu %s
\n
"
,
_
(
"Allocation:"
),
info
.
allocation
,
_
(
"bytes"
));
}
else
{
val
=
vshPrettyCapacity
(
info
.
allocation
,
&
unit
);
val
=
vshPrettyCapacity
(
info
.
allocation
,
&
unit
);
vshPrint
(
ctl
,
"%-15s %2.2lf %s
\n
"
,
_
(
"Allocation:"
),
val
,
unit
);
vshPrint
(
ctl
,
"%-15s %2.2lf %s
\n
"
,
_
(
"Allocation:"
),
val
,
unit
);
}
}
else
{
}
else
{
ret
=
false
;
ret
=
false
;
}
}
...
...
tools/virsh.pod
浏览文件 @
f4bdf2e3
...
@@ -3639,11 +3639,13 @@ is in. I<vol-name-or-key-or-path> is the name or key or path of the volume
...
@@ -3639,11 +3639,13 @@ is in. I<vol-name-or-key-or-path> is the name or key or path of the volume
to output the XML of.
to output the XML of.
=item B<vol-info> [I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
=item B<vol-info> [I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
[I<--bytes>]
Returns basic information about the given storage volume.
Returns basic information about the given storage volume.
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume
is in. I<vol-name-or-key-or-path> is the name or key or path of the volume
is in. I<vol-name-or-key-or-path> is the name or key or path of the volume
to return information for.
to return information for. If I<--bytes> is specified the sizes are not
converted to human friendly units.
=item B<vol-list> [I<--pool> I<pool-or-uuid>] [I<--details>]
=item B<vol-list> [I<--pool> I<pool-or-uuid>] [I<--details>]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录