block/backup: introduce BlockCopyState
commit2c8074c453ff13a94bd08ec26061917670ec03be
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 20 Sep 2019 14:20:46 +0000 (20 17:20 +0300)
committerMax Reitz <mreitz@redhat.com>
Thu, 10 Oct 2019 08:56:17 +0000 (10 10:56 +0200)
tree2d3b7f0da23b2322502005f7105f0dff979c0601
parent372c67ea6146cfa4e886ee33191d48cb2df5e99c
block/backup: introduce BlockCopyState

Split copying code part from backup to "block-copy", including separate
state structure and function renaming. This is needed to share it with
backup-top filter driver in further commits.

Notes:

1. As BlockCopyState keeps own BlockBackend objects, remaining
job->common.blk users only use it to get bs by blk_bs() call, so clear
job->commen.blk permissions set in block_job_create and add
job->source_bs to be used instead of blk_bs(job->common.blk), to keep
it more clear which bs we use when introduce backup-top filter in
further commit.

2. Rename s/initializing_bitmap/skip_unallocated/ to sound a bit better
as interface to BlockCopyState

3. Split is not very clean: there left some duplicated fields, backup
code uses some BlockCopyState fields directly, let's postpone it for
further improvements and keep this comment simpler for review.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20190920142056.12778-6-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/backup.c
block/trace-events