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

2023-04-27 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 v19 3/8] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-04-27 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 v19 1/8] block/block-common: add zoned device structs

2023-04-27 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 v19 7/8] block: add some trace events for new block layer APIs

2023-04-27 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 v19 0/8] Add support for zoned device

2023-04-27 Thread Sam Li
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-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls block/raw-format: add zone operations to

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

2023-04-27 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 v10 0/4] Add zone append write for zoned device

2023-04-27 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 v10 1/4] file-posix: add tracking of the zone write pointers

2023-04-27 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 v10 4/4] block: add some trace events for zone append

2023-04-27 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 8fc7f73d2c..5f1745ede8 100644 --- a/block/file-posix.c +++ b

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

2023-04-27 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 v10 3/4] qemu-iotests: test zone append operation

2023-04-27 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 v16 1/8] include: add zoned device structs

2023-03-10 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 v16 0/8] Add support for zoned device

2023-03-10 Thread Sam Li
o 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 (8): include: add zoned device structs file-posix: introduce helper functions for sysfs attributes

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

2023-03-10 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 v16 2/8] file-posix: introduce helper functions for sysfs attributes

2023-03-10 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 v16 4/8] raw-format: add zone operations to pass through requests

2023-03-10 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 v16 7/8] block: add some trace events for new block layer APIs

2023-03-10 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 2eceb250f1..563acc76ae 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3256,6

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

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

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

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

2023-03-10 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 v6 0/4] Add zone append write for zoned device

2023-03-10 Thread Sam Li
s 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 operation block: add some trace events for zone append block/block-backend.c | 60

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

2023-03-10 Thread Sam Li
This tests is mainly a helper to indicate append writes in block layer behaves as expected. Signed-off-by: Sam Li --- qemu-io-cmds.c | 65 ++ tests/qemu-iotests/tests/zoned.out | 7 tests/qemu-iotests/tests/zoned.sh | 9 + 3 files

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

2023-03-10 Thread Sam Li
position the data has been written in the zone. Signed-off-by: Sam Li --- block/block-backend.c | 60 +++ block/file-posix.c| 54 +--- block/io.c| 21 +++ block/io_uring.c

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

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

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

2023-03-10 Thread Sam Li
Signed-off-by: Sam Li --- 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 2ba9174778..5187f810e5 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2489,6 +2489,8 @@ out: if

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

2023-03-10 Thread Sam Li
- 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 storage emulation Sam Li (4):

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

2023-03-10 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 v7 2/4] virtio-blk: add zoned storage emulation for zoned devices

2023-03-10 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 v7 4/4] virtio-blk: add some trace events for zoned emulation

2023-03-10 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 v7 3/4] block: add accounting for zone append operation

2023-03-10 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

Re: [PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set

2023-03-10 Thread Sam Lantinga
ng on QEMU... or, if you want tighter integration, you can set an SDL log handler that feeds into the QEMU tracing system. On Thu, Mar 9, 2023 at 9:18 PM Marc-André Lureau < marcandre.lur...@redhat.com> wrote: > Hi > > (adding Sam Lantinga, SDL maintainer, in CC. I noticed he wor

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

2023-03-15 Thread Sam Li
+wps->wp[i] = i * bs->bl.zone_size; > > > > This will reset write pointers of all read-only zones that may exist on the > > device and make the data stored in those zones unreadable. R/O zones need > > to be > > skipped in this loop. > > And offline zones need to be skipped as well. I see. That can be done thanks to get_zones_wp() which can show the state of the zone at specific position. Sam

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

2023-03-16 Thread Sam Li
Stefan Hajnoczi 于2023年3月17日周五 03:46写道: > > On Fri, Mar 10, 2023 at 06:54:27PM +0800, 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 acc

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

2023-03-22 Thread Sam Li
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 (8): include: add zoned device structs

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

2023-03-22 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 v17 1/8] include: add zoned device structs

2023-03-22 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 v17 7/8] block: add some trace events for new block layer APIs

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

2023-03-22 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 v17 4/8] raw-format: add zone operations to pass through requests

2023-03-22 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 v17 5/8] config: add check to block layer

2023-03-22 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 v17 8/8] docs/zoned-storage: add zoned device documentation

2023-03-22 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 v17 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-03-22 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 v7 0/4] Add zone append write for zoned device

2023-03-22 Thread Sam Li
tate checks in zone_mgmt command [Damien] - fix RESET_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 appe

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

2023-03-22 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| 58 ++ block/io.c

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

2023-03-22 Thread Sam Li
Signed-off-by: Sam Li 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 60ad3970f3..9866d073f5 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2497,6

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

