Merge new_io and configure - update tests
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
@@ -101,10 +101,10 @@ def test_10add_remove_with_io(pyocf_ctx):
|
||||
assert stats["conf"]["core_count"] == 1
|
||||
|
||||
write_data = Data.from_string("Test data")
|
||||
io = core.new_io()
|
||||
io = core.new_io(
|
||||
cache.get_default_queue(), 20, write_data.size, IoDir.WRITE, 0, 0
|
||||
)
|
||||
io.set_data(write_data)
|
||||
io.configure(20, write_data.size, IoDir.WRITE, 0, 0)
|
||||
io.set_queue(cache.get_default_queue())
|
||||
|
||||
cmpl = OcfCompletion([("err", c_int)])
|
||||
io.callback = cmpl.callback
|
||||
|
@@ -372,10 +372,10 @@ def run_io_and_cache_data_if_possible(exported_obj, mode, cls, cls_no):
|
||||
|
||||
|
||||
def io_to_core(exported_obj: Core, data: Data, offset: int, to_core_device=False):
|
||||
io = exported_obj.new_core_io() if to_core_device else exported_obj.new_io()
|
||||
new_io = exported_obj.new_core_io if to_core_device else exported_obj.new_io
|
||||
io = new_io(exported_obj.cache.get_default_queue(), offset, data.size,
|
||||
IoDir.WRITE, 0, 0)
|
||||
io.set_data(data)
|
||||
io.configure(offset, data.size, IoDir.WRITE, 0, 0)
|
||||
io.set_queue(exported_obj.cache.get_default_queue())
|
||||
|
||||
completion = OcfCompletion([("err", c_int)])
|
||||
io.callback = completion.callback
|
||||
@@ -387,10 +387,9 @@ def io_to_core(exported_obj: Core, data: Data, offset: int, to_core_device=False
|
||||
|
||||
def io_from_exported_object(exported_obj: Core, buffer_size: int, offset: int):
|
||||
read_buffer = Data(buffer_size)
|
||||
io = exported_obj.new_io()
|
||||
io.configure(offset, read_buffer.size, IoDir.READ, 0, 0)
|
||||
io = exported_obj.new_io(exported_obj.cache.get_default_queue(), offset,
|
||||
read_buffer.size, IoDir.READ, 0, 0)
|
||||
io.set_data(read_buffer)
|
||||
io.set_queue(exported_obj.cache.get_default_queue())
|
||||
|
||||
completion = OcfCompletion([("err", c_int)])
|
||||
io.callback = completion.callback
|
||||
|
Reference in New Issue
Block a user