[PATCH v18 4/8] raw-format: add zone operations to pass through requests

2023-03-24 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block/raw-format.c | 17

[PATCH v18 2/8] file-posix: introduce helper functions for sysfs attributes

2023-03-24 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v18 8/8] docs/zoned-storage: add zoned device documentation

2023-03-24 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev --- docs/devel/zoned-storage.rst | 43 ++ docs/system/qemu-block

[PATCH v9 1/5] include: update virtio_blk headers to v6.3-rc1

2023-03-24 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 - include/standard-headers

[PATCH v18 0/8] Add support for zoned device

2023-03-24 Thread Sam Li
sfs attributes - address review comments * fix zone report bugs * fix the qemu-io code path * use thread pool to avoid blocking ioctl() calls v2: - add qemu-io sub-commands - address review comments * modify interfaces of APIs v1: - add block layer APIs resembling Linux ZoneBlockDevice

Re: [PATCH v9 5/5] docs/zoned-storage:add zoned emulation use case

2023-03-24 Thread Sam Li
Sam Li 于2023年3月24日周五 18:54写道: > > Add the documentation about the example of using virtio-blk driver > to pass the zoned block devices through to the guest. > > Signed-off-by: Sam Li > --- > docs/devel/zoned-storage.rst | 17 + > 1 file changed, 17 insert

[PATCH v9 0/5] Add zoned storage emulation to virtio-blk driver

2023-03-24 Thread Sam Li
using req->elem directly [Stefan] - fix error checkings and memory leak [Stefan] v2: - change units of emulated zone op coresponding to block layer APIs - modify error checking cases [Stefan, Damien] v1: - add zoned storage emulation Sam Li (5): include: update virtio_blk headers to v6.3-rc1

[PATCH v18 5/8] config: add check to block layer

2023-03-24 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block.c | 19 +++ block/file-posix.c | 12

