mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
block: Add permissions to blk_new()
We want every user to be specific about the permissions it needs, so we'll pass the initial permissions as parameters to blk_new(). A user only needs to call blk_set_perm() if it wants to change the permissions after the fact. The permissions are stored in the BlockBackend and applied whenever a BlockDriverState should be attached in blk_insert_bs(). This does not include actually choosing the right set of permissions everywhere yet. Instead, the usual FIXME comment is added to each place and will be addressed in individual patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
parent
981776b348
commit
6d0eb64d5c
18 changed files with 53 additions and 30 deletions
|
@ -275,10 +275,12 @@ void commit_start(const char *job_id, BlockDriverState *bs,
|
|||
block_job_add_bdrv(&s->common, overlay_bs);
|
||||
}
|
||||
|
||||
s->base = blk_new();
|
||||
/* FIXME Use real permissions */
|
||||
s->base = blk_new(0, BLK_PERM_ALL);
|
||||
blk_insert_bs(s->base, base);
|
||||
|
||||
s->top = blk_new();
|
||||
/* FIXME Use real permissions */
|
||||
s->top = blk_new(0, BLK_PERM_ALL);
|
||||
blk_insert_bs(s->top, top);
|
||||
|
||||
s->active = bs;
|
||||
|
@ -328,10 +330,12 @@ int bdrv_commit(BlockDriverState *bs)
|
|||
}
|
||||
}
|
||||
|
||||
src = blk_new();
|
||||
/* FIXME Use real permissions */
|
||||
src = blk_new(0, BLK_PERM_ALL);
|
||||
blk_insert_bs(src, bs);
|
||||
|
||||
backing = blk_new();
|
||||
/* FIXME Use real permissions */
|
||||
backing = blk_new(0, BLK_PERM_ALL);
|
||||
blk_insert_bs(backing, bs->backing->bs);
|
||||
|
||||
length = blk_getlength(src);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue