Skip to content

Commit

Permalink
kvm: fix hupepages size check
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Jul 28, 2024
1 parent 44f0d5d commit 906cb16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kvirt/providers/kvm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ def create(self, name, virttype=None, profile='kvirt', flavor=None, plan='kvirt'
hugepagesxml = ""
hugepages = overrides.get('hugepages', 0)
if isinstance(hugepages, int) and hugepages > 0:
if hugepages > memory:
if hugepages * 1024 > memory:
return {'result': 'failure', 'reason': "Cant allocate more hugepages memory than the memory of the VM"}
hugepages = 1024 * hugepages
hugepagesxml = """<memoryBacking>
Expand Down

0 comments on commit 906cb16

Please sign in to comment.