From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>,
Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
"fam@euphon.net" <fam@euphon.net>,
"berto@igalia.com" <berto@igalia.com>,
Denis Lunev <den@virtuozzo.com>,
"wencongyang2@huawei.com" <wencongyang2@huawei.com>,
"xiechanglong.d@gmail.com" <xiechanglong.d@gmail.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"jsnow@redhat.com" <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v7 1/3] block: include base when checking image chain for block allocation
Date: Fri, 21 Jun 2019 08:34:52 +0000 [thread overview]
Message-ID: <af775092-de7c-0068-bf64-16f3037d04b9@virtuozzo.com> (raw)
In-Reply-To: <e3cf99ae-62e9-8b6e-5a06-d3c8b9363b85@redhat.com>
19.06.2019 22:27, Max Reitz wrote:
> On 29.05.19 19:56, Andrey Shinkevich wrote:
>> This patch is used in the 'block/stream: introduce a bottom node'
>> that is following. Instead of the base node, the caller may pass
>> the node that has the base as its backing image to the function
>> bdrv_is_allocated_above() with a new parameter include_base = true
>> and get rid of the dependency on the base that may change during
>> commit/stream parallel jobs. Now, if the specified base is not
>> found in the backing image chain, the QEMU will abort.
>>
>> Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Reviewed-by: Alberto Garcia <berto@igalia.com>
>> ---
>> block/commit.c | 2 +-
>> block/io.c | 21 +++++++++++++++------
>> block/mirror.c | 2 +-
>> block/replication.c | 2 +-
>> block/stream.c | 2 +-
>> include/block/block.h | 3 ++-
>> 6 files changed, 21 insertions(+), 11 deletions(-)
>
> This needs the following hunk squashed in so it still compiles:
>
> (I can do that, if you agree.)
It will be great, thanks! (Andrey is on vocation now)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 9396d490d5..2a59eb27fe 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2148,7 +2148,8 @@ static bool is_unallocated(BlockDriverState *bs,
> int64_t offset, int64_t bytes)
> {
> int64_t nr;
> return !bytes ||
> - (!bdrv_is_allocated_above(bs, NULL, offset, bytes, &nr) && nr
> == bytes);
> + (!bdrv_is_allocated_above(bs, NULL, false, offset, bytes, &nr) &&
> + nr == bytes);
> }
>
> static bool is_zero_cow(BlockDriverState *bs, QCowL2Meta *m)
> diff --git a/qemu-img.c b/qemu-img.c
> index 158b3a505f..79983772de 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -3518,7 +3518,7 @@ static int img_rebase(int argc, char **argv)
> * to take action
> */
> ret = bdrv_is_allocated_above(backing_bs(bs),
> prefix_chain_bs,
> - offset, n, &n);
> + false, offset, n, &n);
> if (ret < 0) {
> error_report("error while reading image metadata: %s",
> strerror(-ret));
>
--
Best regards,
Vladimir
next prev parent reply other threads:[~2019-06-21 9:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 17:56 [Qemu-devel] [PATCH v7 0/3] block/stream: get rid of the base Andrey Shinkevich
2019-05-29 17:56 ` [Qemu-devel] [PATCH v7 1/3] block: include base when checking image chain for block allocation Andrey Shinkevich
2019-06-19 19:27 ` Max Reitz
2019-06-21 8:34 ` Vladimir Sementsov-Ogievskiy [this message]
2019-06-24 9:31 ` Andrey Shinkevich
2019-05-29 17:56 ` [Qemu-devel] [PATCH v7 2/3] block/stream: refactor stream_run: drop goto Andrey Shinkevich
2019-05-29 17:56 ` [Qemu-devel] [PATCH v7 3/3] block/stream: introduce a bottom node Andrey Shinkevich
2019-06-19 19:29 ` [Qemu-devel] [PATCH v7 0/3] block/stream: get rid of the base Max Reitz
2019-06-25 14:40 ` Andrey Shinkevich
2019-06-25 15:03 ` Max Reitz
2019-06-25 15:07 ` Andrey Shinkevich
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=af775092-de7c-0068-bf64-16f3037d04b9@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=andrey.shinkevich@virtuozzo.com \
--cc=berto@igalia.com \
--cc=den@virtuozzo.com \
--cc=fam@euphon.net \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wencongyang2@huawei.com \
--cc=xiechanglong.d@gmail.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 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).