Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado-vt
提交
7a33f98e
A
avocado-vt
项目概览
openeuler
/
avocado-vt
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado-vt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
7a33f98e
编写于
8月 11, 2020
作者:
K
kylazhang
提交者:
GitHub
8月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2690 from chloerh/if_port
Add attr 'port' to Interface class
上级
e4e7aad4
121c9a86
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
1 deletion
+12
-1
virttest/libvirt_xml/devices/interface.py
virttest/libvirt_xml/devices/interface.py
+6
-1
virttest/utils_test/libvirt.py
virttest/utils_test/libvirt.py
+6
-0
未找到文件。
virttest/libvirt_xml/devices/interface.py
浏览文件 @
7a33f98e
...
...
@@ -15,7 +15,7 @@ class Interface(base.TypedDeviceBase):
__slots__
=
(
'source'
,
'hostdev_address'
,
'managed'
,
'mac_address'
,
'bandwidth'
,
'model'
,
'coalesce'
,
'link_state'
,
'target'
,
'driver'
,
'address'
,
'boot'
,
'rom'
,
'mtu'
,
'filterref'
,
'backend'
,
'virtualport_type'
,
'alias'
,
"ips"
,
"teaming"
,
"vlan"
)
'virtualport_type'
,
'alias'
,
"ips"
,
"teaming"
,
"vlan"
,
"port"
)
def
__init__
(
self
,
type_name
,
virsh_instance
=
base
.
base
.
virsh
):
super
(
Interface
,
self
).
__init__
(
device_tag
=
'interface'
,
...
...
@@ -128,6 +128,11 @@ class Interface(base.TypedDeviceBase):
subclass
=
self
.
Vlan
,
subclass_dargs
=
{
'virsh_instance'
:
virsh_instance
})
accessors
.
XMLElementDict
(
property_name
=
'port'
,
libvirtxml
=
self
,
forbidden
=
None
,
parent_xpath
=
'/'
,
tag_name
=
'port'
)
# For convenience
Address
=
librarian
.
get
(
'address'
)
...
...
virttest/utils_test/libvirt.py
浏览文件 @
7a33f98e
...
...
@@ -3434,9 +3434,11 @@ def modify_vm_iface(vm_name, oper, iface_dict, index=0):
iface_teaming
=
iface_dict
.
get
(
'teaming'
)
iface_virtualport_type
=
iface_dict
.
get
(
'virtualport_type'
)
iface_filter_parameters
=
iface_dict
.
get
(
'filter_parameters'
)
iface_port
=
iface_dict
.
get
(
'port'
)
del_addr
=
iface_dict
.
get
(
'del_addr'
)
del_rom
=
iface_dict
.
get
(
'del_rom'
)
del_filter
=
iface_dict
.
get
(
'del_filter'
)
del_port
=
iface_dict
.
get
(
'del_port'
)
if
iface_type
:
iface
.
type_name
=
iface_type
if
iface_driver
:
...
...
@@ -3467,6 +3469,8 @@ def modify_vm_iface(vm_name, oper, iface_dict, index=0):
iface
.
del_address
()
if
del_filter
:
iface
.
del_filterref
()
if
del_port
:
iface
.
del_port
()
if
iface_filter
:
if
iface_filter_parameters
:
iface
.
filterref
=
iface
.
new_filterref
(
name
=
iface_filter
,
parameters
=
iface_filter_parameters
)
...
...
@@ -3486,6 +3490,8 @@ def modify_vm_iface(vm_name, oper, iface_dict, index=0):
iface
.
teaming
=
eval
(
iface_teaming
)
if
iface_virtualport_type
:
iface
.
virtualport_type
=
iface_virtualport_type
if
iface_port
:
iface
.
port
=
eval
(
iface_port
)
if
oper
==
"update_iface"
:
vmxml
.
devices
=
xml_devices
vmxml
.
xmltreefile
.
write
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录