From af8d93fa9da749033575fe8c3ac58cfac134c355 Mon Sep 17 00:00:00 2001 From: Thomas Stewart Date: Thu, 3 Nov 2016 21:08:04 +0000 Subject: [PATCH] Add lan9118 as valid nic for hw_vif_model property for qemu DocImpact This introduces an additional VNI so the hw_vif_model doc needs updating to reflect this at: https://docs.openstack.org/cli-reference/glance-property-keys.html Change-Id: Ifc1636bff53cf74f889e1f4b632fa62c52d07b8e Closes-Bug: 1638059 Signed-off-by: Thomas Stewart --- nova/network/model.py | 2 ++ nova/objects/image_meta.py | 3 ++- nova/tests/unit/objects/test_objects.py | 2 +- nova/tests/unit/virt/libvirt/test_vif.py | 7 +++++++ nova/virt/libvirt/vif.py | 1 + .../add-lan9118-vif-property-qemu-fcc19774945d41f3.yaml | 3 +++ 6 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add-lan9118-vif-property-qemu-fcc19774945d41f3.yaml diff --git a/nova/network/model.py b/nova/network/model.py index 11fd371253d5..f5b53e2ad701 100644 --- a/nova/network/model.py +++ b/nova/network/model.py @@ -117,6 +117,7 @@ VIF_MODEL_E1000 = 'e1000' VIF_MODEL_E1000E = 'e1000e' VIF_MODEL_NETFRONT = 'netfront' VIF_MODEL_SPAPR_VLAN = 'spapr-vlan' +VIF_MODEL_LAN9118 = 'lan9118' VIF_MODEL_SRIOV = 'sriov' VIF_MODEL_VMXNET = 'vmxnet' @@ -131,6 +132,7 @@ VIF_MODEL_ALL = ( VIF_MODEL_E1000E, VIF_MODEL_NETFRONT, VIF_MODEL_SPAPR_VLAN, + VIF_MODEL_LAN9118, VIF_MODEL_SRIOV, VIF_MODEL_VMXNET, VIF_MODEL_VMXNET3, diff --git a/nova/objects/image_meta.py b/nova/objects/image_meta.py index bcdc4a042858..4a65013b3913 100644 --- a/nova/objects/image_meta.py +++ b/nova/objects/image_meta.py @@ -165,7 +165,8 @@ class ImageMetaProps(base.NovaObject): # Version 1.14: Added 'hw_pointer_model' field # Version 1.15: Added hw_rescue_bus and hw_rescue_device. # Version 1.16: WatchdogActionField supports 'disabled' enum. - VERSION = '1.16' + # Version 1.17: Add lan9118 as valid nic for hw_vif_model property for qemu + VERSION = '1.17' def obj_make_compatible(self, primitive, target_version): super(ImageMetaProps, self).obj_make_compatible(primitive, diff --git a/nova/tests/unit/objects/test_objects.py b/nova/tests/unit/objects/test_objects.py index 26a51acb3d74..f2df27a9e8bb 100644 --- a/nova/tests/unit/objects/test_objects.py +++ b/nova/tests/unit/objects/test_objects.py @@ -1096,7 +1096,7 @@ object_data = { 'HVSpec': '1.2-de06bcec472a2f04966b855a49c46b41', 'IDEDeviceBus': '1.0-29d4c9f27ac44197f01b6ac1b7e16502', 'ImageMeta': '1.8-642d1b2eb3e880a367f37d72dd76162d', - 'ImageMetaProps': '1.16-3e5ad8e86f2ea36e565702162acc3e65', + 'ImageMetaProps': '1.17-54f21e339d153fe30be6b8999dd83148', 'Instance': '2.3-4f98ab23f4b0a25fabb1040c8f5edecc', 'InstanceAction': '1.1-f9f293e526b66fca0d05c3b3a2d13914', 'InstanceActionEvent': '1.1-e56a64fa4710e43ef7af2ad9d6028b33', diff --git a/nova/tests/unit/virt/libvirt/test_vif.py b/nova/tests/unit/virt/libvirt/test_vif.py index f8a84627b9d1..bc8b59227fc3 100644 --- a/nova/tests/unit/virt/libvirt/test_vif.py +++ b/nova/tests/unit/virt/libvirt/test_vif.py @@ -671,6 +671,13 @@ class LibvirtVifTestCase(test.NoDBTestCase): if virt == 'parallels': supported = (network_model.VIF_MODEL_RTL8139, network_model.VIF_MODEL_E1000) + elif virt == 'qemu': + supported = (network_model.VIF_MODEL_LAN9118, + network_model.VIF_MODEL_NE2K_PCI, + network_model.VIF_MODEL_PCNET, + network_model.VIF_MODEL_RTL8139, + network_model.VIF_MODEL_E1000, + network_model.VIF_MODEL_SPAPR_VLAN) else: supported = (network_model.VIF_MODEL_NE2K_PCI, network_model.VIF_MODEL_PCNET, diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index bee4abe2de39..9746e73ec6d0 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -57,6 +57,7 @@ def is_vif_model_valid_for_virt(virt_type, vif_model): network_model.VIF_MODEL_PCNET, network_model.VIF_MODEL_RTL8139, network_model.VIF_MODEL_E1000, + network_model.VIF_MODEL_LAN9118, network_model.VIF_MODEL_SPAPR_VLAN], 'kvm': [network_model.VIF_MODEL_VIRTIO, network_model.VIF_MODEL_NE2K_PCI, diff --git a/releasenotes/notes/add-lan9118-vif-property-qemu-fcc19774945d41f3.yaml b/releasenotes/notes/add-lan9118-vif-property-qemu-fcc19774945d41f3.yaml new file mode 100644 index 000000000000..f02f5faa9e75 --- /dev/null +++ b/releasenotes/notes/add-lan9118-vif-property-qemu-fcc19774945d41f3.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add support for LAN9118 as a valid nic for hw_vif_model property in qemu.