Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
de401c67
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,发现更多精彩内容 >>
提交
de401c67
编写于
11月 01, 2019
作者:
N
nanliu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virtio_serial:Hot-unplug port and chardev and pci
Signed-off-by:
N
Nana Liu
<
nanliu@redhat.com
>
上级
c387a541
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
75 addition
and
0 deletion
+75
-0
qemu/tests/cfg/virtio_port_hotplug.cfg
qemu/tests/cfg/virtio_port_hotplug.cfg
+5
-0
qemu/tests/virtio_serial_unplug_port_chardev_pci.py
qemu/tests/virtio_serial_unplug_port_chardev_pci.py
+70
-0
未找到文件。
qemu/tests/cfg/virtio_port_hotplug.cfg
浏览文件 @
de401c67
...
...
@@ -37,6 +37,11 @@
filesize = 100
unplug_chardev_vc1 = no
unplug_chardev_vc2 = no
- unplug_port_chardev_pci:
type = virtio_serial_unplug_port_chardev_pci
sleep_time = 0.5
serials += " vs1"
serial_type_vs1 = virtserialport
- hotplug_port_pci:
type = virtio_serial_hotplug_port_pci
start_vm = no
...
...
qemu/tests/virtio_serial_unplug_port_chardev_pci.py
0 → 100644
浏览文件 @
de401c67
import
time
import
logging
from
virttest
import
error_context
from
virttest
import
utils_test
from
qemu.tests.virtio_serial_file_transfer
import
transfer_data
from
qemu.tests.hotplug_port_chardev_pci_with_console
import
get_virtio_serial_pci
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Test hot unplug virtio serial devices.
1) Start guest with virtio serial device(s).
2) Transfer data via serial port.
3) Hot-unplug serial port
4) Hot-unplug chardev device
5) Hot-unplug virtio-serial-pci
6) Hotplug virtio-serial-pci
7) Hotplug chardev
8) Hotplug the port
9) Transfer data via port from guest to host
10) Hot-unplug serial the port
11) Hot-plug serial port to the same chardev.
12) Transfer data via the port from host to guest
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
os_type
=
params
[
"os_type"
]
sleep_time
=
float
(
params
.
get
(
"sleep_time"
))
if
os_type
==
"windows"
:
sleep_time
+=
10
driver_name
=
params
[
"driver_name"
]
session
=
vm
.
wait_for_login
()
session
=
utils_test
.
qemu
.
windrv_check_running_verifier
(
session
,
vm
,
test
,
driver_name
)
for
port
in
params
.
objects
(
"serials"
):
port_params
=
params
.
object_params
(
port
)
if
not
port_params
[
'serial_type'
].
startswith
(
'virt'
):
continue
virtio_port
=
vm
.
devices
.
get
(
port
)
if
not
virtio_port
:
test
.
error
(
"Virtio Port '%s' not found"
%
port
)
chardev_qid
=
virtio_port
.
get_param
(
"chardev"
)
try
:
port_chardev
=
vm
.
devices
.
get_by_qid
(
chardev_qid
)[
0
]
except
IndexError
:
test
.
error
(
"Failed to get device %s"
%
chardev_qid
)
params
[
'file_transfer_serial_port'
]
=
port
virtio_serial_pci
=
get_virtio_serial_pci
(
vm
,
virtio_port
)
logging
.
info
(
"Transfer data with %s before hot-unplugging"
%
port
)
transfer_data
(
params
,
vm
,
sender
=
'both'
)
vm
.
devices
.
simple_unplug
(
virtio_port
,
vm
.
monitor
)
vm
.
devices
.
simple_unplug
(
port_chardev
,
vm
.
monitor
)
vm
.
devices
.
simple_unplug
(
virtio_serial_pci
,
vm
.
monitor
)
time
.
sleep
(
sleep_time
)
vm
.
devices
.
simple_hotplug
(
virtio_serial_pci
,
vm
.
monitor
)
time
.
sleep
(
sleep_time
)
vm
.
devices
.
simple_hotplug
(
port_chardev
,
vm
.
monitor
)
vm
.
devices
.
simple_hotplug
(
virtio_port
,
vm
.
monitor
)
transfer_data
(
params
,
vm
,
sender
=
'guest'
)
vm
.
devices
.
simple_unplug
(
virtio_port
,
vm
.
monitor
)
vm
.
devices
.
simple_hotplug
(
virtio_port
,
vm
.
monitor
)
transfer_data
(
params
,
vm
,
sender
=
'host'
)
vm
.
verify_alive
()
vm
.
verify_kernel_crash
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录