qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/3] vpc: Do not return RAW from block_status
Date: Tue, 13 Aug 2019 16:49:22 +0200	[thread overview]
Message-ID: <b83773d6-ab7c-943d-d4f5-df4512e03510@redhat.com> (raw)
In-Reply-To: <20190813103838.GD4663@localhost.localdomain>


[-- Attachment #1.1: Type: text/plain, Size: 1796 bytes --]

On 13.08.19 12:38, Kevin Wolf wrote:
> Am 12.08.2019 um 17:56 hat Max Reitz geschrieben:
>> On 12.08.19 17:33, Vladimir Sementsov-Ogievskiy wrote:
>>> 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.
>>
>> Come on now.
>>
>>> 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..
>>
>> I think what you don’t understand is that if you have a vpc file inside
>> of a qcow2 file, you’re doing basically everything wrong. ;-)
>>
>> But maybe we should drop BDRV_BLOCK_RAW...  Does it do anything good for
>> us in the raw driver?  Shouldn’t it too just return DATA | RECURSE?
> 
> DATA | RECURSE is still DATA, i.e. marks the block as allocated. If you
> do that unconditionally, we will never consider a block unallocated.

Which is correct for formats that do not have backing files.

> RECURSE doesn't undo this, the only thing it might do is settting ZERO
> additionally.
> 
> So I would say unconditionally returning DATA | RECURSE is almost always
> wrong.

I would say it’s always right when it is a format driver and there is no
backing file.

Max


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

  reply	other threads:[~2019-08-13 14:49 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
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 [this message]
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=b83773d6-ab7c-943d-d4f5-df4512e03510@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).