From 55f7c79918448f009983091a6cef014da2aa32fe Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 7 Aug 2015 17:03:06 +0200 Subject: [PATCH] Explicit set qemu memory as MB --- gns3server/modules/qemu/qemu_vm.py | 2 +- tests/modules/qemu/test_qemu_vm.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index 7cc2f62f..67a98b41 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -1386,7 +1386,7 @@ class QemuVM(BaseVM): command = [self.qemu_path] command.extend(["-name", self._name]) - command.extend(["-m", str(self._ram)]) + command.extend(["-m {}M".format(self._ram)]) command.extend(["-smp", "cpus={}".format(self._cpus)]) if self._run_with_kvm(self.qemu_path, self._options): command.extend(["-enable-kvm"]) diff --git a/tests/modules/qemu/test_qemu_vm.py b/tests/modules/qemu/test_qemu_vm.py index 676ec9b8..0aa8cbcb 100644 --- a/tests/modules/qemu/test_qemu_vm.py +++ b/tests/modules/qemu/test_qemu_vm.py @@ -339,7 +339,7 @@ def test_build_command(vm, loop, fake_qemu_binary, port_manager): "-name", "test", "-m", - "256", + "256M", "-smp", "cpus=1", "-boot", @@ -436,7 +436,6 @@ def test_run_with_kvm_darwin(darwin_platform, vm): assert vm._run_with_kvm("qemu-system-x86_64", "") is False - def test_run_with_kvm_windows(windows_platform, vm): with patch("configparser.SectionProxy.getboolean", return_value=True): @@ -472,7 +471,6 @@ def test_run_with_kvm_not_x86(linux_platform, vm): assert vm._run_with_kvm("qemu-system-arm", "") is False - def test_run_with_kvm_linux_dev_kvm_missing(linux_platform, vm): with patch("os.path.exists", return_value=False) as os_path: