Support a platform parameter for Qemu

I'm sure we will discover a distribution with a different
naming conventions...

Fix #220
This commit is contained in:
Julien Duponchelle
2015-06-10 15:49:24 +02:00
parent fb79543342
commit 2da0b36ee7
5 changed files with 123 additions and 20 deletions

View File

@ -51,9 +51,10 @@ class QEMUHandler:
qemu = Qemu.instance()
vm = yield from qemu.create_vm(request.json.pop("name"),
request.match_info["project_id"],
request.json.get("vm_id"),
qemu_path=request.json.get("qemu_path"),
console=request.json.get("console"))
request.json.pop("vm_id", None),
qemu_path=request.json.pop("qemu_path", None),
platform=request.json.pop("platform", None),
console=request.json.pop("console", None))
for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value: