From 17d0c61407f99ea13e68af3171711a2af09d2693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 30 Jan 2020 08:47:23 +0100 Subject: [PATCH] Fix --accel parameter for oneshot --- uncloud/oneshot/main.py | 4 ++-- uncloud/oneshot/virtualmachine.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/uncloud/oneshot/main.py b/uncloud/oneshot/main.py index 0e94a81..5b9b61c 100644 --- a/uncloud/oneshot/main.py +++ b/uncloud/oneshot/main.py @@ -40,7 +40,7 @@ arg_parser.add_argument('--threads', type=int, help='Number of threads to allocate (--start)') arg_parser.add_argument('--image-format', choices=['raw', 'qcow2'], help='Format of OS image (--start)') -arg_parser.add_argument('--accel', choices=['kvm', 'tcg'], default='tcg', +arg_parser.add_argument('--accel', choices=['kvm', 'tcg'], default='kvm', help='QEMU acceleration to use (--start)') arg_parser.add_argument('--upstream-interface', default='eth0', help='Name of upstream interface (--start)') @@ -74,7 +74,7 @@ def main(arguments): vm_config = {} vm_options = [ 'mac', 'memory', 'cores', 'threads', 'image', 'image_format', - '--upstream_interface', 'upstream_interface', 'network' + '--upstream_interface', 'upstream_interface', 'network', 'accel' ] for option in vm_options: if arguments.get(option): diff --git a/uncloud/oneshot/virtualmachine.py b/uncloud/oneshot/virtualmachine.py index 1388d49..c8c2909 100644 --- a/uncloud/oneshot/virtualmachine.py +++ b/uncloud/oneshot/virtualmachine.py @@ -18,15 +18,13 @@ class VM(object): self.image = config.get('image') self.uuid = config.get('uuid', str(uuid.uuid4())) self.mac = config.get('mac') + self.accel = config.get('accel', 'kvm') self.net_id = config.get('net_id', 0) self.upstream_interface = config.get('upstream_interface', 'eth0') self.tap_interface = config.get('tap_interface', 'uc0') self.network = config.get('network') - # Harcoded & generated values. - self.accel = 'kvm' - def get_qemu_args(self): command = ( "-uuid {uuid} -name {name} -machine pc,accel={accel}"