pyocf: Use abstract Volume in generic code paths
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -13,7 +13,7 @@ from threading import Thread, Condition, Event
|
||||
from copy import deepcopy
|
||||
|
||||
from pyocf.utils import Size
|
||||
from pyocf.types.volume import RamVolume
|
||||
from pyocf.types.volume import Volume
|
||||
from pyocf.types.io import Io, IoDir
|
||||
from pyocf.types.data import Data
|
||||
|
||||
@@ -67,7 +67,7 @@ class JobSpec:
|
||||
qd: int = 1
|
||||
size: Size = Size(0)
|
||||
io_size: Size = Size(0)
|
||||
target: RamVolume = None
|
||||
target: Volume = None
|
||||
time_based: bool = False
|
||||
time: timedelta = None
|
||||
continue_on_error: bool = False
|
||||
@@ -211,7 +211,7 @@ class Rio:
|
||||
self.global_jobspec.qd = qd
|
||||
return self
|
||||
|
||||
def target(self, target: RamVolume):
|
||||
def target(self, target: Volume):
|
||||
self.global_jobspec.target = target
|
||||
return self
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ from .queue import Queue
|
||||
from .shared import Uuid, OcfCompletion, OcfError, SeqCutOffPolicy
|
||||
from .stats.core import CoreInfo
|
||||
from .stats.shared import UsageStats, RequestsStats, BlocksStats, ErrorsStats
|
||||
from .volume import RamVolume
|
||||
from .volume import Volume
|
||||
from ..ocf import OcfLib
|
||||
from ..utils import Size, struct_to_dict
|
||||
|
||||
@@ -58,7 +58,7 @@ class Core:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
device: RamVolume,
|
||||
device: Volume,
|
||||
name: str = "core",
|
||||
seq_cutoff_threshold: int = DEFAULT_SEQ_CUTOFF_THRESHOLD,
|
||||
seq_cutoff_promotion_count: int = DEFAULT_SEQ_CUTOFF_PROMOTION_COUNT,
|
||||
|
||||
@@ -12,8 +12,6 @@ from .cleaner import CleanerOps, Cleaner
|
||||
from .shared import OcfError
|
||||
from ..ocf import OcfLib
|
||||
from .queue import Queue
|
||||
from .volume import RamVolume
|
||||
|
||||
|
||||
class OcfCtxOps(Structure):
|
||||
_fields_ = [
|
||||
@@ -84,7 +82,7 @@ class OcfCtx:
|
||||
byref(self.volume_types[self.volume_types_count].get_props()),
|
||||
)
|
||||
if result != 0:
|
||||
raise OcfError("RamVolume type registration failed", result)
|
||||
raise OcfError("Volume type registration failed", result)
|
||||
|
||||
self.volume_types_count += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user