Merge "libvirt: remove volume_drivers config param"
This commit is contained in:
commit
ad329b0d44
@ -574,16 +574,16 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
return FakeVirtDomain()
|
||||
|
||||
# Creating mocks
|
||||
volume_driver = ('iscsi=nova.tests.unit.virt.libvirt.test_driver'
|
||||
'.FakeVolumeDriver')
|
||||
self.flags(volume_drivers=[volume_driver],
|
||||
group='libvirt')
|
||||
volume_driver = ['iscsi=nova.tests.unit.virt.libvirt.test_driver'
|
||||
'.FakeVolumeDriver']
|
||||
fake = FakeLibvirtDriver()
|
||||
# Customizing above fake if necessary
|
||||
for key, val in kwargs.items():
|
||||
fake.__setattr__(key, val)
|
||||
|
||||
self.stubs.Set(libvirt_driver.LibvirtDriver, '_conn', fake)
|
||||
self.stubs.Set(libvirt_driver.LibvirtDriver, '_get_volume_drivers',
|
||||
lambda x: volume_driver)
|
||||
self.stubs.Set(host.Host, 'get_connection', lambda x: fake)
|
||||
|
||||
def fake_lookup(self, instance_name):
|
||||
|
@ -161,31 +161,6 @@ libvirt_opts = [
|
||||
help='Snapshot image format (valid options are : '
|
||||
'raw, qcow2, vmdk, vdi). '
|
||||
'Defaults to same as source image'),
|
||||
cfg.ListOpt('volume_drivers',
|
||||
default=[
|
||||
'iscsi=nova.virt.libvirt.volume.LibvirtISCSIVolumeDriver',
|
||||
'iser=nova.virt.libvirt.volume.LibvirtISERVolumeDriver',
|
||||
'local=nova.virt.libvirt.volume.LibvirtVolumeDriver',
|
||||
'fake=nova.virt.libvirt.volume.LibvirtFakeVolumeDriver',
|
||||
'rbd=nova.virt.libvirt.volume.LibvirtNetVolumeDriver',
|
||||
'sheepdog=nova.virt.libvirt.volume.LibvirtNetVolumeDriver',
|
||||
'nfs=nova.virt.libvirt.volume.LibvirtNFSVolumeDriver',
|
||||
'smbfs=nova.virt.libvirt.volume.LibvirtSMBFSVolumeDriver',
|
||||
'aoe=nova.virt.libvirt.volume.LibvirtAOEVolumeDriver',
|
||||
'glusterfs='
|
||||
'nova.virt.libvirt.volume.LibvirtGlusterfsVolumeDriver',
|
||||
'fibre_channel=nova.virt.libvirt.volume.'
|
||||
'LibvirtFibreChannelVolumeDriver',
|
||||
'scality='
|
||||
'nova.virt.libvirt.volume.LibvirtScalityVolumeDriver',
|
||||
'gpfs='
|
||||
'nova.virt.libvirt.volume.LibvirtGPFSVolumeDriver',
|
||||
'quobyte='
|
||||
'nova.virt.libvirt.volume.LibvirtQuobyteVolumeDriver',
|
||||
],
|
||||
help='DEPRECATED. Libvirt handlers for remote volumes. '
|
||||
'This option is deprecated and will be removed in the '
|
||||
'Kilo release.'),
|
||||
cfg.StrOpt('disk_prefix',
|
||||
help='Override the default disk prefix for the devices attached'
|
||||
' to a server, which is dependent on virt_type. '
|
||||
@ -294,6 +269,23 @@ CONSOLE = "console=tty0 console=ttyS0"
|
||||
GuestNumaConfig = collections.namedtuple(
|
||||
'GuestNumaConfig', ['cpuset', 'cputune', 'numaconfig', 'numatune'])
|
||||
|
||||
libvirt_volume_drivers = [
|
||||
'iscsi=nova.virt.libvirt.volume.LibvirtISCSIVolumeDriver',
|
||||
'iser=nova.virt.libvirt.volume.LibvirtISERVolumeDriver',
|
||||
'local=nova.virt.libvirt.volume.LibvirtVolumeDriver',
|
||||
'fake=nova.virt.libvirt.volume.LibvirtFakeVolumeDriver',
|
||||
'rbd=nova.virt.libvirt.volume.LibvirtNetVolumeDriver',
|
||||
'sheepdog=nova.virt.libvirt.volume.LibvirtNetVolumeDriver',
|
||||
'nfs=nova.virt.libvirt.volume.LibvirtNFSVolumeDriver',
|
||||
'smbfs=nova.virt.libvirt.volume.LibvirtSMBFSVolumeDriver',
|
||||
'aoe=nova.virt.libvirt.volume.LibvirtAOEVolumeDriver',
|
||||
'glusterfs=nova.virt.libvirt.volume.LibvirtGlusterfsVolumeDriver',
|
||||
'fibre_channel=nova.virt.libvirt.volume.LibvirtFibreChannelVolumeDriver',
|
||||
'scality=nova.virt.libvirt.volume.LibvirtScalityVolumeDriver',
|
||||
'gpfs=nova.virt.libvirt.volume.LibvirtGPFSVolumeDriver',
|
||||
'quobyte=nova.virt.libvirt.volume.LibvirtQuobyteVolumeDriver',
|
||||
]
|
||||
|
||||
|
||||
def patch_tpool_proxy():
|
||||
"""eventlet.tpool.Proxy doesn't work with old-style class in __str__()
|
||||
@ -416,7 +408,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
self.vif_driver = libvirt_vif.LibvirtGenericVIFDriver()
|
||||
|
||||
self.volume_drivers = driver.driver_dict_from_config(
|
||||
CONF.libvirt.volume_drivers, self)
|
||||
self._get_volume_drivers(), self)
|
||||
|
||||
self._disk_cachemode = None
|
||||
self.image_cache_manager = imagecache.ImageCacheManager()
|
||||
@ -472,6 +464,9 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
'expect': ', '.join("'%s'" % k for k in
|
||||
sysinfo_serial_funcs.keys())})
|
||||
|
||||
def _get_volume_drivers(self):
|
||||
return libvirt_volume_drivers
|
||||
|
||||
@property
|
||||
def disk_cachemode(self):
|
||||
if self._disk_cachemode is None:
|
||||
|
Loading…
Reference in New Issue
Block a user