From e08aebf1f0c0765a55d82da40b6f9909818ecc94 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 18 Nov 2017 17:36:11 +0700 Subject: [PATCH] Implement variable replacement for Qemu VM options. --- gns3server/compute/qemu/qemu_vm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index b1a1e41a..3ddfc2d5 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -1636,6 +1636,11 @@ class QemuVM(BaseNode): """ additional_options = self._options.strip() + additional_options = additional_options.replace("%vm-name%", self._name) + additional_options = additional_options.replace("%vm-id%", self._id) + additional_options = additional_options.replace("%project-id%", self.project.id) + additional_options = additional_options.replace("%project-path%", self.project.path) + print(additional_options) command = [self.qemu_path] command.extend(["-name", self._name]) command.extend(["-m", "{}M".format(self._ram)])