summaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-02-01 17:26:27 +0100
committerKevin Wolf <kwolf@redhat.com>2018-03-09 15:17:47 +0100
commita595e4bcca4ad6c5544008931dc92bed1da3f89f (patch)
tree40b2d5e981e5072f5cda9569fa4eed573607b59e /qapi
parenta1a42af422d46812f1f0cebe6b230c20409a3731 (diff)
downloadqemu-a595e4bcca4ad6c5544008931dc92bed1da3f89f.tar.gz
sheepdog: QAPIfy "redundancy" create option
The "redundancy" option for Sheepdog image creation is currently a string that can encode one or two integers depending on its format, which at the same time implicitly selects a mode. This patch turns it into a QAPI union and converts the string into such a QAPI object before interpreting the values. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/block-core.json45
1 files changed, 45 insertions, 0 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 39e53c7791..e590ab6c71 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3467,6 +3467,51 @@
'*cluster-size' : 'size' } }
##
+# @SheepdogRedundancyType:
+#
+# @full Create a fully replicated vdi with x copies
+# @erasure-coded Create an erasure coded vdi with x data strips and
+# y parity strips
+#
+# Since: 2.12
+##
+{ 'enum': 'SheepdogRedundancyType',
+ 'data': [ 'full', 'erasure-coded' ] }
+
+##
+# @SheepdogRedundancyFull:
+#
+# @copies Number of copies to use (between 1 and 31)
+#
+# Since: 2.12
+##
+{ 'struct': 'SheepdogRedundancyFull',
+ 'data': { 'copies': 'int' }}
+
+##
+# @SheepdogRedundancyErasureCoded:
+#
+# @data-strips Number of data strips to use (one of {2,4,8,16})
+# @parity-strips Number of parity strips to use (between 1 and 15)
+#
+# Since: 2.12
+##
+{ 'struct': 'SheepdogRedundancyErasureCoded',
+ 'data': { 'data-strips': 'int',
+ 'parity-strips': 'int' }}
+
+##
+# @SheepdogRedundancy:
+#
+# Since: 2.12
+##
+{ 'union': 'SheepdogRedundancy',
+ 'base': { 'type': 'SheepdogRedundancyType' },
+ 'discriminator': 'type',
+ 'data': { 'full': 'SheepdogRedundancyFull',
+ 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
+
+##
# @BlockdevCreateNotSupported:
#
# This is used for all drivers that don't support creating images.