diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-12-14 20:44:50 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-12-14 20:44:50 +0000 |
| commit | 7e7abf832316168a01b0f0f10eda9a2ae79074ce (patch) | |
| tree | 4329b16a747710cd4cfd6ecb8cdfcb95b46e7d8a /nova | |
| parent | c178043d3021548111a7d7ae4a53210fd96cc1bf (diff) | |
| parent | 736583fd9f5d166f0c7b0ed9d8556d332cf2bd5b (diff) | |
Merge "Make sure the rxtx_cap is used to set qos info"
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/network/quantum/manager.py | 1 | ||||
| -rw-r--r-- | nova/tests/test_xenapi.py | 3 | ||||
| -rw-r--r-- | nova/virt/xenapi/vif.py | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index fc38f007e..9f1fd992b 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -436,6 +436,7 @@ class QuantumManager(manager.FlatManager): network_dict = { 'cidr': v4_subnet['cidr'], 'injected': True, + 'bridge': net['bridge'], 'multi_host': False} q_tenant_id = project_id or FLAGS.quantum_default_tenant_id diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 08441e19e..f0bc8c85f 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -339,7 +339,8 @@ class XenAPIVMTestCase(test.TestCase): 'ip': '192.168.0.100', 'netmask': '255.255.255.0'}], 'label': 'fake', - 'mac': 'DE:AD:BE:EF:00:00'}) + 'mac': 'DE:AD:BE:EF:00:00', + 'rxtx_cap': 3}) def check_vm_params_for_windows(self): self.assertEquals(self.vm['platform']['nx'], 'true') diff --git a/nova/virt/xenapi/vif.py b/nova/virt/xenapi/vif.py index 2f25efeb2..e3d7b9a7d 100644 --- a/nova/virt/xenapi/vif.py +++ b/nova/virt/xenapi/vif.py @@ -41,7 +41,6 @@ class XenAPIBridgeDriver(VIFDriver): else: network_ref = NetworkHelper.find_network_with_bridge( xenapi_session, network['bridge']) - rxtx_cap = network_mapping.pop('rxtx_cap') vif_rec = {} vif_rec['device'] = str(device) vif_rec['network'] = network_ref @@ -49,9 +48,13 @@ class XenAPIBridgeDriver(VIFDriver): vif_rec['MAC'] = network_mapping['mac'] vif_rec['MTU'] = '1500' vif_rec['other_config'] = {} - vif_rec['qos_algorithm_type'] = "ratelimit" if rxtx_cap else '' - vif_rec['qos_algorithm_params'] = \ - {"kbps": str(rxtx_cap * 1024)} if rxtx_cap else {} + if "rxtx_cap" in network_mapping: + vif_rec['qos_algorithm_type'] = "ratelimit" + vif_rec['qos_algorithm_params'] = \ + {"kbps": str(network_mapping['rxtx_cap'] * 1024)} + else: + vif_rec['qos_algorithm_type'] = "" + vif_rec['qos_algorithm_params'] = {} return vif_rec def ensure_vlan_bridge(self, xenapi_session, network): |
