Merge "add "hw_firmware_type" image metadata"
This commit is contained in:
@@ -223,6 +223,18 @@ class DiskBus(Enum):
|
||||
valid_values=DiskBus.ALL)
|
||||
|
||||
|
||||
class FirmwareType(Enum):
|
||||
|
||||
UEFI = "uefi"
|
||||
BIOS = "bios"
|
||||
|
||||
ALL = (UEFI, BIOS)
|
||||
|
||||
def __init__(self):
|
||||
super(FirmwareType, self).__init__(
|
||||
valid_values=FirmwareType.ALL)
|
||||
|
||||
|
||||
class HVType(Enum):
|
||||
# TODO(berrange): move all constants out of 'nova.compute.hv_type'
|
||||
# into fields on this class
|
||||
@@ -640,6 +652,10 @@ class DiskBusField(BaseEnumField):
|
||||
AUTO_TYPE = DiskBus()
|
||||
|
||||
|
||||
class FirmwareTypeField(BaseEnumField):
|
||||
AUTO_TYPE = FirmwareType()
|
||||
|
||||
|
||||
class HVTypeField(BaseEnumField):
|
||||
AUTO_TYPE = HVType()
|
||||
|
||||
|
@@ -140,12 +140,15 @@ class ImageMetaProps(base.NovaObject):
|
||||
# Version 1.8: Added 'lxd' to hypervisor types
|
||||
# Version 1.9: added hw_cpu_thread_policy field
|
||||
# Version 1.10: added hw_cpu_realtime_mask field
|
||||
VERSION = '1.10'
|
||||
# Version 1.11: Added hw_firmware_type field
|
||||
VERSION = '1.11'
|
||||
|
||||
def obj_make_compatible(self, primitive, target_version):
|
||||
super(ImageMetaProps, self).obj_make_compatible(primitive,
|
||||
target_version)
|
||||
target_version = versionutils.convert_version_to_tuple(target_version)
|
||||
if target_version < (1, 11):
|
||||
primitive.pop('hw_firmware_type', None)
|
||||
if target_version < (1, 9):
|
||||
primitive.pop('hw_cpu_thread_policy', None)
|
||||
if target_version < (1, 7):
|
||||
@@ -231,6 +234,9 @@ class ImageMetaProps(base.NovaObject):
|
||||
# name of the floppy disk bus to use eg fd, scsi, ide
|
||||
'hw_floppy_bus': fields.DiskBusField(),
|
||||
|
||||
# This indicates the guest needs UEFI firmware
|
||||
'hw_firmware_type': fields.FirmwareTypeField(),
|
||||
|
||||
# boolean - used to trigger code to inject networking when booting a CD
|
||||
# image with a network boot image
|
||||
'hw_ipxe_boot': fields.FlexibleBooleanField(),
|
||||
|
@@ -1133,7 +1133,7 @@ object_data = {
|
||||
'HostMapping': '1.0-1a3390a696792a552ab7bd31a77ba9ac',
|
||||
'HVSpec': '1.2-db672e73304da86139086d003f3977e7',
|
||||
'ImageMeta': '1.8-642d1b2eb3e880a367f37d72dd76162d',
|
||||
'ImageMetaProps': '1.10-0f1c0f7d7d4cca0facd47524633ca9d1',
|
||||
'ImageMetaProps': '1.11-96aa14a8ba226701bbd22e63557a63ea',
|
||||
'Instance': '2.0-ff56804dce87d81d9a04834d4bd1e3d2',
|
||||
'InstanceAction': '1.1-f9f293e526b66fca0d05c3b3a2d13914',
|
||||
'InstanceActionEvent': '1.1-e56a64fa4710e43ef7af2ad9d6028b33',
|
||||
|
Reference in New Issue
Block a user