[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/17] block/nvme: Replace qemu_try_blockalign(bs) by qemu_tr
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 06/17] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz) |
Date: |
Fri, 26 Jun 2020 14:48:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 6/26/20 2:24 PM, Stefan Hajnoczi wrote:
> On Thu, Jun 25, 2020 at 08:48:27PM +0200, Philippe Mathieu-Daudé wrote:
>> qemu_try_blockalign() is a generic API that call back to the
>> block driver to return its page alignment. As we call from
>> within the very same driver, we already know to page alignment
>> stored in our state. Remove indirections and use the value from
>> BDRVNVMeState.
>
> The higher-level qemu_try_blockalign() API does not require all callers
> to be aware of the memory alignment details. It seems like a
> disadvantage to duplicate that knowledge throughout the code, even if
> it's in the same driver source code.
>
> Is there an advantage to this patch that I've missed?
This is required to later remove the BlockDriverState argument,
so nvme_init_queue() is per-hardware, not per-block-driver.
- Re: [PATCH 02/17] block/nvme: Let nvme_create_queue_pair() fail gracefully, (continued)
- [PATCH 07/17] block/nvme: Move code around, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 08/17] block/nvme: Use correct type void*, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 09/17] block/nvme: Remove unused argument from nvme_free_queue_pair(), Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 10/17] block/nvme: Simplify nvme_init_queue() arguments, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 11/17] block/nvme: Simplify nvme_create_queue_pair() arguments, Philippe Mathieu-Daudé, 2020/06/25