virt: refactor method compute_driver_matches

We only use method compute_driver_matches for checking if compute_driver
equals 'xenapi.XenAPIDriver'. To be explicit, just rename it to is_xenapi.

Change-Id: I2fb61491c4a321ab430f39476127412d8ee17c0d
This commit is contained in:
ChangBo Guo(gcb)
2016-01-04 20:51:26 +08:00
parent 848de1f712
commit f89fe67ae7
5 changed files with 29 additions and 17 deletions

View File

@@ -510,7 +510,7 @@ def instance_block_mapping(instance, bdms):
root_device_name = instance['root_device_name']
# NOTE(clayg): remove this when xenapi is setting default_root_device
if root_device_name is None:
if driver.compute_driver_matches('xenapi.XenAPIDriver'):
if driver.is_xenapi():
root_device_name = '/dev/xvda'
else:
return _DEFAULT_MAPPINGS