Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
c24d4206
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,发现更多精彩内容 >>
未验证
提交
c24d4206
编写于
8月 16, 2019
作者:
Q
Qianqian Zhu
提交者:
GitHub
8月 16, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1866 from vivianQizhu/serial_data_transfter
virtio_serial_file_transfer: Support pty backend
上级
4fac6ae6
9c5ef7d4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
1 deletion
+9
-1
qemu/tests/cfg/virtio_serial_file_transfer.cfg
qemu/tests/cfg/virtio_serial_file_transfer.cfg
+3
-1
qemu/tests/virtio_serial_file_transfer.py
qemu/tests/virtio_serial_file_transfer.py
+6
-0
未找到文件。
qemu/tests/cfg/virtio_serial_file_transfer.cfg
浏览文件 @
c24d4206
...
@@ -20,4 +20,6 @@
...
@@ -20,4 +20,6 @@
variants:
variants:
- unix_socket:
- unix_socket:
- tcp_socket:
- tcp_socket:
chardev_backend = tcp_socket
chardev_backend_vs1 = tcp_socket
- pty:
chardev_backend_vs1 = pty
qemu/tests/virtio_serial_file_transfer.py
浏览文件 @
c24d4206
import
re
import
re
import
os
import
os
import
time
import
logging
import
logging
from
avocado.utils
import
process
from
avocado.utils
import
process
...
@@ -34,12 +35,16 @@ def get_virtio_port_property(vm, port_name):
...
@@ -34,12 +35,16 @@ def get_virtio_port_property(vm, port_name):
:param port_name: the port name to be processed
:param port_name: the port name to be processed
:return: port type and port hostfile
:return: port type and port hostfile
"""
"""
chardev_info
=
vm
.
monitor
.
human_monitor_cmd
(
'info chardev'
)
for
port
in
vm
.
virtio_ports
:
for
port
in
vm
.
virtio_ports
:
if
isinstance
(
port
,
qemu_virtio_port
.
VirtioSerial
):
if
isinstance
(
port
,
qemu_virtio_port
.
VirtioSerial
):
if
port
.
name
==
port_name
:
if
port
.
name
==
port_name
:
hostfile
=
port
.
hostfile
hostfile
=
port
.
hostfile
if
port
.
port_type
in
(
'tcp_socket'
,
'udp'
):
if
port
.
port_type
in
(
'tcp_socket'
,
'udp'
):
hostfile
=
'%s:%s'
%
(
port
.
hostfile
[
0
],
port
.
hostfile
[
1
])
hostfile
=
'%s:%s'
%
(
port
.
hostfile
[
0
],
port
.
hostfile
[
1
])
elif
port
.
port_type
==
'pty'
:
hostfile
=
re
.
findall
(
'%s: filename=pty:(/dev/pts/
\\
d)?'
%
port_name
,
chardev_info
)[
0
]
return
port
.
port_type
,
hostfile
return
port
.
port_type
,
hostfile
...
@@ -125,6 +130,7 @@ def _transfer_data(session, host_cmd, guest_cmd, timeout, sender):
...
@@ -125,6 +130,7 @@ def _transfer_data(session, host_cmd, guest_cmd, timeout, sender):
host_thread
=
utils_misc
.
InterruptedThread
(
process
.
getoutput
,
host_thread
=
utils_misc
.
InterruptedThread
(
process
.
getoutput
,
kwargs
=
kwargs
)
kwargs
=
kwargs
)
host_thread
.
start
()
host_thread
.
start
()
time
.
sleep
(
3
)
g_output
=
session
.
cmd_output
(
guest_cmd
,
timeout
=
timeout
)
g_output
=
session
.
cmd_output
(
guest_cmd
,
timeout
=
timeout
)
result
=
check_output
(
sender
,
g_output
)
result
=
check_output
(
sender
,
g_output
)
if
result
[
0
]
is
False
:
if
result
[
0
]
is
False
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录