@@ -179,7 +179,7 @@ def disk_exists(self, pool, name):
179179 return False
180180
181181 def get_capabilities (self , arch = None ):
182- results = {'kvm' : False , 'nestedfeature' : None , 'machines' : [], 'arch' : arch }
182+ results = {'kvm' : False , 'hvf' : False , ' nestedfeature' : None , 'machines' : [], 'arch' : arch }
183183 capabilitiesxml = self .conn .getCapabilities ()
184184 root = ET .fromstring (capabilitiesxml )
185185 cpuxml = ''
@@ -200,7 +200,8 @@ def get_capabilities(self, arch=None):
200200 for domain in list (guest .iter ('domain' )):
201201 if domain .get ('type' ) == 'kvm' :
202202 results ['kvm' ] = True
203- break
203+ elif domain .get ('type' ) == 'hvf' :
204+ results ['hvf' ] = True
204205 for machine in list (guest .iter ('machine' )):
205206 results ['machines' ].append (machine .text )
206207 if 'vmx' in cpuxml :
@@ -270,7 +271,7 @@ def create(self, name, virttype=None, profile='kvirt', flavor=None, plan='kvirt'
270271 uefi_legacy = overrides .get ('uefi_legacy' , False ) or (uefi and self ._rhel_legacy (capabilities ['machines' ]))
271272 iommu_model = 'smmuv3' if arch == 'aarch64' else 'intel'
272273 aarch64 = arch == 'aarch64'
273- aarch64_full = aarch64 and capabilities ['kvm' ]
274+ aarch64_full = aarch64 and ( capabilities ['kvm' ] or capabilities [ 'hvf' ])
274275 as390x = arch == 's390x'
275276 if aarch64 :
276277 if custom_emulator is not None :
@@ -946,13 +947,15 @@ def create(self, name, virttype=None, profile='kvirt', flavor=None, plan='kvirt'
946947 else :
947948 cpuxml = f"<cpu mode='custom' match='exact'><model fallback='allow'>{ cpumodel } </model>"
948949 if virttype is None :
949- if not capabilities ['kvm' ]:
950+ if capabilities ['kvm' ]:
951+ virttype = 'kvm'
952+ elif capabilities ['hvf' ]:
953+ virttype = 'hvf'
954+ else :
950955 warning ("No acceleration available with this hypervisor" )
951956 virttype = 'qemu'
952957 nested = False
953- else :
954- virttype = 'kvm'
955- elif virttype not in ['qemu' , 'kvm' , 'xen' , 'lxc' ]:
958+ elif virttype not in ['qemu' , 'kvm' , 'hvf' , 'xen' , 'lxc' ]:
956959 msg = f"Incorrect virttype { virttype } "
957960 return {'result' : 'failure' , 'reason' : msg }
958961 nestedfeature = capabilities ['nestedfeature' ]
0 commit comments