Add supported file system type check at virt layer

Currently nova doesn't check whether the file system type is supported
by virt layer(hypervisor) before use it. This patch adds current
support file system type definition then create a default check
function at virt layer. Following patches will do the real check
in different driver such as libvirt.

Change-Id: Ie4d876a48b36c1a53b171dd521bdeef868a31486
Partial-Bug: #1293880
This commit is contained in:
jichenjc 2014-06-09 04:13:18 +08:00
parent f766da15ab
commit 89cd2f9a4d
2 changed files with 20 additions and 0 deletions

View File

@ -80,6 +80,14 @@ CONF.import_opt('default_ephemeral_format', 'nova.virt.driver')
_MKFS_COMMAND = {}
_DEFAULT_MKFS_COMMAND = None
FS_FORMAT_EXT2 = "ext2"
FS_FORMAT_EXT3 = "ext3"
FS_FORMAT_EXT4 = "ext4"
FS_FORMAT_XFS = "xfs"
FS_FORMAT_NTFS = "ntfs"
FS_FORMAT_VFAT = "vfat"
_DEFAULT_FS_BY_OSTYPE = {'linux': 'ext3',
'windows': 'ntfs'}

View File

@ -1273,6 +1273,18 @@ class ComputeDriver(object):
"""Default the missing device names in the block device mapping."""
raise NotImplementedError()
def is_supported_fs_format(self, fs_type):
"""Check whether the file format is supported by this driver
:param fs_type: the file system type to be checked,
the validate values are defined at disk API module.
"""
# NOTE(jichenjc): Return False here so that every hypervisor
# need to define their supported file system
# type and implement this function at their
# virt layer.
return False
def load_compute_driver(virtapi, compute_driver=None):
"""Load a compute driver module.