Configuration parameters are available in standby mode, while
stats are not. Need to separate the two.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
Make ErrorDevice a wraper over any type of volume rather than
inheriting from RamVolume. This way error injection layer can be added
over any type of volume.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
... since a started cache is required to construct a queue object.
Instead add params to control whether to construct and register
management and default I/O queue in start().
Additionally introducing Cache method to register additional I/O
queues.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This common interface is later going to be used for generic code
implementing cache/core exported object I/O.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
Volume object is never referenced from C code, so there
is no need to inherit from ctypes.Structure.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
.. instead of submit_core(). This will enable to reuse Io class
for cache exported object I/O.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
First try to clean only the mapping. This operation does not require any
rollback, so even if flushing collision fails, core object is still
intact. In case of error we inform user that core was not removed by
returning new error code (-OCF_ERR_CORE_NOT_REMOVED).
After flushing collision succeeds we remove core from metadata and
flush superblock at the end. At that point the core is fully removed
from OCF and even if superblock flush error occurs there is nothing we
can do about it, so we just return the error code.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Queue settle is a mechanism to wait for all OCF processing
on a given queue to finish.
In some tests simply waiting for I/O to finish is not enough. Most
notably some statistics are potentially incremented after user triggered
I/O is finished. This is due to asynchronous nature of I/O operations
and OCF approach to statistics update, where only eventual consistency
is guaranteed without explicit mechanism available to query whether
the final state is reached yet. However it is fully in the adapter power
to determine this, as OCF executes in context of API calls from the
adapter (like I/O submission, ocf_queue_run, ocf_cleaner_run, management
operations) and I/O completion callbacks. Queue settle is a mechanism to
assure ocf_queue_run is not being executed by the thread associated with
a queue.
With queue settle mechanism it is straightforward for the adapter to
wait for cache statistics to reach fixed values:
1. wait for all I/O to OCF to finish
2. settle all I/O queues
3. make sure background cleaner is not active
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>