All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v4 27/34] block: Use child_of_bds in remaining places
Date: Wed, 13 May 2020 16:08:25 -0500	[thread overview]
Message-ID: <3b34fc75-ca59-6c35-0093-a5b0230dcef3@redhat.com> (raw)
In-Reply-To: <20200513110544.176672-28-mreitz@redhat.com>

On 5/13/20 6:05 AM, Max Reitz wrote:
> Replace child_file by child_of_bds in all remaining places (excluding
> tests).
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   block.c              |  3 ++-
>   block/backup-top.c   |  4 ++--
>   block/blklogwrites.c |  4 ++--
>   block/raw-format.c   | 15 +++++++++++++--
>   4 files changed, 19 insertions(+), 7 deletions(-)
> 

> @@ -448,8 +449,18 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
>           return ret;
>       }
>   
> -    bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
> -                               false, errp);
> +    /*
> +     * Without offset and a size limit, this driver behaves very much
> +     * like a filter.  With any such limit, it does not.
> +     */
> +    if (offset || has_size) {
> +        file_role = BDRV_CHILD_DATA | BDRV_CHILD_PRIMARY;
> +    } else {
> +        file_role = BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY;
> +    }

I wonder if we'll hit subtle bugs where one but not the other use of raw 
breaks because of the difference in roles.  I know we have _some_ iotest 
coverage of raw with offsets, but wonder if we might need more (or a way 
to add it on top of existing images, similar to how we can easily toggle 
qcow2 options like refcount size for interesting non-default test runs).

> +
> +    bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
> +                               file_role, false, errp);
>       if (!bs->file) {
>           return -EINVAL;
>       }
> 

At any rate, if we have corner-case bugs, I don't think this is making 
them worse.
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-05-13 21:10 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 11:05 [PATCH v4 00/34] block: Introduce real BdrvChildRole Max Reitz
2020-05-13 11:05 ` [PATCH v4 01/34] block: Mark commit, mirror, blkreplay as filters Max Reitz
2020-05-13 11:05 ` [PATCH v4 02/34] block: Add BlockDriver.is_format Max Reitz
2020-05-13 11:05 ` [PATCH v4 03/34] block: Rename BdrvChildRole to BdrvChildClass Max Reitz
2020-05-13 11:05 ` [PATCH v4 04/34] block: Add BdrvChildRole and BdrvChildRoleBits Max Reitz
2020-05-13 17:36   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 05/34] block: Add BdrvChildRole to BdrvChild Max Reitz
2020-05-13 11:05 ` [PATCH v4 06/34] block: Pass BdrvChildRole to bdrv_child_perm() Max Reitz
2020-05-13 11:05 ` [PATCH v4 07/34] block: Pass BdrvChildRole to .inherit_options() Max Reitz
2020-05-13 11:05 ` [PATCH v4 08/34] block: Pass parent_is_format " Max Reitz
2020-05-13 11:05 ` [PATCH v4 09/34] block: Rename bdrv_inherited_options() Max Reitz
2020-05-13 11:05 ` [PATCH v4 10/34] block: Add generic bdrv_inherited_options() Max Reitz
2020-05-13 20:13   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 11/34] block: Use bdrv_inherited_options() Max Reitz
2020-05-13 20:18   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 12/34] block: Unify bdrv_child_cb_attach() Max Reitz
2020-05-13 20:26   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 13/34] block: Unify bdrv_child_cb_detach() Max Reitz
2020-05-13 20:27   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 14/34] block: Add child_of_bds Max Reitz
2020-05-13 20:29   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 15/34] block: Distinguish paths in *_format_default_perms Max Reitz
2020-05-13 20:30   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 16/34] block: Pull out bdrv_default_perms_for_cow() Max Reitz
2020-05-13 20:33   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 17/34] block: Pull out bdrv_default_perms_for_storage() Max Reitz
2020-05-13 11:05 ` [PATCH v4 18/34] block: Relax *perms_for_storage for data children Max Reitz
2020-05-13 20:38   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 19/34] block: Add bdrv_default_perms() Max Reitz
2020-05-13 20:43   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 20/34] raw-format: Split raw_read_options() Max Reitz
2020-05-13 11:05 ` [PATCH v4 21/34] block: Switch child_format users to child_of_bds Max Reitz
2020-05-13 11:05 ` [PATCH v4 22/34] block: Drop child_format Max Reitz
2020-05-13 11:05 ` [PATCH v4 23/34] block: Make backing files child_of_bds children Max Reitz
2020-05-13 20:46   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 24/34] block: Drop child_backing Max Reitz
2020-05-13 20:47   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 25/34] block: Make format drivers use child_of_bds Max Reitz
2020-05-13 11:05 ` [PATCH v4 26/34] block: Make filter " Max Reitz
2020-05-13 21:02   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 27/34] block: Use child_of_bds in remaining places Max Reitz
2020-05-13 21:08   ` Eric Blake [this message]
2020-05-13 11:05 ` [PATCH v4 28/34] tests: Use child_of_bds instead of child_file Max Reitz
2020-05-13 11:05 ` [PATCH v4 29/34] block: Use bdrv_default_perms() Max Reitz
2020-05-13 11:05 ` [PATCH v4 30/34] block: Make bdrv_filter_default_perms() static Max Reitz
2020-05-13 11:05 ` [PATCH v4 31/34] block: Drop bdrv_format_default_perms() Max Reitz
2020-05-13 11:05 ` [PATCH v4 32/34] block: Drop child_file Max Reitz
2020-05-13 21:11   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 33/34] block: Pass BdrvChildRole in remaining cases Max Reitz
2020-05-13 21:12   ` Eric Blake
2020-05-13 11:05 ` [PATCH v4 34/34] block: Drop @child_class from bdrv_child_perm() Max Reitz
2020-05-13 21:15   ` Eric Blake
2020-05-13 16:36 ` [PATCH v4 00/34] block: Introduce real BdrvChildRole Kevin Wolf
2020-05-14 13:44 ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b34fc75-ca59-6c35-0093-a5b0230dcef3@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.