mbox series

[v2,0/2] Alignment checks cleanup

Message ID 20190827185913.27427-1-nsoffer@redhat.com (mailing list archive)
Headers show
Series Alignment checks cleanup | expand

Message

Nir Soffer Aug. 27, 2019, 6:59 p.m. UTC
While working on 4k support, I noticed that there is lot of code using
BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can work with
4k storage.

Lets start by cleaning up to make the code easier to understand:
- Use QEMU_IS_ALIGNED macro to check alignment
- Remove unneeded masks based on BDRV_SECTOR_SIZE

Nir Soffer (2):
  block: Use QEMU_IS_ALIGNED
  block: Remove unused masks

 block/bochs.c         | 4 ++--
 block/cloop.c         | 4 ++--
 block/dmg.c           | 4 ++--
 block/io.c            | 8 ++++----
 block/qcow2-cluster.c | 4 ++--
 block/qcow2.c         | 4 ++--
 block/vvfat.c         | 8 ++++----
 include/block/block.h | 2 --
 migration/block.c     | 2 +-
 qemu-img.c            | 2 +-
 10 files changed, 20 insertions(+), 22 deletions(-)

Comments

John Snow Aug. 28, 2019, 7:15 p.m. UTC | #1
On 8/27/19 2:59 PM, Nir Soffer wrote:
> While working on 4k support, I noticed that there is lot of code using
> BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can work with
> 4k storage.
> 
> Lets start by cleaning up to make the code easier to understand:
> - Use QEMU_IS_ALIGNED macro to check alignment
> - Remove unneeded masks based on BDRV_SECTOR_SIZE
> 
> Nir Soffer (2):
>   block: Use QEMU_IS_ALIGNED
>   block: Remove unused masks
> 
>  block/bochs.c         | 4 ++--
>  block/cloop.c         | 4 ++--
>  block/dmg.c           | 4 ++--
>  block/io.c            | 8 ++++----
>  block/qcow2-cluster.c | 4 ++--
>  block/qcow2.c         | 4 ++--
>  block/vvfat.c         | 8 ++++----
>  include/block/block.h | 2 --
>  migration/block.c     | 2 +-
>  qemu-img.c            | 2 +-
>  10 files changed, 20 insertions(+), 22 deletions(-)
> 

V2 changelog?

(Looks like adding patch 2 as a result of changing away users from the
BDRV_SECTOR_MASK.)

Reviewed-by: John Snow <jsnow@redhat.com>
Nir Soffer Aug. 30, 2019, 8:25 p.m. UTC | #2
On Wed, Aug 28, 2019 at 11:14 PM John Snow <jsnow@redhat.com> wrote:

>
>
> On 8/27/19 2:59 PM, Nir Soffer wrote:
> > While working on 4k support, I noticed that there is lot of code using
> > BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can
> work with
> > 4k storage.
> >
> > Lets start by cleaning up to make the code easier to understand:
> > - Use QEMU_IS_ALIGNED macro to check alignment
> > - Remove unneeded masks based on BDRV_SECTOR_SIZE
> >
> > Nir Soffer (2):
> >   block: Use QEMU_IS_ALIGNED
> >   block: Remove unused masks
> >
> >  block/bochs.c         | 4 ++--
> >  block/cloop.c         | 4 ++--
> >  block/dmg.c           | 4 ++--
> >  block/io.c            | 8 ++++----
> >  block/qcow2-cluster.c | 4 ++--
> >  block/qcow2.c         | 4 ++--
> >  block/vvfat.c         | 8 ++++----
> >  include/block/block.h | 2 --
> >  migration/block.c     | 2 +-
> >  qemu-img.c            | 2 +-
> >  10 files changed, 20 insertions(+), 22 deletions(-)
> >
>
> V2 changelog?


> (Looks like adding patch 2 as a result of changing away users from the
> BDRV_SECTOR_MASK.)
>

Right.

Changes since v1:
- Replace usage of BDRV_SECTOR_MASK in qcow2-cluster.c (Max)
- Remove unused masks

v1 was here:
https://lists.nongnu.org/archive/html/qemu-block/2019-08/msg00875.html


> Reviewed-by: John Snow <jsnow@redhat.com>


Thanks!
Nir Soffer Sept. 5, 2019, 8:45 a.m. UTC | #3
Max, can you review again?

On Fri, Aug 30, 2019 at 11:25 PM Nir Soffer <nsoffer@redhat.com> wrote:

> On Wed, Aug 28, 2019 at 11:14 PM John Snow <jsnow@redhat.com> wrote:
>
>>
>>
>> On 8/27/19 2:59 PM, Nir Soffer wrote:
>> > While working on 4k support, I noticed that there is lot of code using
>> > BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can
>> work with
>> > 4k storage.
>> >
>> > Lets start by cleaning up to make the code easier to understand:
>> > - Use QEMU_IS_ALIGNED macro to check alignment
>> > - Remove unneeded masks based on BDRV_SECTOR_SIZE
>> >
>> > Nir Soffer (2):
>> >   block: Use QEMU_IS_ALIGNED
>> >   block: Remove unused masks
>> >
>> >  block/bochs.c         | 4 ++--
>> >  block/cloop.c         | 4 ++--
>> >  block/dmg.c           | 4 ++--
>> >  block/io.c            | 8 ++++----
>> >  block/qcow2-cluster.c | 4 ++--
>> >  block/qcow2.c         | 4 ++--
>> >  block/vvfat.c         | 8 ++++----
>> >  include/block/block.h | 2 --
>> >  migration/block.c     | 2 +-
>> >  qemu-img.c            | 2 +-
>> >  10 files changed, 20 insertions(+), 22 deletions(-)
>> >
>>
>> V2 changelog?
>
>
>> (Looks like adding patch 2 as a result of changing away users from the
>> BDRV_SECTOR_MASK.)
>>
>
> Right.
>
> Changes since v1:
> - Replace usage of BDRV_SECTOR_MASK in qcow2-cluster.c (Max)
> - Remove unused masks
>
> v1 was here:
> https://lists.nongnu.org/archive/html/qemu-block/2019-08/msg00875.html
>
>
>> Reviewed-by: John Snow <jsnow@redhat.com>
>
>
> Thanks!
>
Max Reitz Sept. 10, 2019, 10:42 a.m. UTC | #4
On 27.08.19 20:59, Nir Soffer wrote:
> While working on 4k support, I noticed that there is lot of code using
> BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can work with
> 4k storage.
> 
> Lets start by cleaning up to make the code easier to understand:
> - Use QEMU_IS_ALIGNED macro to check alignment
> - Remove unneeded masks based on BDRV_SECTOR_SIZE
> 
> Nir Soffer (2):
>   block: Use QEMU_IS_ALIGNED
>   block: Remove unused masks
> 
>  block/bochs.c         | 4 ++--
>  block/cloop.c         | 4 ++--
>  block/dmg.c           | 4 ++--
>  block/io.c            | 8 ++++----
>  block/qcow2-cluster.c | 4 ++--
>  block/qcow2.c         | 4 ++--
>  block/vvfat.c         | 8 ++++----
>  include/block/block.h | 2 --
>  migration/block.c     | 2 +-
>  qemu-img.c            | 2 +-
>  10 files changed, 20 insertions(+), 22 deletions(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block


(I think you should check the setting of git config’s user.email in your
qemu directory.  Even if you send the patches through a gmail address
(which I don’t quite know why you’re doing that, but it isn’t like that
really matters), the patches should then still contain a “From: ” that
shows the actual author as set by user.name and user.email.)

Max