Skip to content

Commit

Permalink
kvm aarch64: warn when forcing machine
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Jul 30, 2024
1 parent 5cb7545 commit 7cad52c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kvirt/providers/kvm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,13 @@ def create(self, name, virttype=None, profile='kvirt', flavor=None, plan='kvirt'
aarch64 = capabilities['arch'] == 'aarch64'
aarch64_full = aarch64 and capabilities['kvm']
as390x = capabilities['arch'] == 's390x'
if aarch64 and not aarch64_full:
if aarch64:
if 'machine' not in overrides:
virtmachines = [m for m in sorted(capabilities['machines']) if m.startswith('virt-')]
if not virtmachines:
return {'result': 'failure', 'reason': "Couldn't find a valid machine"}
else:
warning(f"Using machine {virtmachines[-1]}")
overrides['machine'] = virtmachines[-1]
if 'cpumodel' not in overrides:
cpumodel = 'cortex-a57'
Expand Down Expand Up @@ -1264,7 +1265,7 @@ def create(self, name, virttype=None, profile='kvirt', flavor=None, plan='kvirt'
</hugepages>
<locked/>
</memoryBacking>""" % hugepages
machine = "" if aarch64_full else f"machine='{machine}'"
machine = f"machine='{machine}'"
emulatorxml = f"<emulator>{emulator}</emulator>"
uuidxml = ""
if 'uuid' in overrides:
Expand Down

0 comments on commit 7cad52c

Please sign in to comment.