aboutsummaryrefslogtreecommitdiff
path: root/block/backup.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2018-03-10 03:27:27 -0500
committerKevin Wolf <kwolf@redhat.com>2018-03-19 12:01:24 +0100
commit75859b9420906f72c1c6d6273481ff30c141dbd5 (patch)
treea2f6e91fbe15a7c9531046dfa45d3311b89efb25 /block/backup.c
parentd4fce188448a273306b0c1c915e7bd91d6f83a6e (diff)
downloadqemu-75859b9420906f72c1c6d6273481ff30c141dbd5.zip
qemu-75859b9420906f72c1c6d6273481ff30c141dbd5.tar.gz
qemu-75859b9420906f72c1c6d6273481ff30c141dbd5.tar.bz2
blockjobs: model single jobs as transactions
model all independent jobs as single job transactions. It's one less case we have to worry about when we add more states to the transition machine. This way, we can just treat all job lifetimes exactly the same. This helps tighten assertions of the STM graph and removes some conditionals that would have been needed in the coming commits adding a more explicit job lifetime management API. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/backup.c')
-rw-r--r--block/backup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/backup.c b/block/backup.c
index 4a16a37..7e254da 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -621,7 +621,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
}
/* job->common.len is fixed, so we can't allow resize */
- job = block_job_create(job_id, &backup_job_driver, bs,
+ job = block_job_create(job_id, &backup_job_driver, txn, bs,
BLK_PERM_CONSISTENT_READ,
BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE |
BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD,
@@ -677,7 +677,6 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
&error_abort);
job->common.len = len;
- block_job_txn_add_job(txn, &job->common);
return &job->common;