[PATCH v18 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-03-24 Thread Sam Li
, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf --- block/block-backend.c | 133 + block/file-posix.c

[PATCH v18 7/8] block: add some trace events for new block layer APIs

2023-03-24 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 5fa80933c9..65efe5147e 100644 --- a/block/file-posix.c +++ b

[PATCH v9 2/5] virtio-blk: add zoned storage emulation for zoned devices

2023-03-24 Thread Sam Li
be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw/block

Re: [PATCH v17 6/8] qemu-iotests: test new zone operations

2023-03-24 Thread Sam Li
Stefan Hajnoczi 于2023年3月24日周五 03:31写道: > > On Thu, Mar 23, 2023 at 01:08:32PM +0800, Sam Li wrote: > > The new block layer APIs of zoned block devices can be tested by: > > $ tests/qemu-iotests/check zoned > > Run each zone operation on a newly created null_blk devic

[PATCH v9 1/5] include: update virtio_blk headers to v6.3-rc1

2023-03-24 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 - include/standard-headers

[PATCH v18 1/8] include: add zoned device structs

2023-03-24 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b

[PATCH v18 5/8] config: add check to block layer

2023-03-24 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block.c | 19 +++ block/file-posix.c | 12

[PATCH v9 4/5] virtio-blk: add some trace events for zoned emulation

2023-03-24 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b

[PATCH v9 3/5] block: add accounting for zone append operation

2023-03-24 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

[PATCH v9 0/5] Add zoned storage emulation to virtio-blk driver

2023-03-27 Thread Sam Li
add zoned storage emulation Sam Li (5): include: update virtio_blk headers to v6.3-rc1 virtio-blk: add zoned storage emulation for zoned devices block: add accounting for zone append operation virtio-blk: add some trace events for zoned emulation docs/zoned-storage:add zoned emulation use

[PATCH v9 5/5] docs/zoned-storage:add zoned emulation use case

2023-03-27 Thread Sam Li
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned

[PATCH v9 4/5] virtio-blk: add some trace events for zoned emulation

2023-03-27 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b

[PATCH v9 2/5] virtio-blk: add zoned storage emulation for zoned devices

2023-03-27 Thread Sam Li
be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw/block

[PATCH v9 1/5] include: update virtio_blk headers to v6.3-rc1

2023-03-27 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 - include/standard-headers

[PATCH v9 3/5] block: add accounting for zone append operation

2023-03-27 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

Re: [PATCH v7 1/4] file-posix: add tracking of the zone write pointers

2023-04-04 Thread Sam Li
Stefan Hajnoczi 于2023年4月4日周二 01:04写道: > > On Thu, Mar 23, 2023 at 01:19:04PM +0800, Sam Li wrote: > > Since Linux doesn't have a user API to issue zone append operations to > > zoned devices from user space, the file-posix driver is modified to add > > zone append e

[PATCH v8 3/4] qemu-iotests: test zone append operation

2023-04-04 Thread Sam Li
The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --

[PATCH v8 2/4] block: introduce zone append write for zoned devices

2023-04-04 Thread Sam Li
device will respond with the position where the data has been written in the zone. Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev --- block/block-backend.c | 60 +++ block/file-posix.c| 56 + block/io.c

[PATCH v8 0/4] Add zone append write for zoned device

2023-04-04 Thread Sam Li
ET_ALL related problems v2: - split patch to two patches for better reviewing - change BlockZoneWps's structure to an array of integers - use only mutex lock on locking conditions of zone wps - coding styles and clean-ups v1: - introduce zone append write Sam Li (4): file-posix: add trackin

[PATCH v8 1/4] file-posix: add tracking of the zone write pointers

2023-04-04 Thread Sam Li
to a zone - zone append Signed-off-by: Sam Li --- block/file-posix.c | 168 ++- include/block/block-common.h | 14 +++ include/block/block_int-common.h | 5 + 3 files changed, 184 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c b/block

[PATCH v8 4/4] block: add some trace events for zone append

2023-04-04 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index a7130b1024..825301467e 100644 --- a/block/file-posix.c +++ b

Re: [PATCH v9 0/5] Add zoned storage emulation to virtio-blk driver

2023-04-04 Thread Sam Li
Stefan Hajnoczi 于2023年4月3日周一 20:18写道: > > On Wed, 29 Mar 2023 at 01:01, Michael S. Tsirkin wrote: > > > > On Mon, Mar 27, 2023 at 10:45:48PM +0800, Sam Li wrote: > > > > virtio bits look ok. > > > > Reviewed-by: Michael S. Tsirkin > > > > m

[PATCH v9 4/4] block: add some trace events for zone append

2023-04-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 4e26641ce0..da986a33fd 100644 --- a/block/file-posix.c +++ b

[PATCH v9 3/4] qemu-iotests: test zone append operation

2023-04-07 Thread Sam Li
The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --

[PATCH v9 2/4] block: introduce zone append write for zoned devices

2023-04-07 Thread Sam Li
device will respond with the position where the data has been written in the zone. Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 60 +++ block/file-posix.c| 58

[PATCH v9 0/4] Add zone append write for zoned device

2023-04-07 Thread Sam Li
y of integers - use only mutex lock on locking conditions of zone wps - coding styles and clean-ups v1: - introduce zone append write Sam Li (4): file-posix: add tracking of the zone write pointers block: introduce zone append write for zoned devices qemu-iotests: test zone append operatio

[PATCH v9 1/4] file-posix: add tracking of the zone write pointers

2023-04-07 Thread Sam Li
to a zone - zone append Signed-off-by: Sam Li --- block/file-posix.c | 173 ++- include/block/block-common.h | 14 +++ include/block/block_int-common.h | 5 + 3 files changed, 189 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c b/block

[PATCH v10 0/5] Add zoned storage emulation to virtio-blk driver

2023-04-07 Thread Sam Li
zone APIs v3: - use qemuio_from_buffer to write status bit [Stefan] - avoid using req->elem directly [Stefan] - fix error checkings and memory leak [Stefan] v2: - change units of emulated zone op coresponding to block layer APIs - modify error checking cases [Stefan, Damien] v1: - add zoned stor

[PATCH v10 3/5] block: add accounting for zone append operation

2023-04-07 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

[PATCH v10 5/5] docs/zoned-storage:add zoned emulation use case

2023-04-07 Thread Sam Li
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned

[PATCH v10 1/5] include: update virtio_blk headers to v6.3-rc1

2023-04-07 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 - include/standard-headers

[PATCH v10 4/5] virtio-blk: add some trace events for zoned emulation

2023-04-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b

[PATCH v10 2/5] virtio-blk: add zoned storage emulation for zoned devices

2023-04-07 Thread Sam Li
be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw/block

Re: [PATCH v9 1/4] file-posix: add tracking of the zone write pointers

2023-04-10 Thread Sam Li
Stefan Hajnoczi 于2023年4月10日周一 21:04写道: > > On Fri, Apr 07, 2023 at 04:16:54PM +0800, Sam Li wrote: > > Since Linux doesn't have a user API to issue zone append operations to > > zoned devices from user space, the file-posix driver is modified to add > > zone append e

Re: [PATCH] block/file-posix: use unsigned int for zones consistently

2023-04-10 Thread Sam Li
unsigned comparisons. > > In practice I don't think zoned devices are likely to exceed MAX_INT > zones any time soon, so this is mostly a code cleanup. > > Cc: Sam Li > Cc: Dmitry Fomichev > Cc: Damien Le Moal > Signed-off-by: Stefan Hajnoczi > --- > bl

[PATCH v15 1/8] include: add zoned device structs

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h

[PATCH v15 0/8] Add support for zoned device

2023-01-29 Thread Sam Li
fs attributes - address review comments * fix zone report bugs * fix the qemu-io code path * use thread pool to avoid blocking ioctl() calls v2: - add qemu-io sub-commands - address review comments * modify interfaces of APIs v1: - add block layer APIs resembling Linux ZoneBlockDevice ioct

[PATCH v15 4/8] raw-format: add zone operations to pass through requests

2023-01-29 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block/raw-format.c | 13

[PATCH v15 2/8] file-posix: introduce helper functions for sysfs attributes

2023-01-29 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v15 6/8] qemu-iotests: test new zone operations

