qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com, kwolf@redhat.com,
	den@openvz.org
Subject: Re: [PATCH v2 4/7] block: add bdrv_refresh_perms() helper
Date: Mon, 9 Nov 2020 16:44:24 +0300	[thread overview]
Message-ID: <ced77269-b9a9-70d1-b850-ff43eaa0a7f4@virtuozzo.com> (raw)
In-Reply-To: <6bc178d3-8c9e-b2e9-8606-97a2b222d63a@virtuozzo.com>

09.11.2020 10:04, Vladimir Sementsov-Ogievskiy wrote:
> 06.11.2020 18:14, Alberto Garcia wrote:
>> On Fri 06 Nov 2020 01:42:38 PM CET, Vladimir Sementsov-Ogievskiy wrote:
>>> Make separate function for common pattern.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> ---
>>>   block.c | 60 ++++++++++++++++++++++++++++-----------------------------
>>>   1 file changed, 30 insertions(+), 30 deletions(-)
>>>
>>> diff --git a/block.c b/block.c
>>> index 77a3f8f1e2..fc7633307f 100644
>>> --- a/block.c
>>> +++ b/block.c
>>> @@ -2321,6 +2321,23 @@ static void bdrv_child_abort_perm_update(BdrvChild *c)
>>>       bdrv_abort_perm_update(c->bs);
>>>   }
>>> +static int bdrv_refresh_perms(BlockDriverState *bs, bool *tighten_restrictions,
>>> +                              Error **errp)
>>> +{
>>> +    int ret;
>>> +    uint64_t perm, shared_perm;
>>> +
>>> +    bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
>>> +    ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL,
>>> errp);
>>
>> Aren't you supposed to pass tighten_restrictions here ?
>>
> 
> Oops, yes I should
> 

So, squash-in:


diff --git a/block.c b/block.c
index fc7633307f..a96dc07364 100644
--- a/block.c
+++ b/block.c
@@ -2328,7 +2328,8 @@ static int bdrv_refresh_perms(BlockDriverState *bs, bool *tighten_restrictions,
      uint64_t perm, shared_perm;
  
      bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
-    ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, errp);
+    ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL,
+                          tighten_restrictions, errp);
      if (ret < 0) {
          bdrv_abort_perm_update(bs);
          return ret;



(produces simple conflict when applying "block: drop tighten_restrictions")

-- 
Best regards,
Vladimir


  reply	other threads:[~2020-11-09 13:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 12:42 [PATCH v2 0/7] block: permission update fix & refactor Vladimir Sementsov-Ogievskiy
2020-11-06 12:42 ` [PATCH v2 1/7] block: add forgotten bdrv_abort_perm_update() to bdrv_co_invalidate_cache() Vladimir Sementsov-Ogievskiy
2020-11-06 12:47   ` Alberto Garcia
2020-11-06 12:42 ` [PATCH v2 2/7] block: add bdrv_replace_node_common() Vladimir Sementsov-Ogievskiy
2020-11-06 15:27   ` Alberto Garcia
2020-11-06 12:42 ` [PATCH v2 3/7] block: make bdrv_drop_intermediate() less wrong Vladimir Sementsov-Ogievskiy
2020-11-06 15:12   ` Alberto Garcia
2020-11-06 12:42 ` [PATCH v2 4/7] block: add bdrv_refresh_perms() helper Vladimir Sementsov-Ogievskiy
2020-11-06 15:14   ` Alberto Garcia
2020-11-09  7:04     ` Vladimir Sementsov-Ogievskiy
2020-11-09 13:44       ` Vladimir Sementsov-Ogievskiy [this message]
2020-11-06 12:42 ` [PATCH v2 5/7] block: bdrv_set_perm() drop redundant parameters Vladimir Sementsov-Ogievskiy
2020-11-09 12:20   ` Max Reitz
2020-11-09 12:37     ` Vladimir Sementsov-Ogievskiy
2020-11-06 12:42 ` [PATCH v2 6/7] block: bdrv_child_set_perm() " Vladimir Sementsov-Ogievskiy
2020-11-09 12:41   ` Max Reitz
2020-11-06 12:42 ` [PATCH v2 7/7] block: drop tighten_restrictions Vladimir Sementsov-Ogievskiy
2020-11-09 13:40   ` Max Reitz
2020-11-09 14:41 ` [PATCH v2 0/7] block: permission update fix & refactor Max Reitz
2020-11-09 15:19   ` Vladimir Sementsov-Ogievskiy

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=ced77269-b9a9-70d1-b850-ff43eaa0a7f4@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=berto@igalia.com \
    --cc=den@openvz.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).