block: Add "drained begin/end" for transactional backup
commit1fdd4b7be3655d39c3594bc215eb1df5ce225c7d
authorFam Zheng <famz@redhat.com>
Fri, 23 Oct 2015 03:08:11 +0000 (23 11:08 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Oct 2015 16:18:24 +0000 (23 18:18 +0200)
tree3bc0dfa56410b2993c17b74df388f5e42c351ef3
parentda763e83012c066ebe3effbaa8e7e7c8f78b0fbf
block: Add "drained begin/end" for transactional backup

This ensures the atomicity of the transaction by avoiding processing of
external requests such as those from ioeventfd.

Move the assignment to state->bs up right after bdrv_drained_begin, so
that we can use it in the clean callback. The abort callback will still
check bs->job and state->job, so it's OK.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c