Skip to content

Commit

Permalink
Merge "libvirt: convert Scality vol driver to LibvirtBaseFileSystemVo…
Browse files Browse the repository at this point in the history
…lumeDriver"
  • Loading branch information
Jenkins authored and openstack-gerrit committed Aug 11, 2015
2 parents 26fcd5d + 30e7dca commit 868d05e
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions nova/virt/libvirt/volume/scality.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from nova import exception
from nova.i18n import _
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
from nova.virt.libvirt.volume import fs

LOG = logging.getLogger(__name__)

Expand All @@ -36,17 +36,34 @@
CONF.register_opts(volume_opts, 'libvirt')


class LibvirtScalityVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
class LibvirtScalityVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):
"""Scality SOFS Nova driver. Provide hypervisors with access
to sparse files on SOFS.
"""

def __init__(self, connection):
"""Create back-end to SOFS and check connection."""
super(LibvirtScalityVolumeDriver,
self).__init__(connection, is_block_dev=False)
def _get_mount_point_base(self):
return CONF.libvirt.scality_sofs_mount_point

def _get_device_path(self, connection_info):
"""Returns the hashed path to the device.
:param connection_info: dict of the form
::
connection_info = {
'data': {
'sofs_path': the file system share
...
}
...
}
:returns: The full path to the device.
"""
# TODO(mriedem): change the scality volume driver in cinder to set
# the export and name keys rather than the sofs_path so this is
# standardized.
path = os.path.join(CONF.libvirt.scality_sofs_mount_point,
connection_info['data']['sofs_path'])
return path
Expand Down

0 comments on commit 868d05e

Please sign in to comment.