Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c6375aa7
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c6375aa7
编写于
4月 17, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
esx: Add support for the VMXNET 2 (Enhanced) NIC model
Add a test case and document it.
上级
cad91306
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
106 addition
and
19 deletion
+106
-19
docs/drvesx.html.in
docs/drvesx.html.in
+3
-2
src/esx/esx_vmx.c
src/esx/esx_vmx.c
+43
-17
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx
+9
-0
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml
+20
-0
tests/vmx2xmltest.c
tests/vmx2xmltest.c
+1
-0
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.vmx
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.vmx
+14
-0
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.xml
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.xml
+15
-0
tests/xml2vmxtest.c
tests/xml2vmxtest.c
+1
-0
未找到文件。
docs/drvesx.html.in
浏览文件 @
c6375aa7
...
...
@@ -307,10 +307,11 @@ ethernet0.checkMACAddress = "false"
<dd>
AMD PCnet32 network card for older guests.
</dd>
<dt><code>
vmxnet
</code>
,
<code>
vmxnet3
</code></dt>
<dt><code>
vmxnet
</code>
,
<code>
vmxnet
2
</code>
,
<code>
vmxnet
3
</code></dt>
<dd>
Special VMware VMXnet network card, requires VMware tools inside
the guest.
the guest. See
<a
href=
"http://kb.vmware.com/kb/1001805"
>
VMware KB1001805
</a>
for details.
</dd>
<dt><code>
e1000
</code></dt>
<dd>
...
...
src/esx/esx_vmx.c
浏览文件 @
c6375aa7
...
...
@@ -265,6 +265,7 @@ def->disks[0]...
def->nets[0]...
->model = <model> <=> ethernet0.virtualDev = "<model>" # default depends on guestOS value
ethernet0.features = "15" # if present and virtualDev is "vmxnet" => vmxnet2 (enhanced)
ethernet0.addressType = "generated" # default to "generated"
...
...
@@ -1705,6 +1706,9 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
char
virtualDev_name
[
48
]
=
""
;
char
*
virtualDev
=
NULL
;
char
features_name
[
48
]
=
""
;
long
long
features
=
0
;
char
vnet_name
[
48
]
=
""
;
char
*
vnet
=
NULL
;
...
...
@@ -1737,6 +1741,7 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
ESX_BUILD_VMX_NAME
(
generatedAddress
);
ESX_BUILD_VMX_NAME
(
address
);
ESX_BUILD_VMX_NAME
(
virtualDev
);
ESX_BUILD_VMX_NAME
(
features
);
ESX_BUILD_VMX_NAME
(
networkName
);
ESX_BUILD_VMX_NAME
(
vnet
);
...
...
@@ -1797,21 +1802,34 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
goto
failure
;
}
/* vmx:virtualDev -> def:model */
if
(
esxUtil_GetConfigString
(
conf
,
virtualDev_name
,
&
virtualDev
,
1
)
<
0
)
{
/* vmx:virtualDev, vmx:features -> def:model */
if
(
esxUtil_GetConfigString
(
conf
,
virtualDev_name
,
&
virtualDev
,
1
)
<
0
||
esxUtil_GetConfigLong
(
conf
,
features_name
,
&
features
,
0
,
1
)
<
0
)
{
goto
failure
;
}
if
(
virtualDev
!=
NULL
&&
STRCASENEQ
(
virtualDev
,
"vlance"
)
&&
STRCASENEQ
(
virtualDev
,
"vmxnet"
)
&&
STRCASENEQ
(
virtualDev
,
"vmxnet3"
)
&&
STRCASENEQ
(
virtualDev
,
"e1000"
))
{
ESX_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
"'vmxnet3' or 'e1000' but found '%s'"
),
virtualDev_name
,
virtualDev
);
goto
failure
;
if
(
virtualDev
!=
NULL
)
{
if
(
STRCASENEQ
(
virtualDev
,
"vlance"
)
&&
STRCASENEQ
(
virtualDev
,
"vmxnet"
)
&&
STRCASENEQ
(
virtualDev
,
"vmxnet3"
)
&&
STRCASENEQ
(
virtualDev
,
"e1000"
))
{
ESX_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
"'vmxnet3' or 'e1000' but found '%s'"
),
virtualDev_name
,
virtualDev
);
goto
failure
;
}
if
(
STRCASEEQ
(
virtualDev
,
"vmxnet"
)
&&
features
==
15
)
{
VIR_FREE
(
virtualDev
);
virtualDev
=
strdup
(
"vmxnet2"
);
if
(
virtualDev
==
NULL
)
{
virReportOOMError
();
goto
failure
;
}
}
}
/* vmx:networkName -> def:data.bridge.brname */
...
...
@@ -2744,21 +2762,29 @@ esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
virBufferVSprintf
(
buffer
,
"ethernet%d.present =
\"
true
\"\n
"
,
controller
);
/* def:model -> vmx:virtualDev */
/* def:model -> vmx:virtualDev
, vmx:features
*/
if
(
def
->
model
!=
NULL
)
{
if
(
STRCASENEQ
(
def
->
model
,
"vlance"
)
&&
STRCASENEQ
(
def
->
model
,
"vmxnet"
)
&&
STRCASENEQ
(
def
->
model
,
"vmxnet2"
)
&&
STRCASENEQ
(
def
->
model
,
"vmxnet3"
)
&&
STRCASENEQ
(
def
->
model
,
"e1000"
))
{
ESX_ERROR
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Expecting domain XML entry 'devices/interfase/model' "
"to be 'vlance' or 'vmxnet' or 'vmxnet
3' or 'e1000
' "
"but found '%s'"
),
def
->
model
);
"to be 'vlance' or 'vmxnet' or 'vmxnet
2' or 'vmxnet3
' "
"
or 'e1000'
but found '%s'"
),
def
->
model
);
return
-
1
;
}
virBufferVSprintf
(
buffer
,
"ethernet%d.virtualDev =
\"
%s
\"\n
"
,
controller
,
def
->
model
);
if
(
STRCASEEQ
(
def
->
model
,
"vmxnet2"
))
{
virBufferVSprintf
(
buffer
,
"ethernet%d.virtualDev =
\"
vmxnet
\"\n
"
,
controller
);
virBufferVSprintf
(
buffer
,
"ethernet%d.features =
\"
15
\"\n
"
,
controller
);
}
else
{
virBufferVSprintf
(
buffer
,
"ethernet%d.virtualDev =
\"
%s
\"\n
"
,
controller
,
def
->
model
);
}
}
/* def:type, def:ifname -> vmx:connectionType */
...
...
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx
0 → 100644
浏览文件 @
c6375aa7
config.version = "8"
virtualHW.version = "4"
ethernet0.present = "true"
ethernet0.virtualDev = "vmxnet"
ethernet0.features = "15"
ethernet0.networkName = "VM Network"
ethernet0.connectionType = "bridged"
ethernet0.addressType = "static"
ethernet0.address = "00:50:56:11:22:33"
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml
0 → 100644
浏览文件 @
c6375aa7
<domain
type=
'vmware'
>
<uuid>
00000000-0000-0000-0000-000000000000
</uuid>
<memory>
32768
</memory>
<currentMemory>
32768
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
>
hvm
</type>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<interface
type=
'bridge'
>
<mac
address=
'00:50:56:11:22:33'
/>
<source
bridge=
'VM Network'
/>
<model
type=
'vmxnet2'
/>
</interface>
</devices>
</domain>
tests/vmx2xmltest.c
浏览文件 @
c6375aa7
...
...
@@ -145,6 +145,7 @@ mymain(int argc, char **argv)
DO_TEST
(
"floppy-device"
,
"floppy-device"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-e1000"
,
"ethernet-e1000"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-vmxnet2"
,
"ethernet-vmxnet2"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-custom"
,
"ethernet-custom"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-bridged"
,
"ethernet-bridged"
,
esxVI_APIVersion_25
);
...
...
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.vmx
0 → 100644
浏览文件 @
c6375aa7
config.version = "8"
virtualHW.version = "4"
guestOS = "other"
uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
displayName = "ethernet-vmxnet2"
memsize = "4"
numvcpus = "1"
ethernet0.present = "true"
ethernet0.virtualDev = "vmxnet"
ethernet0.features = "15"
ethernet0.networkName = "VM Network"
ethernet0.connectionType = "bridged"
ethernet0.addressType = "static"
ethernet0.address = "00:50:56:11:22:33"
tests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.xml
0 → 100644
浏览文件 @
c6375aa7
<domain
type=
'vmware'
>
<name>
ethernet-vmxnet2
</name>
<uuid>
564d9bef-acd9-b4e0-c8f0-aea8b9103515
</uuid>
<memory>
4096
</memory>
<os>
<type>
hvm
</type>
</os>
<devices>
<interface
type=
'bridge'
>
<mac
address=
'00:50:56:11:22:33'
/>
<source
bridge=
'VM Network'
/>
<model
type=
'vmxnet2'
/>
</interface>
</devices>
</domain>
tests/xml2vmxtest.c
浏览文件 @
c6375aa7
...
...
@@ -190,6 +190,7 @@ mymain(int argc, char **argv)
DO_TEST
(
"floppy-device"
,
"floppy-device"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-e1000"
,
"ethernet-e1000"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-vmxnet2"
,
"ethernet-vmxnet2"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-custom"
,
"ethernet-custom"
,
esxVI_APIVersion_25
);
DO_TEST
(
"ethernet-bridged"
,
"ethernet-bridged"
,
esxVI_APIVersion_25
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录