[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension
From: |
Sam Li |
Subject: |
Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension |
Date: |
Mon, 28 Aug 2023 22:42:48 +0800 |
Stefan Hajnoczi <stefanha@redhat.com> 于2023年8月21日周一 21:31写道:
>
> On Mon, Aug 14, 2023 at 04:58:00PM +0800, Sam Li wrote:
> > diff --git a/block/qcow2.h b/block/qcow2.h
> > index f789ce3ae0..3694c8d217 100644
> > --- a/block/qcow2.h
> > +++ b/block/qcow2.h
> > @@ -236,6 +236,20 @@ typedef struct Qcow2CryptoHeaderExtension {
> > uint64_t length;
> > } QEMU_PACKED Qcow2CryptoHeaderExtension;
> >
> > +typedef struct Qcow2ZonedHeaderExtension {
> > + /* Zoned device attributes */
> > + uint8_t zoned_profile;
> > + uint8_t zoned;
> > + uint16_t reserved16;
> > + uint32_t zone_size;
> > + uint32_t zone_capacity;
>
> Should zone capacity be stored individually for each zone (alongside the
> write pointer and other per zone metadata) instead of as a global value
> for all zones? My understanding is that NVMe ZNS does not have a global
> value and each zone could have a different zone capacity value.
>
> > + uint32_t nr_zones;
>
> Is this field necessary since it can be derived from other image
> options: nr_zones = DIV_ROUND_UP(total_length, zone_capacity)?
Yes. The bs->total_sectors in refresh_limits is zero. Keeping a
persistent nr_zones helps assigning right value instead of zero.
The process is roughly like this:
*_qcow2_create: calculate nr_zones and write it to zoned_header
-> *_qcow2_update_header: update nr_zones
-> *_qcow2_read_extensions: read nr_zones in zoned_header to
Qcow2State and check if right (valid total size here)
-> *_refresh_limits(): set bl.nr_zones to zoned_header.nr_zones
Sam
- [PATCH v2 2/4] qcow2: add configurations for zoned format extension, (continued)
- [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Sam Li, 2023/08/14
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Stefan Hajnoczi, 2023/08/16
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Markus Armbruster, 2023/08/21
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Stefan Hajnoczi, 2023/08/21
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Sam Li, 2023/08/28
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Damien Le Moal, 2023/08/28
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Sam Li, 2023/08/28
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Damien Le Moal, 2023/08/28
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension, Sam Li, 2023/08/28
- Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension,
Sam Li <=
[PATCH v2 3/4] qcow2: add zoned emulation capability, Sam Li, 2023/08/14
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Stefan Hajnoczi, 2023/08/16
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Stefan Hajnoczi, 2023/08/22
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Sam Li, 2023/08/28
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Damien Le Moal, 2023/08/29
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Sam Li, 2023/08/29
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Damien Le Moal, 2023/08/29
- Re: [PATCH v2 3/4] qcow2: add zoned emulation capability, Sam Li, 2023/08/29
[PATCH v2 4/4] iotests: test the zoned format feature for qcow2 file, Sam Li, 2023/08/14