qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nir Soffer <nirsof@gmail.com>
To: qemu-devel@nongnu.org
Cc: Eric Blake <eblake@redhat.com>,
	qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
	Hanna Reitz <hreitz@redhat.com>, Nir Soffer <nirsof@gmail.com>
Subject: [PATCH v2 0/2] block/null: Add read-pattern option
Date: Wed, 30 Apr 2025 23:37:15 +0300	[thread overview]
Message-ID: <20250430203717.16359-1-nirsof@gmail.com> (raw)

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)



             reply	other threads:[~2025-04-30 20:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 20:37 Nir Soffer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250430203717.16359-1-nirsof@gmail.com \
    --to=nirsof@gmail.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).