2023-03-22 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, 183 insertions(+), 4 deletions(-) diff --git a/block/file-posix.c b/block

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

2023-03-22 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 --- qemu-io-cmds.c

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

2023-03-22 Thread Sam Li
d 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 to v6.3-rc1 virtio-blk: add zoned storage emulation for zoned devices

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

2023-03-22 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 v8 3/4] block: add accounting for zone append operation

2023-03-22 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

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

2023-03-22 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 v8 2/4] virtio-blk: add zoned storage emulation for zoned devices

2023-03-22 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

QEMU issue on Windows with WHPX Acceleration

2022-01-05 Thread Sam Williams
See reddit post: https://www.reddit.com/r/VFIO/comments/l9bl8b/anyone_able_to_run_qemu_52_git_master_on_windows/ This is all the info I have on this, it's all in the reddit post.

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

2022-08-15 Thread Sam Li
l() 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 (8): include: add zoned device structs file-posix: introduce get_sysfs_str_val for device zoned model file-posix: introduc

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

2022-08-15 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 | 14 ++ block/raw-format.c | 1 + include/block/block_int-common.h | 5 + 3 files changed, 20

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

2022-08-15 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 Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/file-posix.c b/block/file

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

2022-08-15 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 v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-15 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 v7 7/8] qemu-iotests: test new zone operations

2022-08-15 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 v7 5/8] raw-format: add zone operations to pass through requests

2022-08-15 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 v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model

2022-08-15 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 | 93 ++-- include/block

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

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

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

2022-08-16 Thread Sam Li
Sam Li 于2022年8月16日周二 14:25写道: > > 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

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

2022-08-16 Thread Sam Li
Sam Li 于2022年8月16日周二 14:25写道: > > Use sysfs attribute files to get the long value of zoned device > information. > > Signed-off-by: Sam Li > Reviewed-by: Hannes Reinecke > Reviewed-by: Stefan Hajnoczi > --- > block/file-posix.c | 27 +++ >

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

2022-08-16 Thread Sam Li
Damien Le Moal 于2022年8月17日周三 01:35写道: > > On 2022/08/15 23:25, 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 > > Reviewed-by: Stefan Hajn

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

2022-08-22 Thread Sam Li
Stefan Hajnoczi 于2022年8月23日周二 08:49写道: > > On Tue, Aug 16, 2022 at 02:25:18PM +0800, Sam Li wrote: > > By adding zone management operations in BlockDriver, storage controller > > emulation can use the new block layer APIs including Report Zone and > > four zone management

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

2022-08-22 Thread Sam Li
Stefan Hajnoczi 于2022年8月23日周二 08:54写道: > > On Tue, Aug 16, 2022 at 02:25:20PM +0800, Sam Li wrote: > > Putting zoned/non-zoned BlockDrivers on top of each other is not > > allowed. > > > > Signed-off-by: Sam Li > > Reviewed-by: Stefan Hajnoczi > > ---

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

