From 137cf59e9738d978797d28282f1e1dcdbcbe828c Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Sun, 3 Jan 2016 21:23:35 +0100 Subject: [PATCH] Catch exception if we can't change process priority on Windows Fix #380 --- gns3server/modules/qemu/qemu_vm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index 36736e4e..077d7469 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -773,7 +773,10 @@ class QemuVM(BaseVM): priority = win32process.IDLE_PRIORITY_CLASS else: priority = win32process.NORMAL_PRIORITY_CLASS - win32process.SetPriorityClass(handle, priority) + try: + win32process.SetPriorityClass(handle, priority) + except win32process.error as e: + log.error('Could not change process priority for QEMU VM "{}": {}'.format(self._name, e)) else: if self._process_priority == "realtime": priority = -20