Skip to contentSkip to conversation

block/null: Expose read-zeroes option in QAPI schema

PATCH In review Kevin Wolf 3 participants 3 messages Jun 17, 2019 – Jun 24, 2019

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 block/null: Expose read-zeroes option in QAPI schema

Commit cd219eb1e55 added the read-zeroes option for the null-co and null-aio block driver, but forgot to add them to the QAPI schema. Therefore, this option wasn't available in -blockdev and blockdev-add until now.

Add the missing option in the schema to make it available there, too.

---
 qapi/block-core.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
qapi/block-core.json +3 -1
index 61124431d8..0d43d4f37c 100644
@@ -2890,11 +2890,13 @@
 # @latency-ns: emulated latency (in nanoseconds) in processing
 #              requests. Default to zero which completes requests immediately.
 #              (Since 2.4)
+# @read-zeroes: if true, reads from the device produce zeroes; if false, the
+#               buffer is left unchanged. (default: false; since: 4.1)
 #
 # Since: 2.9
 ##
 { 'struct': 'BlockdevOptionsNull',
-  'data': { '*size': 'int', '*latency-ns': 'uint64' } }
+  'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
 
 ##
 # @BlockdevOptionsNVMe:
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Kevin Wolf

Commit cd219eb1e55 added the read-zeroes option for the null-co and null-aio block driver, but forgot to add them to the QAPI schema. Therefore, this option wasn't available in -blockdev and blockdev-add until now.

Add the missing option in the schema to make it available there, too.

---
 qapi/block-core.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kevin Wolf
Quoted 22 lines · Kevin Wolf

Commit cd219eb1e55 added the read-zeroes option for the null-co and null-aio block driver, but forgot to add them to the QAPI schema. Therefore, this option wasn't available in -blockdev and blockdev-add until now.

Add the missing option in the schema to make it available there, too.

---
  qapi/block-core.json | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
qapi/block-core.json +1 -0
index 61124431d8..0d43d4f37c 100644
@@ -2890,11 +2890,13 @@
  # @latency-ns: emulated latency (in nanoseconds) in processing
  #              requests. Default to zero which completes requests immediately.
  #              (Since 2.4)
+# @read-zeroes: if true, reads from the device produce zeroes; if false, the

qapi/block-core.json line 2902

Quoted 10 lines
qapi/block-core.json +2 -1
+#               buffer is left unchanged. (default: false; since: 4.1)
  #
  # Since: 2.9
  ##
  { 'struct': 'BlockdevOptionsNull',
-  'data': { '*size': 'int', '*latency-ns': 'uint64' } }
+  'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
 
  ##
  # @BlockdevOptionsNVMe: