tests/vm: Use -cpu max rather than -cpu host
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 20 Aug 2018 15:55:54 +0000 (16:55 +0100)
committerFam Zheng <famz@redhat.com>
Wed, 26 Sep 2018 02:46:28 +0000 (10:46 +0800)
-cpu max works with any accelerator, so we don't need
to use it only conditionally if not using KVM. Just use
it all the time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180820155554.23476-1-peter.maydell@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
tests/vm/basevm.py

index 7e58d9e0ca27b6fee460b11fe0919277f63d95ac..cafbc6b3a585dec47332264bbad322d3aa42e123 100755 (executable)
@@ -65,6 +65,7 @@ class BaseVM(object):
             self._stdout = self._devnull
         self._args = [ \
             "-nodefaults", "-m", "4G",
+            "-cpu", "max",
             "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22",
             "-device", "virtio-net-pci,netdev=vnet",
             "-vnc", "127.0.0.1:0,to=20",
@@ -72,11 +73,9 @@ class BaseVM(object):
         if vcpus:
             self._args += ["-smp", str(vcpus)]
         if os.access("/dev/kvm", os.R_OK | os.W_OK):
-            self._args += ["-cpu", "host"]
             self._args += ["-enable-kvm"]
         else:
             logging.info("KVM not available, not using -enable-kvm")
-            self._args += ["-cpu", "max"]
         self._data_args = []
 
     def _download_with_cache(self, url, sha256sum=None):