Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
029c7c7c
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
029c7c7c
编写于
2月 20, 2014
作者:
Y
Yiqiao Pu
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16 from spcui/qemu_img_fix
qemu.tests: qemu_img.py bugs fix
上级
c51c3907
204eb865
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
16 deletion
+33
-16
qemu/tests/cfg/qemu_img.cfg
qemu/tests/cfg/qemu_img.cfg
+15
-10
qemu/tests/qemu_img.py
qemu/tests/qemu_img.py
+18
-6
未找到文件。
qemu/tests/cfg/qemu_img.cfg
浏览文件 @
029c7c7c
...
...
@@ -22,21 +22,26 @@
image_name_large = create_large_image
remove_image_large = yes
variants:
- cluster_512:
image_cluster_size = 512
- cluster_1024:
image_cluster_size = 1024
- cluster_4096:
image_cluster_size = 4096
- cluster_1M:
image_cluster_size = 1M
- cluster_2M:
image_cluster_size = 2M
- @cluster_size_default:
- cluster_size:
no Host_RHEL.5
variants:
- cluster_512:
image_cluster_size = 512
- cluster_1024:
image_cluster_size = 1024
- cluster_4096:
image_cluster_size = 4096
- cluster_1M:
image_cluster_size = 1M
- cluster_2M:
image_cluster_size = 2M
variants:
- non-preallocated:
no raw
preallocated = off
- preallocated:
no Host_RHEL.5
no raw
preallocated = metadata
- convert:
...
...
qemu/tests/qemu_img.py
浏览文件 @
029c7c7c
...
...
@@ -76,7 +76,7 @@ def run(test, params, env):
def
_create
(
cmd
,
img_name
,
fmt
,
img_size
=
None
,
base_img
=
None
,
base_img_fmt
=
None
,
encrypted
=
"no"
,
preallocated
=
"
no
"
,
cluster_size
=
None
):
preallocated
=
"
off
"
,
cluster_size
=
None
):
"""
Simple wrapper of 'qemu-img create'
...
...
@@ -87,22 +87,33 @@ def run(test, params, env):
:param base_img: base image if create a snapshot image
:param base_img_fmt: base image format if create a snapshot image
:param encrypted: indicates whether the created image is encrypted
:param preallocated: if preallocation when create image,
allowed values: off, metadata. Default is "off"
:param cluster_size: the cluster size for the image
"""
cmd
+=
" create"
if
encrypted
==
"yes"
:
cmd
+=
" -e"
if
base_img
:
cmd
+=
" -b %s"
%
base_img
if
base_img_fmt
:
cmd
+=
" -F %s"
%
base_img_fmt
cmd
+=
" -f %s"
%
fmt
options
=
[]
if
preallocated
!=
"off"
:
options
.
append
(
"preallocation=%s"
%
preallocated
)
if
cluster_size
is
not
None
:
options
.
append
(
"cluster_size=%s"
%
cluster_size
)
if
options
:
cmd
+=
" -o %s"
%
","
.
join
(
options
)
cmd
+=
" %s"
%
img_name
if
img_size
:
cmd
+=
" %s"
%
img_size
if
preallocated
==
"yes"
:
cmd
+=
" -o preallocation=metadata"
if
cluster_size
is
not
None
:
cmd
+=
" -o cluster_size=%s"
%
cluster_size
msg
=
"Creating image %s by command %s"
%
(
img_name
,
cmd
)
error
.
context
(
msg
,
logging
.
info
)
utils
.
system
(
cmd
,
verbose
=
False
)
...
...
@@ -126,7 +137,8 @@ def run(test, params, env):
img
=
device
_create
(
cmd
,
img_name
=
img
,
fmt
=
image_format
,
img_size
=
params
[
"image_size_large"
],
preallocated
=
params
.
get
(
"preallocated"
,
"no"
))
preallocated
=
params
.
get
(
"preallocated"
,
"off"
),
cluster_size
=
params
.
get
(
"image_cluster_size"
))
os
.
remove
(
img
)
def
_convert
(
cmd
,
output_fmt
,
img_name
,
output_filename
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录