[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/6] block: Fix permissions after bdrv_reopen()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 6/6] block: Fix permissions after bdrv_reopen() |
Date: |
Fri, 15 Sep 2017 14:06:34 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/15/2017 05:10 AM, Kevin Wolf wrote:
> If we switch between read-only and read-write, the permissions that
> image format drivers need on bs->file change, too. Make sure to update
> the permissions during bdrv_reopen().
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> include/block/block.h | 1 +
> block.c | 64
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 65 insertions(+)
>
> +static BlockReopenQueueEntry *find_parent_in_reopen_queue(BlockReopenQueue
> *q,
> + BdrvChild *c)
> +{
> + BlockReopenQueueEntry *entry;
> +
> + QSIMPLEQ_FOREACH(entry, q, entry) {
> + BlockDriverState *bs = entry->state.bs;
> + BdrvChild *child;
> +
> + QLIST_FOREACH(child, &bs->children, next) {
> + if (child == c) {
> + return entry;
An O(n^2) loop. Is it going to bite us at any point in the future, or
are we generally dealing with a small enough queue size and BDS graph to
not worry about it?
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 1/6] qemu-io: Reset qemuio_blk permissions before each command, (continued)
- [Qemu-devel] [PATCH 1/6] qemu-io: Reset qemuio_blk permissions before each command, Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 3/6] block: Add reopen queue to bdrv_check_perm(), Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 4/6] block: Base permissions on rw state after reopen, Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 2/6] block: Add reopen_queue to bdrv_child_perm(), Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 6/6] block: Fix permissions after bdrv_reopen(), Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 5/6] block: reopen: Queue children after their parents, Kevin Wolf, 2017/09/15
- [Qemu-devel] [PATCH 7/6] qemu-iotests: Test change-backing-file command, Kevin Wolf, 2017/09/15
- Re: [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen, Fam Zheng, 2017/09/18