qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 32/33] block: Pass BdrvChildRole in remaining cases


From: Eric Blake
Subject: Re: [PATCH v2 32/33] block: Pass BdrvChildRole in remaining cases
Date: Tue, 18 Feb 2020 06:53:14 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/18/20 6:01 AM, Max Reitz wrote:


Is it worth an assert(role) somewhere now that you've converted all
callers to pass at least one role?

Well, as the commit message states, block_job_add_bdrv() in blockjob.c
still passes BdrvChildRole=0 to bdrv_root_attach_child().  So it depends
on what function we’re looking at.

I suppose we could add such an assertion to bdrv_attach_child() because
we could expect all BDSs to pass some role for their children.

OTOH, maybe a BDS has a legitimate reason not to: Maybe it just wants to
take some permissions on some BDS without having any real relationship
to it.  Right now, some block jobs do that, well, except they do so
through the back door of adding the child BDS to the block job object
(which then passes no child role).  So maybe I’d actually rather not add
such an assertion anywhere.

Fair enough - you have more knowledge of which callers remain that still have a legitimate reason to not request a role.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]