TAP interface support for QEMU VMs. Fixes #153.

This commit is contained in:
Jeremy
2015-04-27 14:38:15 -06:00
parent b6a935aeb8
commit f208b472a1
3 changed files with 24 additions and 16 deletions

View File

@ -247,7 +247,7 @@ class QEMUHandler:
qemu_manager = Qemu.instance()
vm = qemu_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
nio_type = request.json["type"]
if nio_type != "nio_udp":
if nio_type not in ("nio_udp", "nio_tap"):
raise HTTPConflict(text="NIO of type {} is not supported".format(nio_type))
nio = qemu_manager.create_nio(vm.qemu_path, request.json)
yield from vm.adapter_add_nio_binding(int(request.match_info["adapter_number"]), nio)