Merge "Allow 'bochs' as a display device option"
This commit is contained in:
@ -4,5 +4,5 @@
|
||||
"hw_architecture": "x86_64"
|
||||
},
|
||||
"nova_object.name": "ImageMetaPropsPayload",
|
||||
"nova_object.version": "1.7"
|
||||
"nova_object.version": "1.8"
|
||||
}
|
||||
|
@ -124,7 +124,8 @@ class ImageMetaPropsPayload(base.NotificationPayloadBase):
|
||||
# Version 1.5: Added 'hw_tpm_model' and 'hw_tpm_version' fields
|
||||
# Version 1.6: Added 'socket' to hw_pci_numa_affinity_policy
|
||||
# Version 1.7: Added 'hw_input_bus' field
|
||||
VERSION = '1.7'
|
||||
# Version 1.8: Added 'bochs' as an option to 'hw_video_model'
|
||||
VERSION = '1.8'
|
||||
|
||||
SCHEMA = {
|
||||
k: ('image_meta_props', k) for k in image_meta.ImageMetaProps.fields}
|
||||
|
@ -577,8 +577,9 @@ class VideoModel(BaseNovaEnum):
|
||||
VIRTIO = 'virtio'
|
||||
GOP = 'gop'
|
||||
NONE = 'none'
|
||||
BOCHS = 'bochs'
|
||||
|
||||
ALL = (CIRRUS, QXL, VGA, VMVGA, XEN, VIRTIO, GOP, NONE)
|
||||
ALL = (CIRRUS, QXL, VGA, VMVGA, XEN, VIRTIO, GOP, NONE, BOCHS)
|
||||
|
||||
|
||||
class VIFModel(BaseNovaEnum):
|
||||
|
@ -186,14 +186,22 @@ class ImageMetaProps(base.NovaObject):
|
||||
# Version 1.27: Added 'hw_tpm_model' and 'hw_tpm_version' fields
|
||||
# Version 1.28: Added 'socket' to 'hw_pci_numa_affinity_policy'
|
||||
# Version 1.29: Added 'hw_input_bus' field
|
||||
# Version 1.30: Added 'bochs' as an option to 'hw_video_model'
|
||||
# NOTE(efried): When bumping this version, the version of
|
||||
# ImageMetaPropsPayload must also be bumped. See its docstring for details.
|
||||
VERSION = '1.29'
|
||||
VERSION = '1.30'
|
||||
|
||||
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, 30):
|
||||
video = primitive.get('hw_video_model', None)
|
||||
if video == fields.VideoModel.BOCHS:
|
||||
raise exception.ObjectActionError(
|
||||
action='obj_make_compatible',
|
||||
reason='hw_video_model=%s not supported in version %s' %
|
||||
(video, target_version))
|
||||
if target_version < (1, 29):
|
||||
primitive.pop('hw_input_bus', None)
|
||||
if target_version < (1, 28):
|
||||
|
@ -1233,7 +1233,7 @@ class TestInstanceNotificationSample(
|
||||
'nova_object.data': {},
|
||||
'nova_object.name': 'ImageMetaPropsPayload',
|
||||
'nova_object.namespace': 'nova',
|
||||
'nova_object.version': '1.7',
|
||||
'nova_object.version': '1.8',
|
||||
},
|
||||
'image.size': 58145823,
|
||||
'image.tags': [],
|
||||
@ -1329,7 +1329,7 @@ class TestInstanceNotificationSample(
|
||||
'nova_object.data': {},
|
||||
'nova_object.name': 'ImageMetaPropsPayload',
|
||||
'nova_object.namespace': 'nova',
|
||||
'nova_object.version': '1.7',
|
||||
'nova_object.version': '1.8',
|
||||
},
|
||||
'image.size': 58145823,
|
||||
'image.tags': [],
|
||||
|
@ -387,7 +387,7 @@ notification_object_data = {
|
||||
# ImageMetaProps, so when you see a fail here for that reason, you must
|
||||
# *also* bump the version of ImageMetaPropsPayload. See its docstring for
|
||||
# more information.
|
||||
'ImageMetaPropsPayload': '1.7-652a6048036c0d0cb8740ea62521c459',
|
||||
'ImageMetaPropsPayload': '1.8-080bdcba9b96122eab57bf39d47348f7',
|
||||
'InstanceActionNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
|
||||
'InstanceActionPayload': '1.8-4fa3da9cbf0761f1f700ae578f36dc2f',
|
||||
'InstanceActionRebuildNotification':
|
||||
|
@ -390,6 +390,28 @@ class TestImageMetaProps(test.NoDBTestCase):
|
||||
obj.obj_to_primitive, '1.21')
|
||||
self.assertIn('hw_video_model', str(ex))
|
||||
|
||||
def test_obj_bochs_model_positive(self):
|
||||
"""Test "bochs" support from Nova object version 1.30 onwards
|
||||
"""
|
||||
obj = objects.ImageMetaProps(
|
||||
hw_video_model=objects.fields.VideoModel.BOCHS,
|
||||
)
|
||||
primitive = obj.obj_to_primitive('1.30')
|
||||
self.assertEqual(
|
||||
objects.fields.VideoModel.BOCHS,
|
||||
primitive['nova_object.data']['hw_video_model'])
|
||||
|
||||
def test_obj_bochs_model_negative(self):
|
||||
"""Make sure an exception is raised for Nova object version <
|
||||
1.30
|
||||
"""
|
||||
obj = objects.ImageMetaProps(
|
||||
hw_video_model=objects.fields.VideoModel.BOCHS,
|
||||
)
|
||||
ex = self.assertRaises(exception.ObjectActionError,
|
||||
obj.obj_to_primitive, '1.29')
|
||||
self.assertIn('hw_video_model=bochs not supported', str(ex))
|
||||
|
||||
def test_obj_make_compatible_watchdog_action_not_disabled(self):
|
||||
"""Tests that we don't pop the hw_watchdog_action if the value is not
|
||||
'disabled'.
|
||||
|
@ -1074,7 +1074,7 @@ object_data = {
|
||||
'HyperVLiveMigrateData': '1.4-e265780e6acfa631476c8170e8d6fce0',
|
||||
'IDEDeviceBus': '1.0-29d4c9f27ac44197f01b6ac1b7e16502',
|
||||
'ImageMeta': '1.8-642d1b2eb3e880a367f37d72dd76162d',
|
||||
'ImageMetaProps': '1.29-5c02bd7b1e050ef39513d3fca728e543',
|
||||
'ImageMetaProps': '1.30-5bfc3dd01bbfdbb28cb3a096c0b2f383',
|
||||
'Instance': '2.7-d187aec68cad2e4d8b8a03a68e4739ce',
|
||||
'InstanceAction': '1.2-9a5abc87fdd3af46f45731960651efb5',
|
||||
'InstanceActionEvent': '1.4-5b1f361bd81989f8bb2c20bb7e8a4cb4',
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Add support for the ``bochs`` libvirt video model. This is a
|
||||
legacy-free video model that is best suited for UEFI guests. In
|
||||
limited cases (e.g. if the guest does not depend on direct VGA
|
||||
hardware access), it can be useable for BIOS guests as well.
|
Reference in New Issue
Block a user