qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/3] vpc: Do not return RAW from block_status
Date: Mon, 12 Aug 2019 15:33:30 +0000	[thread overview]
Message-ID: <627fbb64-5ffe-aca7-6198-9d991d4219e3@virtuozzo.com> (raw)
In-Reply-To: <20190725155512.9827-4-mreitz@redhat.com>

25.07.2019 18:55, Max Reitz wrote:
> vpc is not really a passthrough driver, even when using the fixed
> subformat (where host and guest offsets are equal).  It should handle
> preallocation like all other drivers do, namely by returning
> DATA | RECURSE instead of RAW.
> 
> There is no tangible difference but the fact that bdrv_is_allocated() no
> longer falls through to the protocol layer.

Hmm. Isn't a real bug (fixed by this patch) ?

Assume vpc->file is qcow2 with backing, which have "unallocated" region, which is
backed by actual data in backing file.

So, this region will be reported as not allocated and will be skipped by any copying
loop using block-status? Is it a bug of BDRV_BLOCK_RAW itself? Or I don't understand
something..

> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   block/vpc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/vpc.c b/block/vpc.c
> index d4776ee8a5..b25aab0425 100644
> --- a/block/vpc.c
> +++ b/block/vpc.c
> @@ -737,7 +737,7 @@ static int coroutine_fn vpc_co_block_status(BlockDriverState *bs,
>           *pnum = bytes;
>           *map = offset;
>           *file = bs->file->bs;
> -        return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID;
> +        return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_RECURSE;
>       }
>   
>       qemu_co_mutex_lock(&s->lock);
> 


-- 
Best regards,
Vladimir

  reply	other threads:[~2019-08-12 15:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 15:55 [Qemu-devel] [PATCH 0/3] block: Make various formats' block_status recurse again Max Reitz
2019-07-25 15:55 ` [Qemu-devel] [PATCH 1/3] vdi: Make block_status recurse for fixed images Max Reitz
2019-08-12 14:47   ` Vladimir Sementsov-Ogievskiy
2019-07-25 15:55 ` [Qemu-devel] [PATCH 2/3] vmdk: Make block_status recurse for flat extents Max Reitz
2019-08-12 14:59   ` Vladimir Sementsov-Ogievskiy
2019-07-25 15:55 ` [Qemu-devel] [PATCH 3/3] vpc: Do not return RAW from block_status Max Reitz
2019-08-12 15:33   ` Vladimir Sementsov-Ogievskiy [this message]
2019-08-12 15:56     ` Max Reitz
2019-08-12 16:50       ` Vladimir Sementsov-Ogievskiy
2019-08-12 19:07         ` Max Reitz
2019-08-13 10:38       ` Kevin Wolf
2019-08-13 14:49         ` Max Reitz
2019-08-12 18:39 ` [Qemu-devel] [Qemu-block] [PATCH 0/3] block: Make various formats' block_status recurse again John Snow
2019-08-12 19:11   ` Max Reitz
2019-08-12 21:45     ` John Snow
2019-08-13 14:48       ` Max Reitz
2019-08-13 22:35         ` John Snow
2019-08-15 15:49 ` [Qemu-devel] " Max Reitz

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=627fbb64-5ffe-aca7-6198-9d991d4219e3@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --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).