Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
e5ba2a64
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,发现更多精彩内容 >>
提交
e5ba2a64
编写于
3月 27, 2015
作者:
Y
Yiqiao Pu
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #313 from spcui/block_resize
qemu.tests.block_resize: Add rescan step after shrink disk for raw forma...
上级
5759c3d1
05f86697
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
3 deletion
+13
-3
qemu/tests/block_resize.py
qemu/tests/block_resize.py
+8
-1
qemu/tests/cfg/block_resize.cfg
qemu/tests/cfg/block_resize.cfg
+5
-2
未找到文件。
qemu/tests/block_resize.py
浏览文件 @
e5ba2a64
...
...
@@ -82,6 +82,8 @@ def run(test, params, env):
if
disk_update_cmd
:
disk_update_cmd
=
disk_update_cmd
.
split
(
"::"
)
disk_rescan_cmd
=
params
.
get
(
"disk_rescan_cmd"
)
block_size
=
data_image_size
disk_change_ratio
=
params
[
"disk_change_ratio"
]
for
index
,
ratio
in
enumerate
(
disk_change_ratio
.
strip
().
split
()):
...
...
@@ -111,9 +113,14 @@ def run(test, params, env):
# We need shrink the disk in guest first, than in monitor
if
block_size
<
old_block_size
and
disk_update_cmd
:
session
.
cmd
(
disk_update_cmd
[
index
])
tmp
=
vm
.
monitor
.
block_resize
(
data_image_dev
,
block_size
)
vm
.
monitor
.
block_resize
(
data_image_dev
,
block_size
)
if
need_reboot
:
session
=
vm
.
reboot
(
session
=
session
)
elif
disk_rescan_cmd
:
session
.
cmd
(
disk_rescan_cmd
)
# We need expand disk in monitor first than extend it in guest
if
block_size
>
old_block_size
and
disk_update_cmd
:
session
.
cmd
(
disk_update_cmd
[
index
])
...
...
qemu/tests/cfg/block_resize.cfg
浏览文件 @
e5ba2a64
...
...
@@ -5,7 +5,7 @@
only qcow2 raw
type = block_resize
images += " stg"
image_size_stg = 1
5
G
image_size_stg = 1
0
G
image_name_stg = images/stg
create_image_stg = yes
force_create_image_stg = yes
...
...
@@ -16,7 +16,7 @@
Windows:
block_size_cmd = wmic diskdrive get size, index
block_size_pattern = "1\s+(\d+)"
accept_ratio = 0.00
0
5
accept_ratio = 0.005
guest_prepare_cmd = "echo select disk 1 > cmd"
guest_prepare_cmd += " && echo online disk noerr >> cmd"
guest_prepare_cmd += " && echo attributes disk clear readonly noerr >> cmd"
...
...
@@ -37,6 +37,9 @@
disk_update_cmd += " && echo shrink desired=DISK_CHANGE_SIZE >> cmd"
disk_update_cmd += " && echo exit >> cmd && diskpart /s cmd"
disk_unit = M
disk_rescan_cmd = "echo rescan > cmd"
disk_rescan_cmd += " && echo exit >> cmd"
disk_rescan_cmd += " && diskpart /s cmd"
ide:
# TODO this is bug that ide not support qcow2 format block resize
# recently. Will remove this line when the bug fixed.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录