提交 b6e747ec 编写于 作者: M Matthias Bolte 提交者: Daniel Veillard

VMware ESX: Allow ethernet address type 'vpx'

* src/esx/esx_vmx.c: add an extra type of addressType beside 'static'
  and 'generated', 'vpx' indicates that the MAC address was generated
  by a vCenter.
上级 2d6adabd
...@@ -276,6 +276,10 @@ def->nets[0]... ...@@ -276,6 +276,10 @@ def->nets[0]...
ethernet0.addressType = "static" # default to "generated" ethernet0.addressType = "static" # default to "generated"
->mac = <value> <=> ethernet0.address = "<value>" ->mac = <value> <=> ethernet0.address = "<value>"
ethernet0.addressType = "vpx" # default to "generated"
->mac = <value> <=> ethernet0.generatedAddress = "<value>"
# 00:0c:29 prefix for autogenerated mac's # 00:0c:29 prefix for autogenerated mac's
# 00:50:56 prefix for manual configured mac's # 00:50:56 prefix for manual configured mac's
# 00:05:69 old prefix from esx 1.5 # 00:05:69 old prefix from esx 1.5
...@@ -1369,7 +1373,8 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller, ...@@ -1369,7 +1373,8 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller,
goto failure; goto failure;
} }
if (addressType == NULL || STRCASEEQ(addressType, "generated")) { if (addressType == NULL || STRCASEEQ(addressType, "generated") ||
STRCASEEQ(addressType, "vpx")) {
if (generatedAddress != NULL) { if (generatedAddress != NULL) {
if (virParseMacAddr(generatedAddress, (*def)->mac) < 0) { if (virParseMacAddr(generatedAddress, (*def)->mac) < 0) {
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
...@@ -1390,8 +1395,8 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller, ...@@ -1390,8 +1395,8 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller,
} }
} else { } else {
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
"Expecting VMX entry '%s' to be 'generated' or 'static' but " "Expecting VMX entry '%s' to be 'generated' or 'static' or "
"found '%s'", addressType_name, addressType); "'vpx' but found '%s'", addressType_name, addressType);
goto failure; goto failure;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册