Add NIO TAP support for Docker and VMware. Fixes #603.

This commit is contained in:
grossmj committed 2016-07-06 22:00:39 -06:00
1 parent e175650fb0
commit 08956e438c
4 files changed
+30 -36

No files matched your search

+4 -10
View File
@@ -221,16 +221,10 @@ class DockerHandler:
request.match_info["vm_id"],
project_id=request.match_info["project_id"])
nio_type = request.json["type"]
if nio_type not in ("nio_udp"):
raise HTTPConflict(
text="NIO of type {} is not supported".format(nio_type))
nio = docker_manager.create_nio(
int(request.match_info["adapter_number"]), request.json)
adapter = container._ethernet_adapters[
int(request.match_info["adapter_number"])
]
yield from container.adapter_add_nio_binding(
int(request.match_info["adapter_number"]), nio)
if nio_type not in ("nio_udp", "nio_tap"):
raise HTTPConflict(text="NIO of type {} is not supported".format(nio_type))
nio = docker_manager.create_nio(int(request.match_info["adapter_number"]), request.json)
yield from container.adapter_add_nio_binding(int(request.match_info["adapter_number"]), nio)
response.set_status(201)
response.json(nio)
+1 -1
View File
@@ -271,7 +271,7 @@ class VMwareHandler:
vmware_manager = VMware.instance()
vm = vmware_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
nio_type = request.json["type"]
if nio_type not in ("nio_udp", "nio_vmnet", "nio_nat"):
if nio_type not in ("nio_udp", "nio_vmnet", "nio_nat", "nio_tap"):
raise HTTPConflict(text="NIO of type {} is not supported".format(nio_type))
nio = vmware_manager.create_nio(None, request.json)
yield from vm.adapter_add_nio_binding(int(request.match_info["adapter_number"]), nio)