core/hvm: fix error message when creating HVM while not supported by the hardware
libvirt reports such errors at domain definition, not startup (as was in libxl). QubesOS/qubes-issues#1198
This commit is contained in:
parent
4a4d16feb9
commit
b9e6b0a076
@ -711,7 +711,15 @@ class QubesVm(object):
|
|||||||
|
|
||||||
def _update_libvirt_domain(self):
|
def _update_libvirt_domain(self):
|
||||||
domain_config = self.create_config_file()
|
domain_config = self.create_config_file()
|
||||||
|
try:
|
||||||
self._libvirt_domain = vmm.libvirt_conn.defineXML(domain_config)
|
self._libvirt_domain = vmm.libvirt_conn.defineXML(domain_config)
|
||||||
|
except libvirt.libvirtError as e:
|
||||||
|
# shouldn't this be in QubesHVm implementation?
|
||||||
|
if e.get_error_code() == libvirt.VIR_ERR_OS_TYPE and \
|
||||||
|
e.get_str2() == 'hvm':
|
||||||
|
raise QubesException("HVM domains not supported on this "
|
||||||
|
"machine. Check BIOS settings for "
|
||||||
|
"VT-x/AMD-V extensions.")
|
||||||
self.uuid = uuid.UUID(bytes=self._libvirt_domain.UUID())
|
self.uuid = uuid.UUID(bytes=self._libvirt_domain.UUID())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
Reference in New Issue
Block a user