Re: [qemu-web PATCH] Add a blog post about zoned storage emulation

2022-11-17 Thread Sam Li
> +title: "Introduction to Zoned Storage Emulation" > > +date: 2022-11-17 > > +author: Sam Li > > +categories: [storage, gsoc, outreachy, internships] > > +--- > > + > > +## Zoned block devices > > + > > +Aimed for at-scale data infr

Re: [qemu-web PATCH] Add a blog post about zoned storage emulation

2022-11-17 Thread Sam Li
Sam Li 于2022年11月18日周五 08:33写道: > > Stefan Hajnoczi 于2022年11月18日周五 03:12写道: > > > > Hi Sam, > > Please send a git repo URL so Thomas can fetch the commit without > > email/file size limitations. > > I'll push it to the zbd branch after fixing the bellowin

Re: [qemu-web PATCH] Add a blog post about zoned storage emulation

2022-11-23 Thread Sam Li
Thomas Huth 于2022年11月23日周三 20:48写道: > > On 17/11/2022 20.12, Stefan Hajnoczi wrote: > > Hi Sam, > > Please send a git repo URL so Thomas can fetch the commit without > > email/file size limitations. > > The size obviously comes from the PNG image ... since this seems to be a > photo, I think JPG w

[qemu-web PATCH v2] Add a blog post about zoned storage emulation

2022-11-27 Thread Sam Li
Signed-off-by: Sam Li --- _posts/2022-11-17-zoned-emulation.md | 69 1 file changed, 69 insertions(+) create mode 100644 _posts/2022-11-17-zoned-emulation.md diff --git a/_posts/2022-11-17-zoned-emulation.md b/_posts/2022-11-17-zoned-emulation.md new file mode

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

2022-11-29 Thread Sam Li
Stefan Hajnoczi 于2022年11月30日周三 10:01写道: > > On Thu, 27 Oct 2022 at 11:46, Sam Li wrote: > > > > Add a new zoned_host_device BlockDriver. The zoned_host_device option > > accepts only zoned host block devices. By adding zone management > > operations in this new Bloc

Re: [PATCH v13 0/8] Add support for zoned device

2022-11-29 Thread Sam Li
Stefan Hajnoczi 于2022年11月30日周三 10:04写道: > > On Thu, 27 Oct 2022 at 11:46, Sam Li wrote: > > v13: > > - add some tracing points for new zone APIs [Dmitry] > > - change error handling in zone_mgmt [Damien, Stefan] > > Hi Sam, > This looks very close! I sent comme

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

2022-12-05 Thread Sam Li
Stefan Hajnoczi 于2022年12月5日周一 20:20写道: > > On Wed, Nov 30, 2022 at 10:24:10AM +0800, Sam Li wrote: > > Stefan Hajnoczi 于2022年11月30日周三 10:01写道: > > > On Thu, 27 Oct 2022 at 11:46, Sam Li wrote: > > > > @@ -1374,9 +1428,11 @@ static int > > > &g

Re: [RFC v4 0/9] Add support for zoned device

2022-07-27 Thread Sam Li
Stefan Hajnoczi 于2022年7月27日周三 23:06写道: > > This patch series introduces the concept of zoned storage to the QEMU > block layer. Documentation is needed so that users and developers know > how to use and maintain this feature. > > As a minimum, let's document how to pass through zoned block devices

[RFC v5 00/11] Add support for zoned device

2022-07-31 Thread Sam Li
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 ioctls Sam Li (11): include: add zoned device st

[RFC v5 01/11] include: add zoned device structs

2022-07-31 Thread Sam Li
Signed-off-by: Sam Li --- 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 index fdb7306e78..c9d28b1c51 100644 --- a/include/block/block-common.h +++ b/include/block

[RFC v5 02/11] include: import virtio_blk headers from linux with zoned storage support

2022-07-31 Thread Sam Li
Add file from Dmitry's "virtio-blk:add support for zoned block devices" linux patch using scripts/update-linux-headers.sh. There is a link for more information: https://github.com/dmitry-fomichev/virtblk-zbd Signed-off-by: Sam Li --- include/standard-headers/linux/vir

[RFC v5 04/11] file-posix: introduce get_sysfs_str_val for device zoned model

2022-07-31 Thread Sam Li
Use sysfs attribute files to get the string value of device zoned model. Then get_sysfs_zoned_model can convert it to BlockZoneModel type in QEMU. Signed-off-by: Sam Li --- block/file-posix.c | 86 include/block/block_int-common.h | 3 ++ 2 files

