From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co7dK-0005N9-M7 for qemu-devel@nongnu.org; Wed, 15 Mar 2017 08:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co7dJ-0002s5-OT for qemu-devel@nongnu.org; Wed, 15 Mar 2017 08:02:26 -0400 Date: Wed, 15 Mar 2017 13:02:14 +0100 From: Kevin Wolf Message-ID: <20170315120214.GH4030@noname.str.redhat.com> References: <20170314023050.32756-1-famz@redhat.com> <20170315105248.GF4030@noname.str.redhat.com> <20170315110915.GC3088@lemon.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170315110915.GC3088@lemon.lan> Subject: Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, Max Reitz , qemu-block@nongnu.org Am 15.03.2017 um 12:09 hat Fam Zheng geschrieben: > On Wed, 03/15 11:52, Kevin Wolf wrote: > > Am 14.03.2017 um 03:30 hat Fam Zheng geschrieben: > > > bdrv_child_set_perm alone is not very usable because the caller must > > > call bdrv_child_check_perm first. > > > > Well, you can imagine use cases where you want to check multiple > > children first and then set or abort all of them, but apparently we > > haven't found such a case yet, so I'm fine with making the functions > > private for now. If we ever need it, making them public again is > > trivial. > > Yes, no problem with that use case but by then I suppose we should also add an > assertion about the calling sequence: e.g. in image locking, raw_set_perm goes > nut if not preceded by `raw_check_perm. Yes, that makes sense. Kevin