[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 00/20] add byte-based block_status driver cal
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 00/20] add byte-based block_status driver callbacks |
Date: |
Thu, 30 Nov 2017 09:36:25 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/30/2017 07:04 AM, Vladimir Sementsov-Ogievskiy wrote:
Most of conversions looks fine, but it is not simple to prove the
correctness, because we start to use internal driver logic on offsets
and lengths, not aligned to sectors.
The block layer guarantees that it will not pass unaligned data to the
drivers, given the driver's definition of request_alignment. For
drivers that have a request_alignment of 1, you are correct that the
driver now sees requests at a smaller alignment than before, so it needs
to be carefully reviewed per-driver. But for drivers that are still
sector-based (where request_alignment is 512 for other reasons), there
is no change in behavior.
And we can't imagine the
consequences (at least, I can't and my r-b doesn't give the guarantee)
of such change. It is like take some function and expand its scope of
parameters.
May be I'm too paranoiac. May be it would be good to align requests
in bdrv_co_block_status to sectors at least for drivers which do not
provide request_alignment. May be each patch should be reviewed by
person, knowing that particular driver.
ALL drivers have request_alignment set to a non-zero value; it defaults
to 1 if the driver provides modern interfaces and does not override the
value, and defaults to 512 if the driver still uses older sector-based
interfaces. But I do welcome additional review; I have to post a v5 anyway.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org