Remove vlan from hostdev and direct vif

This patch remove the vlan attribute from hostdev
and direct vif. The vlan should be taken from the
network object. When the network vlan is null (for example in
flat network) it should be zero in the libvirt xml

Change-Id: Icf6dd39f515f5c2f8db8c1d414776eebd8e85617
This commit is contained in:
Moshe Levi 2016-02-23 13:40:21 +02:00
parent be8c70fe5d
commit e91941a0b8
2 changed files with 3 additions and 10 deletions

View File

@ -103,9 +103,6 @@ class VIFDirect(VIFBase):
# Port connection mode
'mode': osv_fields.VIFDirectModeField(),
# The VLAN number to use
'vlan': fields.IntegerField(),
# The VLAN device name to use
'vlan_name': fields.StringField(),
}
@ -142,9 +139,6 @@ class VIFHostDevice(VIFBase):
# The PCI address of the host device
'dev_address': osv_fields.PCIAddressField(),
# The VLAN number to use
'vlan': fields.IntegerField(),
}

View File

@ -85,14 +85,13 @@ class TestVIFS(base.TestCase):
self._test_vif(
objects.vif.VIFHostDevice,
dev_type=objects.fields.VIFVIFHostDeviceDevType.ETHERNET,
dev_address="0002:24:12.3", vlan=8)
dev_address="0002:24:12.3")
def test_vif_host_dev_vepa_qbh(self):
prof = objects.vif.VIFPortProfile8021Qbh(
profile_id="fishfood")
self._test_vif(objects.vif.VIFHostDevice,
dev_address="0002:24:12.3",
vlan=8,
port_profile=prof)
object_data = {
@ -106,9 +105,9 @@ object_data = {
'SubnetList': '1.0-15ecf022a68ddbb8c2a6739cfc9f8f5e',
'VIFBase': '1.0-4a5a8881dc999752cb050dd443458b6a',
'VIFBridge': '1.0-e78d355f3505361fafbf0797ffad484a',
'VIFDirect': '1.0-d07d1f26bb58b6677c5304b652cc64f1',
'VIFDirect': '1.0-05c939280f4025fd1f7efb921a835c57',
'VIFGeneric': '1.0-c72e637ed620f0135ea50a9409a3f389',
'VIFHostDevice': '1.0-7289a0eb0a69aeb5d821a0d006e3e444',
'VIFHostDevice': '1.0-b3516f5af46ecb9432650e4938ac2643',
'VIFOpenVSwitch': '1.0-e78d355f3505361fafbf0797ffad484a',
'VIFPortProfile8021Qbg': '1.0-167f305f6e982b9368cc38763815d429',
'VIFPortProfile8021Qbh': '1.0-4b945f07d2666ab00a48d1dc225669b1',