aboutsummaryrefslogtreecommitdiff
path: root/block/block-backend.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-02-10 16:24:56 +0100
committerKevin Wolf <kwolf@redhat.com>2017-02-28 20:47:50 +0100
commit887354bd13ecb7ff68ec26892806c97512b77877 (patch)
treeb6c36a3eeaaed92bf92e60ed601ec3e8648401f5 /block/block-backend.c
parent0db832f42e445398b2815cd740e9cd915e7dd644 (diff)
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 <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r--block/block-backend.c6
1 files changed, 6 insertions, 0 deletions
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) {