From 887354bd13ecb7ff68ec26892806c97512b77877 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 10 Feb 2017 16:24:56 +0100 Subject: hmp: Request permissions in qemu-io The HMP command 'qemu-io' is a bit tricky because it wants to work on the original BlockBackend, but additional permissions could be required. The details are explained in a comment in the code, but in summary, just request whatever permissions the current qemu-io command needs. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block/block-backend.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'block/block-backend.c') diff --git a/block/block-backend.c b/block/block-backend.c index 38a3858e96..daa7908d01 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -584,6 +584,12 @@ int blk_set_perm(BlockBackend *blk, uint64_t perm, uint64_t shared_perm, return 0; } +void blk_get_perm(BlockBackend *blk, uint64_t *perm, uint64_t *shared_perm) +{ + *perm = blk->perm; + *shared_perm = blk->shared_perm; +} + static int blk_do_attach_dev(BlockBackend *blk, void *dev) { if (blk->dev) { -- cgit v1.2.3