Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-15 Thread Kevin Wolf
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 case

Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-15 Thread Eric Blake
On 03/14/2017 10:06 PM, Fam Zheng wrote: >>> +static int bdrv_child_check_perm(BdrvChild *c, uint64_t perm, uint64_t >>> shared, >>> + GSList *ignore_children, Error **errp); >>> +static void bdrv_child_abort_perm_update(BdrvChild *c); >>> +static void bdrv_child_s

Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-15 Thread Fam Zheng
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 s

Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-15 Thread Kevin Wolf
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

Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-14 Thread Fam Zheng
On Tue, 03/14 08:28, Eric Blake wrote: > On 03/13/2017 09:30 PM, Fam Zheng wrote: > > bdrv_child_set_perm alone is not very usable because the caller must > > call bdrv_child_check_perm first. This is already encapsulated > > conveniently in bdrv_child_try_set_perm, so remove the other prototypes >

Re: [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-14 Thread Eric Blake
On 03/13/2017 09:30 PM, Fam Zheng wrote: > bdrv_child_set_perm alone is not very usable because the caller must > call bdrv_child_check_perm first. This is already encapsulated > conveniently in bdrv_child_try_set_perm, so remove the other prototypes > from the header and fix the one wrong caller,

[Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-13 Thread Fam Zheng
bdrv_child_set_perm alone is not very usable because the caller must call bdrv_child_check_perm first. This is already encapsulated conveniently in bdrv_child_try_set_perm, so remove the other prototypes from the header and fix the one wrong caller, block/mirror.c. Signed-off-by: Fam Zheng --- b