From 0f4991143284fa06155d5c3d3f8f9a009503673c Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 4 Feb 2023 12:18:52 +0800 Subject: [PATCH] Fix Qemu binary not set when adding appliance from template --- gns3server/compute/qemu/qemu_vm.py | 2 +- gns3server/schemas/qemu_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index 9db5d32a..318bb30d 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -216,7 +216,7 @@ class QemuVM(BaseNode): if qemu_bin == "qemu": self._platform = "i386" else: - self._platform = re.sub(r'^qemu-system-(.*)$', r'\1', qemu_bin, re.IGNORECASE) + self._platform = re.sub(r'^qemu-system-(\w+).*$', r'\1', qemu_bin, re.IGNORECASE) if self._platform.split(".")[0] not in QEMU_PLATFORMS: raise QemuError("Platform {} is unknown".format(self._platform)) log.info('QEMU VM "{name}" [{id}] has set the QEMU path to {qemu_path}'.format(name=self._name, diff --git a/gns3server/schemas/qemu_template.py b/gns3server/schemas/qemu_template.py index f6b93a9b..a84a3da9 100644 --- a/gns3server/schemas/qemu_template.py +++ b/gns3server/schemas/qemu_template.py @@ -35,7 +35,7 @@ QEMU_TEMPLATE_PROPERTIES = { "platform": { "description": "Platform to emulate", "enum": QEMU_PLATFORMS, - "default": "i386" + "default": "" }, "linked_clone": { "description": "Whether the VM is a linked clone or not",