[RFC v5 05/11] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-07-31 Thread Sam Li
-off-by: Sam Li --- block/block-backend.c| 47 ++ block/coroutines.h | 6 + block/file-posix.c | 272 ++- block/io.c | 57 +++ include/block/block-common.h | 1 - include/block/block-io.h

[RFC v5 03/11] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-07-31 Thread Sam Li
Use sysfs attribute files to get the long value of zoned device information. Signed-off-by: Sam Li --- block/file-posix.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 48cd096624..bcf898f0cb 100644

[RFC v5 07/11] config: add check to block layer

2022-07-31 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li --- block.c | 13 + block/file-posix.c | 2 ++ block/raw-format.c | 1 + include/block/block_int-common.h | 10 ++ 4 files

[RFC v5 10/11] qemu-iotests: test new zone operations

2022-07-31 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it with: Create a null_blk device, run each zone operation on it and see whether reporting right zone information. Signed-off-by: Sam Li --- tests/qemu-iotests/tests/zoned.out | 53 ++ tests/qemu-iotests/tests

[RFC v5 06/11] raw-format: add zone operations to pass through requests

2022-07-31 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 --- block/raw-format.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/raw-format.c b/block/raw-format.c index 69fd650eaf..6b20bd22ef

[RFC v5 09/11] qemu-io: add zoned block device operations.

2022-07-31 Thread Sam Li
Signed-off-by: Sam Li --- block/io.c | 24 ++--- qemu-io-cmds.c | 144 + 2 files changed, 148 insertions(+), 20 deletions(-) diff --git a/block/io.c b/block/io.c index a4625fb0e1..de9ec1d740 100644 --- a/block/io.c +++ b/block/io.c @

[RFC v5 11/11] docs/zoned-storage: add zoned device documentation

2022-07-31 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 68 ++ docs/system/qemu-block-drivers.rst.inc | 6 +++ 2 files changed, 74 insertions(+) create mode 100644 docs/devel/zoned

[RFC v5 08/11] virtio-blk: add zoned storage APIs for zoned devices

2022-07-31 Thread Sam Li
currently in the reviewing process. VIRTIO_BLK_F_ZONED will only be set if the host does support zoned block devices. The regular block device will not be set. The guest os having zoned device support can use blkzone(8) to test those commands. Signed-off-by: Sam Li --- block/block-backend.c