2023-01-29 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it as follows: Run each zone operation on a newly created null_blk device and see whether the logs show the correct zone information. By: $ ./tests/qemu-iotests/tests/zoned.sh Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi

[PATCH v15 7/8] block: add some trace events for new block layer APIs

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index f661f202a1..5cf92608db 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3272,6

[PATCH v15 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-01-29 Thread Sam Li
, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 147 ++ block/file-posix.c| 323 ++ block/io.c

[PATCH v15 5/8] config: add check to block layer

2023-01-29 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block.c | 19 +++ block/file-posix.c | 12

[PATCH v15 8/8] docs/zoned-storage: add zoned device documentation

2023-01-29 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev --- docs/devel/zoned-storage.rst | 43 ++ docs/system/qemu-block

[RFC v6 2/4] virtio-blk: add zoned storage emulation for zoned devices

2023-01-29 Thread Sam Li
be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw/block

[RFC v6 3/4] block: add accounting for zone append operation

2023-01-29 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 block/qapi.c | 15 ++ hw/block/virtio-blk.c

[RFC v6 1/4] include: update virtio_blk headers

2023-01-29 Thread Sam Li
Use scripts/update-linux-headers.sh to update virtio-blk headers from Dmitry's "virtio-blk:add support for zoned block devices" Linux patches. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/linux/vir

[RFC v6 0/4] Add zoned storage emulation to virtio-blk driver

2023-01-29 Thread Sam Li
ly [Stefan] - fix error checkings and memory leak [Stefan] v2: - change units of emulated zone op coresponding to block layer APIs - modify error checking cases [Stefan, Damien] v1: - add zoned storage emulation Sam Li (4): include: update virtio_blk headers virtio-blk: add zoned storage emulation fo

[RFC v6 4/4] virtio-blk: add some trace events for zoned emulation

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b

[PATCH v20 8/8] docs/zoned-storage: add zoned device documentation

2023-05-07 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-9-faithilike...@gmail.com [Add index-api.rst to fix

[PATCH v20 3/8] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-05-07 Thread Sam Li
, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-4-faithilike...@gmail.com [Adjust commit message prefix as suggested by Philip

[PATCH v20 1/8] block/block-common: add zoned device structs

2023-05-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-2-faithilike...@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé

[PATCH v20 6/8] iotests: test new zone operations

2023-05-07 Thread Sam Li
The new block layer APIs of zoned block devices can be tested by: $ tests/qemu-iotests/check zoned Run each zone operation on a newly created null_blk device and see whether it outputs the same zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Acked-by: Kevin Wolf Message-id

[PATCH v20 2/8] block/file-posix: introduce helper functions for sysfs attributes

2023-05-07 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v20 0/8] Add support for zoned device

2023-05-07 Thread Sam Li
v2: - add qemu-io sub-commands - address review comments * modify interfaces of APIs v1: - add block layer APIs resembling Linux ZoneBlockDevice ioctls Sam Li (8): block/block-common: add zoned device structs block/file-posix: introduce helper functions for sysfs attributes block/block-backen

[PATCH v20 5/8] block: add zoned BlockDriver check to block layer

2023-05-07 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-6-faithilike...@gmail.com [Adjust commit message prefix

[PATCH v20 7/8] block: add some trace events for new block layer APIs

2023-05-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-8-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff

[PATCH v20 4/8] block/raw-format: add zone operations to pass through requests

2023-05-07 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id

[PATCH v11 4/4] block: add some trace events for zone append

2023-05-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index aacb50d5aa..cd47167d04 100644 --- a/block/file-posix.c +++ b

[PATCH v11 1/4] file-posix: add tracking of the zone write pointers

2023-05-07 Thread Sam Li
to a zone - zone append Signed-off-by: Sam Li --- block/file-posix.c | 177 ++- include/block/block-common.h | 14 +++ include/block/block_int-common.h | 5 + 3 files changed, 193 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c b/block

[PATCH v11 2/4] block: introduce zone append write for zoned devices

2023-05-07 Thread Sam Li
device will respond with the position where the data has been written in the zone. Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 61 +++ block/file-posix.c| 58

[PATCH v11 3/4] qemu-iotests: test zone append operation

2023-05-07 Thread Sam Li
The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --

[PATCH v11 0/4] Add zone append write for zoned device

2023-05-07 Thread Sam Li
BlockZoneWps's structure to an array of integers - use only mutex lock on locking conditions of zone wps - coding styles and clean-ups v1: - introduce zone append write Sam Li (4): file-posix: add tracking of the zone write pointers block: introduce zone append write for zoned devices qemu

[PATCH v11 0/4] Add zoned storage emulation to virtio-blk driver

2023-05-07 Thread Sam Li
- modify error checking cases [Stefan, Damien] v1: - add zoned storage emulation Sam Li (4): virtio-blk: add zoned storage emulation for zoned devices block: add accounting for zone append operation virtio-blk: add some trace events for zoned emulation docs/zoned-storage:add zoned emulati

[PATCH v11 2/4] block: add accounting for zone append operation

2023-05-07 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

[PATCH v11 1/4] virtio-blk: add zoned storage emulation for zoned devices

2023-05-07 Thread Sam Li
be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw/block

[PATCH v11 4/4] docs/zoned-storage:add zoned emulation use case

2023-05-07 Thread Sam Li
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned

[PATCH v11 3/4] virtio-blk: add some trace events for zoned emulation

2023-05-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b

Re: [RFC v2] Adding block layer APIs resembling Linux ZoneBlockDevice ioctls.

2022-06-23 Thread Sam Li
Hi Stefan, Stefan Hajnoczi 于2022年6月20日周一 15:55写道: > > On Mon, Jun 20, 2022 at 11:36:11AM +0800, Sam Li wrote: > > Hi Sam, > Is this version 2 of "[RFC v1] Add support for zoned device"? Please > keep the email subject line the same (except for "v2", "

Re: [RFC v2] Adding block layer APIs resembling Linux ZoneBlockDevice ioctls.

2022-06-24 Thread Sam Li
Stefan Hajnoczi 于2022年6月24日周五 23:50写道: > > On Fri, Jun 24, 2022 at 11:14:32AM +0800, Sam Li wrote: > > Hi Stefan, > > > > Stefan Hajnoczi 于2022年6月20日周一 15:55写道: > > > > > > On Mon, Jun 20, 2022 at 11:36:11AM +0800, Sam Li wrote: > > > >

[RFC v3 0/5] *** Add support for zoned device ***

2022-06-26 Thread Sam Li
(developing) *** Sam Li (5): block: add block layer APIs resembling Linux ZonedBlockDevice ioctls. qemu-io: add zoned block device operations. file-posix: introduce get_sysfs_long_val for zoned device information. file-posix: introduce get_sysfs_str_val for device zoned model. qemu-iotests: add

[RFC v3 4/5] file-posix: introduce get_sysfs_str_val for device zoned model.

2022-06-26 Thread Sam Li
--- block/file-posix.c | 60 include/block/block-common.h | 4 +-- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 73c2cdfbca..74c0245e0f 100644 --- a/block/file-posix.c +++ b/block/file-p

[RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-26 Thread Sam Li
--- block/io.c | 21 +++ include/block/block-io.h | 13 + qemu-io-cmds.c | 121 +++ 3 files changed, 155 insertions(+) diff --git a/block/io.c b/block/io.c index 789e6373d5..656a1b7271 100644 --- a/block/io.c +++ b/block/io.c @

[RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-26 Thread Sam Li
By adding zone management operations in BlockDriver, storage controller emulation can use the new block layer APIs including zone_report and zone_mgmt(open, close, finish, reset). --- block/block-backend.c| 56 block/coroutines.h | 5 + block/file-posix.c

[RFC v3 5/5] qemu-iotests: add zone operation tests.

2022-06-26 Thread Sam Li
--- tests/qemu-iotests/tests/zoned.sh | 49 +++ 1 file changed, 49 insertions(+) create mode 100755 tests/qemu-iotests/tests/zoned.sh diff --git a/tests/qemu-iotests/tests/zoned.sh b/tests/qemu-iotests/tests/zoned.sh new file mode 100755 index 00..262c0b5427

[RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-26 Thread Sam Li
Use sysfs attribute files to get the zoned device information in case that ioctl() commands of zone management interface won't work. It can return long type of value like chunk_sectors, zoned_append_max_bytes, max_open_zones, max_active_zones. --- block/file-posix.c | 37 +-

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-27 Thread Sam Li
Hi Hannes, Hannes Reinecke 于2022年6月27日周一 15:21写道: > > On 6/27/22 02:19, Sam Li wrote: > > By adding zone management operations in BlockDriver, storage > > controller emulation can use the new block layer APIs including > > zone_report and zone_mgmt(op

Re: [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-27 Thread Sam Li
Hannes Reinecke 于2022年6月27日周一 15:31写道: > > On 6/27/22 02:19, Sam Li wrote: > > Use sysfs attribute files to get the zoned device information in case > > that ioctl() commands of zone management interface won't work. It can > > return long type of value like chunk_se

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-27 Thread Sam Li
Hannes Reinecke 于2022年6月27日周一 15:30写道: > > On 6/27/22 02:19, Sam Li wrote: > > --- > > Good coding style would advise to add some text here what the patch does. > > > block/io.c | 21 +++ > > include/block/block-io.h | 13 + >

Re: [RFC v3 4/5] file-posix: introduce get_sysfs_str_val for device zoned model.

2022-06-27 Thread Sam Li
Hannes Reinecke 于2022年6月27日周一 15:41写道: > > On 6/27/22 02:19, Sam Li wrote: > > --- > > block/file-posix.c | 60 > > include/block/block-common.h | 4 +-- > > 2 files changed, 62 insertions(+), 2 deletions(-) &

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > > On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > > diff --git a/block/block-backend.c b/block/block-backend.c > > index e0e1aff4b1..786f964d02 100644 > > --- a/block/block-backend.c > > +++ b/block/block-backend.c

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: > > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > > index 2f0d8ac25a..3f2592b9f5 100644 > > --- a/qemu-io-cmds.c > > +++ b/qemu-io-cmds.c > > @@ -1706,6

Re: [RFC v3 5/5] qemu-iotests: add zone operation tests.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:17AM +0800, Sam Li wrote: > > diff --git a/tests/qemu-iotests/tests/zoned.sh > > b/tests/qemu-iotests/tests/zoned.sh > > new file mode 100755 > > index 00..262c0b5427 > > --- /d

Re: [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:15AM +0800, Sam Li wrote: > > Use sysfs attribute files to get the zoned device information in case > > that ioctl() commands of zone management interface won't work. It can > > return long typ

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月28日周二 17:05写道: > > On 6/28/22 17:05, Sam Li wrote: > > Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > >> > >> On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > >>> diff --git a/block/block-backend.c b/block/block-backend.c

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月28日周二 17:11写道: > > On 6/28/22 16:56, Stefan Hajnoczi wrote: > > On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: > >> diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > >> index 2f0d8ac25a..3f2592b9f5 100644 > >> --- a/q

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月29日周三 09:43写道: > > On 6/28/22 19:23, Sam Li wrote: > > Damien Le Moal 于2022年6月28日周二 17:05写道: > >> > >> On 6/28/22 17:05, Sam Li wrote: > >>> Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > >>>> > >>>> On M

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月29日周三 10:32写道: > > On 6/29/22 10:50, Sam Li wrote: > >>>>>>> +rep_size = sizeof(struct blk_zone_report) + nrz * sizeof(struct > >>>>>>> blk_zone); > >>>>>>> +g_autof

Re: [PULL 00/20] Block patches

2023-04-24 Thread Sam Li
to 36e5e9b22abe56aa00ca067851555ad8127a7966: > > > > > >tracing: install trace events file only if necessary (2023-04-20 > > > 07:39:43 -0400) > > > > > >

[PATCH v19 5/8] block: add zoned BlockDriver check to block layer

2023-04-27 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-6-faithilike...@gmail.com [Adjust commit message prefix

[PATCH v19 2/8] block/file-posix: introduce helper functions for sysfs attributes

2023-04-27 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v19 4/8] block/raw-format: add zone operations to pass through requests

2023-04-27 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id

<    1   2   3   4   5   6   7   8   9   10   >