2022-08-22 Thread Sam Li
Stefan Hajnoczi 于2022年8月23日周二 07:05写道: > > On Tue, Aug 16, 2022 at 02:25:16PM +0800, Sam Li wrote: > > +static int hdev_get_max_segments(int fd, struct stat *st) { > > +int ret; > > +if (S_ISCHR(st->st_mode)) { > > +if (ioctl(fd, SG_GET_SG_TABLE

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

2022-08-26 Thread Sam Li
Damien Le Moal 于2022年8月17日周三 01:50写道: > > On 2022/08/15 23:25, Sam Li wrote: > > 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 (op

[PATCH v8 0/7] Add support for zoned device

2022-08-26 Thread Sam Li
nctions to get sysfs 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 ZoneBlockD

[PATCH v8 1/7] include: add zoned device structs

2022-08-26 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- 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

[PATCH v8 2/7] file-posix: introduce helper funcations for sysfs attributes

2022-08-26 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 in 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 v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-26 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 v8 5/7] config: add check to block layer

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

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

2022-08-26 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 v8 6/7] qemu-iotests: test new zone operations

2022-08-26 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 v8 7/7] docs/zoned-storage: add zoned device documentation

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

Re: [PATCH v8 5/7] config: add check to block layer

2022-08-28 Thread Sam Li
Sam Li 于2022年8月27日周六 00:21写道: > > Putting zoned/non-zoned BlockDrivers on top of each other is not > allowed. > > Signed-off-by: Sam Li > Reviewed-by: Stefan Hajnoczi > --- > block.c | 14 ++ > block/file-posix.c

[PATCH v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-29 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

Re: [PATCH v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-29 Thread Sam Li
Sam Li 于2022年8月29日周一 20:53写道: > > 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 comm

Re: [PATCH v8 0/7] Add support for zoned device

2022-08-29 Thread Sam Li
Stefan Hajnoczi 于2022年8月30日周二 03:44写道: > > On Fri, Aug 26, 2022 at 11:15:29PM +0800, Sam Li wrote: > > Zoned Block Devices (ZBDs) devide the LBA space to block regions called > > zones > > that are larger than the LBA size. It can only allow sequential writes, >

Re: [PATCH v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-30 Thread Sam Li
Markus Armbruster 于2022年8月30日周二 19:57写道: > > Sam Li writes: > > > 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

Re: [PATCH v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-30 Thread Sam Li
Markus Armbruster 于2022年8月30日周二 23:09写道: > > Sam Li writes: > > > Markus Armbruster 于2022年8月30日周二 19:57写道: > >> > >> Sam Li writes: > >> > >> > By adding zone management operations in BlockDriver, storage controller > >> > em

Re: [PATCH v8 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-31 Thread Sam Li
Markus Armbruster 于2022年8月31日周三 16:35写道: > > Sam Li writes: > > > Markus Armbruster 于2022年8月30日周二 19:57写道: > >> > >> Sam Li writes: > >> > >> > By adding zone management operations in BlockDriver, storage controller > >> > em

Re: [RFC v4 3/3] virtio-blk: add some trace events for zoned emulation

2022-11-03 Thread Sam Li
Philippe Mathieu-Daudé 于2022年11月3日周四 05:21写道: > > Hi, > > On 30/10/22 10:32, Sam Li wrote: > > Signed-off-by: Sam Li > > --- > > hw/block/trace-events | 7 +++ > > hw/block/virtio-blk.c | 12 > > 2 files changed, 19 insertions(+) &g

Re: [RFC v4 2/3] virtio-blk: add zoned storage emulation for zoned devices

2022-11-03 Thread Sam Li
Stefan Hajnoczi 于2022年11月3日周四 04:58写道: > > On Sun, Oct 30, 2022 at 05:32:41AM -0400, 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.

[PATCH] block/io_uring: revert "Use io_uring_register_ring_fd() to skip fd operations"

2022-09-24 Thread Sam Li
a1125a and 77e3f038af1764983087e3551a0fde9951952c4d. Signed-off-by: Sam Li --- block/io_uring.c | 13 + meson.build | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/block/io_uring.c b/block/io_uring.c index a1760152e0..973e15d876 100644 --- a/block/io_uring.c +

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

2022-09-28 Thread Sam Li
Stefan Hajnoczi 于2022年9月20日周二 05:31写道: > > On Sat, Sep 10, 2022 at 02:50:57PM +0800, 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.

[PATCH v10 2/7] file-posix: introduce helper functions for sysfs attributes

2022-09-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 v10 1/7] include: add zoned device structs

2022-09-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- 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

[PATCH v10 7/7] docs/zoned-storage: add zoned device documentation

2022-09-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 --- docs/devel/zoned-storage.rst | 40 ++ docs/system/qemu-block-drivers.rst.inc | 6 2 files changed, 46 insertions

[PATCH v10 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-09-29 Thread Sam Li
"zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke --- block/block-backend.c | 146 + block/file-posix.c| 340 +- block/io.c| 41 include/block/block-common.h

[PATCH v10 6/7] qemu-iotests: test new zone operations

2022-09-29 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 v10 0/7] Add support for zoned device

2022-09-29 Thread Sam Li
ol 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 (7): include: add zoned device structs file-posix: introduce helper functions for sysfs attribute

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

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

[PATCH v10 5/7] config: add check to block layer

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

[PATCH v2 0/2] add zone append write for zoned device

2022-09-29 Thread Sam Li
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 (2): file-posix: add the tracking of the zon

[PATCH v2 1/2] file-posix: add the tracking of the zones wp

2022-09-29 Thread Sam Li
write to a zone - zone append Signed-off-by: Sam Li --- block/file-posix.c | 138 ++- include/block/block-common.h | 16 include/block/block_int-common.h | 5 ++ include/block/raw-aio.h | 4 +- 4 files changed, 159 insertions(

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

2022-09-29 Thread Sam Li
position the data has been written in the zone. Signed-off-by: Sam Li --- block/block-backend.c | 65 ++ block/file-posix.c | 51 +++ block/io.c | 21 ++ block/raw-format.c

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

2022-09-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 having zoned device support can use blkzone(8) to test those commands. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by: Sam Li --- hw

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