qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] block/null: Add read-pattern option
@ 2025-04-30 20:37 Nir Soffer
  2025-04-30 20:37 ` [PATCH v2 1/2] block/null: Report DATA if not reading zeroes Nir Soffer
  2025-04-30 20:37 ` [PATCH v2 2/2] block/null: Add read-pattern option Nir Soffer
  0 siblings, 2 replies; 13+ messages in thread
From: Nir Soffer @ 2025-04-30 20:37 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eric Blake, qemu-block, Markus Armbruster, Kevin Wolf, Fam Zheng,
	Hanna Reitz, Nir Soffer

The null driver is very usefull for testing and benchmarking, but it can not
emulate an image full of zeroes or an image full of non-zero bytes. Such images
are needed for testing computing a blkhash via qemu-nbd or qemu-storage-daemon.

This change adds `read-pattern` option allowing emulution of image full of
zeroes and image for of non-zero bytes.

I used this for testing
https://lists.gnu.org/archive/html/qemu-devel/2025-04/msg05096.html

Changes since v1:
- Make read-zeroes and read-pattern mutual exclusive [Eric, Markus]
- Narrow read-pattern type to uint8 [Eric, Markus]
- Update the doc comment to explain that read-zeroes emulates a sparsse image,
  and read-pattern emulates an allocated image. [Markus]
- Validate that read-pattern value is within range
- Update secure-coding-practices guide with read-pattern option

v1 was here:
https://lists.gnu.org/archive/html/qemu-devel/2025-04/msg05098.html

Nir Soffer (2):
  block/null: Report DATA if not reading zeroes
  block/null: Add read-pattern option

 block/null.c                           | 38 +++++++++++++++++++++++---
 docs/devel/secure-coding-practices.rst |  3 +-
 qapi/block-core.json                   | 17 ++++++++++--
 3 files changed, 50 insertions(+), 8 deletions(-)

-- 
2.39.5 (Apple Git-154)



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-05-16 21:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 20:37 [PATCH v2 0/2] block/null: Add read-pattern option Nir Soffer
2025-04-30 20:37 ` [PATCH v2 1/2] block/null: Report DATA if not reading zeroes Nir Soffer
2025-05-08  4:37   ` Markus Armbruster
2025-05-08  5:03     ` Markus Armbruster
2025-05-08  5:20       ` Markus Armbruster
2025-05-16 21:35         ` Nir Soffer
2025-05-16 21:32       ` Nir Soffer
2025-05-16 21:31     ` Nir Soffer
2025-04-30 20:37 ` [PATCH v2 2/2] block/null: Add read-pattern option Nir Soffer
2025-05-08  5:28   ` Markus Armbruster
2025-05-08 14:30     ` Eric Blake
2025-05-09  7:19       ` Markus Armbruster
2025-05-16 21:12     ` Nir Soffer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).