mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 00:32:13 +02:00
oe-selftest: test wic sparse_copy API
Added new parameter 'api' to sparse_copy function to specify underlying filemap API to use. By default sparse_copy will try both available APIs. Added test case for sparse_copy to wic test suite. (From OE-Core rev: 88701cef6ba399e82f96ed1b0eef9a44ed8c1687) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7792688ac2
commit
8838dd2dbd
@@ -530,9 +530,11 @@ def filemap(image, log=None):
|
||||
except ErrorNotSupp:
|
||||
return FilemapSeek(image, log)
|
||||
|
||||
def sparse_copy(src_fname, dst_fname, offset=0, skip=0):
|
||||
def sparse_copy(src_fname, dst_fname, offset=0, skip=0, api=None):
|
||||
"""Efficiently copy sparse file to or into another file."""
|
||||
fmap = filemap(src_fname)
|
||||
if not api:
|
||||
api = filemap
|
||||
fmap = api(src_fname)
|
||||
try:
|
||||
dst_file = open(dst_fname, 'r+b')
|
||||
except IOError:
|
||||
|
||||
Reference in New Issue
Block a user