Skip to content

Commit df453ba

Browse files
committed
qemu: Fix CPU=power8 to work properly with KVM
You can't use -cpu power8 with KVM on a Power9, it errors with: If you're using kvm-hv.ko, only "-cpu host" is possible Instead we need to specify the "max-cpu-compat" property as a machine capability.
1 parent 089822d commit df453ba

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/qemu.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ def configure_from_args(self, args):
6565
self.interactive = True
6666

6767
def apply_defaults(self):
68-
if self.machine_is('pseries') and self.accel == 'tcg':
69-
self.machine_caps += ['cap-htm=off']
68+
if self.machine_is('pseries'):
69+
if self.accel == 'tcg':
70+
self.machine_caps += ['cap-htm=off']
71+
72+
if self.cpu and self.accel == 'kvm':
73+
if self.cpu != 'host':
74+
self.machine_caps += ['max-cpu-compat=%s' % self.cpu.lower()]
75+
self.cpu = None
7076

7177
if self.cpuinfo is None:
7278
if self.machine_is('pseries'):

0 commit comments

Comments
 (0)