aboutsummaryrefslogtreecommitdiff
path: root/blockjob.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-01-16 17:18:09 +0100
committerKevin Wolf <kwolf@redhat.com>2017-02-28 20:40:37 +0100
commitc6cc12bfa7bb9c61f4fa20491258b9bebc5b4771 (patch)
tree2e97207afd770a9ad87d9c7a6bb1a4109a872750 /blockjob.c
parentdabd18f64c8800d441fd9fb232c2102e8409aa2e (diff)
blockjob: Add permissions to block_job_create()
This functions creates a BlockBackend internally, so the block jobs need to tell it what they want to do with the BB. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'blockjob.c')
-rw-r--r--blockjob.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/blockjob.c b/blockjob.c
index 72b7d4c3f2..27833c7c0d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -123,7 +123,8 @@ void block_job_add_bdrv(BlockJob *job, BlockDriverState *bs)
}
void *block_job_create(const char *job_id, const BlockJobDriver *driver,
- BlockDriverState *bs, int64_t speed, int flags,
+ BlockDriverState *bs, uint64_t perm,
+ uint64_t shared_perm, int64_t speed, int flags,
BlockCompletionFunc *cb, void *opaque, Error **errp)
{
BlockBackend *blk;
@@ -160,8 +161,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
}
}
- /* FIXME Use real permissions */
- blk = blk_new(0, BLK_PERM_ALL);
+ blk = blk_new(perm, shared_perm);
ret = blk_insert_bs(blk, bs, errp);
if (ret < 0) {
blk_unref(blk);