Consume VF capacity from the right place

networking-powervm change set I91dc7cf5820bbdd66af80e8f492a80d03c21c02e
ensures that the VF capacity comes through in vif['details']['capacity']
regardless of whether it was configured in the ml2 config or the
binding:profile.  This change set accomodates by always grabbing the
value from that location.

Change-Id: I086220bf879028df5946b02e756b803aefb0d17e
This commit is contained in:
Eric Fried
2016-08-29 17:30:37 -04:00
parent daabfb35cf
commit 98d5704572
2 changed files with 4 additions and 5 deletions

View File

@@ -230,12 +230,11 @@ class FakeDirectVif(dict):
details={
'vlan': '79',
'physical_ports': [],
'redundancy': 3},
'redundancy': 3,
'capacity': cap},
profile={})
if pports is not None:
self['details']['physical_ports'] = pports
if cap is not None:
self['profile']['capacity'] = cap
def get_physical_network(self):
return self._physnet

View File

@@ -508,8 +508,8 @@ class PvmVnicSriovVifDriver(PvmVifDriver):
# Redundancy: plugin sets from binding:profile, then conf, then default
redundancy = int(vif['details']['redundancy'])
# Capacity: from binding:profile or pport default
capacity = vif['profile'].get('capacity')
# Capacity: plugin sets from binding:profile, then conf, then default
capacity = vif['details']['capacity']
vnic = pvm_card.VNIC.bld(
self.adapter, vlan_id, slot_num=slot_num, mac_addr=mac_address,