From 6d0eb64d5c6d57017c52a4f36ccae1db79215ee1 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 20 Jan 2017 17:07:26 +0100 Subject: 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 Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/qcow2.c') diff --git a/block/qcow2.c b/block/qcow2.c index ef028f6..0356e69 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3262,7 +3262,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts, } if (new_size) { - BlockBackend *blk = blk_new(); + BlockBackend *blk = blk_new(BLK_PERM_RESIZE, BLK_PERM_ALL); blk_insert_bs(blk, bs); ret = blk_truncate(blk, new_size); blk_unref(blk); -- cgit v1.1