@@ -878,6 +878,17 @@ name. If one is not given explicitly, it will either be set to
``None``, or, if the test is tagged with one (and only one)
``:avocado: tags=arch:VALUE`` tag, it will be set to ``VALUE``.
+cpu
+~~~
+
+The cpu model that will be set to all QEMUMachine instances created
+by the test.
+
+The ``cpu`` attribute will be set to the test parameter of the same
+name. If one is not given explicitly, it will either be set to
+``None ``, or, if the test is tagged with one (and only one)
+``:avocado: tags=cpu:VALUE`` tag, it will be set to ``VALUE``.
+
machine
~~~~~~~
@@ -924,6 +935,12 @@ architecture of a kernel or disk image to boot a VM with.
This parameter has a direct relation with the ``arch`` attribute. If
not given, it will default to None.
+cpu
+~~~
+
+The cpu model that will be set to all QEMUMachine instances created
+by the test.
+
machine
~~~~~~~
@@ -206,6 +206,9 @@ def setUp(self):
self.arch = self.params.get('arch',
default=self._get_unique_tag_val('arch'))
+ self.cpu = self.params.get('cpu',
+ default=self._get_unique_tag_val('cpu'))
+
self.machine = self.params.get('machine',
default=self._get_unique_tag_val('machine'))
@@ -231,6 +234,8 @@ def get_vm(self, *args, name=None):
name = str(uuid.uuid4())
if self._vms.get(name) is None:
self._vms[name] = self._new_vm(*args)
+ if self.cpu is not None:
+ self._vms[name].add_args('-cpu', self.cpu)
if self.machine is not None:
self._vms[name].set_machine(self.machine)
return self._vms[name]