[PATCH v6 2/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-05 Thread Sam Li
Use sysfs attribute files to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke --- block/file-posix.c | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/block/file-posix.c b/block/file

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

2022-08-05 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- 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 index fdb7306e78..36bd0e480e 100644 --- a/include/block/block

[PATCH v6 3/8] file-posix: introduce get_sysfs_str_val for device zoned model

2022-08-05 Thread Sam Li
Use sysfs attribute files to get the string value of device zoned model. Then get_sysfs_zoned_model can convert it to BlockZoneModel type in QEMU. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke --- block/file-posix.c | 70 include/block

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

2022-08-05 Thread Sam Li
tes - 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 ioctls Sam Li

[PATCH v6 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-05 Thread Sam Li
), zone_reset(zrs), zone_finish(zf). For example, to test zone_report, use following command: $ ./build/qemu-io --image-opts driver=zoned_host_device, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke --- block/block-backend.c

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

2022-08-05 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 --- block/raw-format.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/raw-format.c b/block/raw-format.c

[PATCH v6 6/8] config: add check to block layer

2022-08-05 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 --- block.c | 13 + block/file-posix.c | 1 + block/raw-format.c | 1 + include/block/block_int

[PATCH v6 7/8] qemu-iotests: test new zone operations

2022-08-05 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it with: Create a null_blk device, run each zone operation on it and see whether reporting right zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned.out | 53

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

2022-08-05 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 41 ++ docs/system/qemu-block-drivers.rst.inc | 6 2 files changed, 47 insertions(+) create mode 100644 docs/devel

Re: [PATCH v6 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-07 Thread Sam Li
Sam Li 于2022年8月5日周五 15:58写道: > > By adding zone management operations in BlockDriver, storage controller > emulation can use the new block layer APIs including Report Zone and > four zone management operations (open, close, finish, reset). > > Add zoned storage commands of the d

Re: [PATCH v6 2/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-08 Thread Sam Li
Stefan Hajnoczi 于2022年8月8日周一 21:52写道: > > On Fri, Aug 05, 2022 at 03:57:45PM +0800, Sam Li wrote: > > Use sysfs attribute files to get the long value of zoned device > > information. > > > > Signed-off-by: Sam Li > > Reviewed-by: Hannes Reinecke

Re: [PATCH v6 3/8] file-posix: introduce get_sysfs_str_val for device zoned model

2022-08-08 Thread Sam Li
Stefan Hajnoczi 于2022年8月8日周一 21:52写道: > > On Fri, Aug 05, 2022 at 03:57:46PM +0800, Sam Li wrote: > > Use sysfs attribute files to get the string value of device > > zoned model. Then get_sysfs_zoned_model can convert it to > > BlockZoneModel type in QEMU. >

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Sam Li
Matthew Rosato 于2023年7月27日周四 19:46写道: > > On 7/5/23 10:54 AM, Matthew Rosato wrote: > > On 6/4/23 2:16 AM, Sam Li wrote: > >> The g_file_get_contents() function returns a g_boolean. If it fails, the > >> returned value will be 0 instead of -1. Solve the issue by ski

[PATCH v2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Sam Li
-by: Sam Li Reviewed-by: Matthew Rosato Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 9e8e3d8ca5..b16e9c21a1 100644 --- a/block/file-posix.c +++ b/block/file-posix.c

Re: [PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-02-19 Thread Sam Li
Markus Armbruster 于2024年2月19日周一 13:05写道: > > One more thing... > > Markus Armbruster writes: > > > I apologize for the delayed review. No problems. Thanks for reviewing! > > > > Sam Li writes: > > > >> To configure the zoned format feature o

Re: [PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-02-19 Thread Sam Li
Markus Armbruster 于2024年2月19日周一 15:40写道: > > Sam Li writes: > > > Markus Armbruster 于2024年2月19日周一 13:05写道: > >> > >> One more thing... > >> > >> Markus Armbruster writes: > >> > >> > I apologize for the delayed review. >

Re: [PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-02-19 Thread Sam Li
Markus Armbruster 于2024年2月19日周一 16:56写道: > > Sam Li writes: > > > Markus Armbruster 于2024年2月19日周一 15:40写道: > >> > >> Sam Li writes: > >> > >> > Markus Armbruster 于2024年2月19日周一 13:05写道: > >> >> > >> >> One mo

Re: [PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-02-19 Thread Sam Li
Markus Armbruster 于2024年2月19日周一 21:42写道: > > Sam Li writes: > > > Markus Armbruster 于2024年2月19日周一 16:56写道: > >> > >> Sam Li writes: > >> > >> > Markus Armbruster 于2024年2月19日周一 15:40写道: > >> >> > >>

Re: [PATCH] qemu-io: add cvtnum() error handling for zone commands

2024-05-07 Thread Sam Li
y cannot be represented. > > Reported-by: Peter Maydell > Cc: Sam Li > Signed-off-by: Stefan Hajnoczi > --- > qemu-io-cmds.c | 48 +++- > 1 file changed, 47 insertions(+), 1 deletion(-) Reviewed-by: Sam Li Hi Stefan, Thank you for fixi

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

2023-01-16 Thread Sam Li
Sam Li 于2022年10月27日周四 23:52写道: > > 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 emulation using regular writes. To do this, the file-posix > driver tracks the wp l

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

2023-03-23 Thread Sam Li
Matias Bjørling 于2023年3月23日周四 21:26写道: > > On 23/03/2023 06.28, Sam Li wrote: > > This patch adds zoned storage emulation to the virtio-blk driver. > > > > The patch implements the virtio-blk ZBD support standardization that is > > recently accepted by virtio-spec.

Re: [PATCH v8 2/4] virtio-blk: add zoned storage emulation for zoned devices

2023-03-23 Thread Sam Li
Matias Bjørling 于2023年3月23日周四 21:39写道: > > On 23/03/2023 06.28, Sam Li wrote: > > This patch extends virtio-blk emulation to handle zoned device commands > > by calling the new block layer APIs to perform zoned device I/O on > > behalf of the guest. It supports Report Zo

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

2023-03-24 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 v18 6/8] qemu-iotests: test new zone operations

2023-03-24 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 --- tests/qemu-iotests/tests

[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

  1   2   3   4   5   6   >