All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/9] block: Add COR filter driver
Date: Wed, 25 Apr 2018 13:18:03 +0200	[thread overview]
Message-ID: <319c6e7b-c23c-09cd-4198-5b537a99c98c@redhat.com> (raw)
In-Reply-To: <w51in8g63r5.fsf@maestria.local.igalia.com>

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

On 2018-04-24 17:08, Alberto Garcia wrote:
> On Sat 21 Apr 2018 03:29:21 PM CEST, Max Reitz wrote:
>> This adds a simple copy-on-read filter driver.  It relies on the already
>> existing COR functionality in the central block layer code, which may be
>> moved here once we no longer need it there.
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
> 
> 
>> +#define PERM_PASSTHROUGH (BLK_PERM_CONSISTENT_READ \
>> +                          | BLK_PERM_WRITE \
>> +                          | BLK_PERM_RESIZE)
>> +#define PERM_UNCHANGED (BLK_PERM_ALL & ~PERM_PASSTHROUGH)
>> +
>> +static void cor_child_perm(BlockDriverState *bs, BdrvChild *c,
>> +                           const BdrvChildRole *role,
>> +                           BlockReopenQueue *reopen_queue,
>> +                           uint64_t perm, uint64_t shared,
>> +                           uint64_t *nperm, uint64_t *nshared)
>> +{
>> +    if (c == NULL) {
>> +        *nperm = (perm & PERM_PASSTHROUGH) | BLK_PERM_WRITE_UNCHANGED;
>> +        *nshared = (shared & PERM_PASSTHROUGH) | PERM_UNCHANGED;
>> +        return;
>> +    }
>> +
>> +    *nperm = (perm & PERM_PASSTHROUGH) |
>> +             (c->perm & PERM_UNCHANGED);
> 
> I admit I'm not completely familiar with this, but don't you need to add
> BLK_PERM_WRITE_UNCHANGED to *nperm ?

As long as it's requested in when the child is attached (which it is in
the "c == NULL" case), it should be part of c->perm then.

(And since PERM_PASSTHROUGH does not contain WRITE_UNCHANGED, it is part
of PERM_UNCHANGED.)

Max

>> +    *nshared = (shared & PERM_PASSTHROUGH) |
>> +               (c->shared_perm & PERM_UNCHANGED);
>> +}
> 
> Berto
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-04-25 11:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21 13:29 [Qemu-devel] [PATCH v2 0/9] block: Add COR filter driver Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 1/9] " Max Reitz
2018-04-24 15:08   ` Alberto Garcia
2018-04-25 11:18     ` Max Reitz [this message]
2018-04-25 11:35       ` Alberto Garcia
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 2/9] block: BLK_PERM_WRITE includes ..._UNCHANGED Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 3/9] block: Add BDRV_REQ_WRITE_UNCHANGED flag Max Reitz
2018-04-25 14:33   ` Eric Blake
2018-04-25 15:08     ` Max Reitz
2018-04-26  2:12       ` Eric Blake
2018-04-26  8:58         ` Kevin Wolf
2018-04-28 11:19         ` Max Reitz
2018-04-30  8:41           ` Kevin Wolf
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 4/9] block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 5/9] block/quorum: Support BDRV_REQ_WRITE_UNCHANGED Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 6/9] block: Support BDRV_REQ_WRITE_UNCHANGED in filters Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 7/9] iotests: Clean up wrap image in 197 Max Reitz
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 8/9] iotests: Copy 197 for COR filter driver Max Reitz
2018-04-24 15:17   ` Alberto Garcia
2018-04-21 13:29 ` [Qemu-devel] [PATCH v2 9/9] iotests: Add test for COR across nodes Max Reitz
2018-04-24 16:50   ` Kevin Wolf
2018-04-24 16:51 ` [Qemu-devel] [PATCH v2 0/9] block: Add COR filter driver Kevin Wolf
2018-04-25 12:18 ` Max Reitz
2018-04-25 14:36   ` Eric Blake

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=319c6e7b-c23c-09cd-4198-5b537a99c98c@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.