Skip to content

Commit 3fb588a

Browse files
committed
block/create: Mark blockdev-create stable
We're ready to declare the blockdev-create job stable. This renames the corresponding QMP command from x-blockdev-create to blockdev-create. Signed-off-by: Kevin Wolf <[email protected]> Reviewed-by: Max Reitz <[email protected]> Reviewed-by: Jeff Cody <[email protected]>
1 parent 0c46a69 commit 3fb588a

File tree

15 files changed

+111
-111
lines changed

15 files changed

+111
-111
lines changed

block/create.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ static const JobDriver blockdev_create_job_driver = {
6363
.start = blockdev_create_run,
6464
};
6565

66-
void qmp_x_blockdev_create(const char *job_id, BlockdevCreateOptions *options,
67-
Error **errp)
66+
void qmp_blockdev_create(const char *job_id, BlockdevCreateOptions *options,
67+
Error **errp)
6868
{
6969
BlockdevCreateJob *s;
7070
const char *fmt = BlockdevDriver_str(options->driver);

qapi/block-core.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4011,7 +4011,7 @@
40114011
} }
40124012

40134013
##
4014-
# @x-blockdev-create:
4014+
# @blockdev-create:
40154015
#
40164016
# Starts a job to create an image format on a given node. The job is
40174017
# automatically finalized, but a manual job-dismiss is required.
@@ -4022,7 +4022,7 @@
40224022
#
40234023
# Since: 3.0
40244024
##
4025-
{ 'command': 'x-blockdev-create',
4025+
{ 'command': 'blockdev-create',
40264026
'data': { 'job-id': 'str',
40274027
'options': 'BlockdevCreateOptions' } }
40284028

qapi/job.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# @backup: drive backup job type, see "drive-backup"
1919
#
20-
# @create: image creation job type, see "x-blockdev-create" (since 3.0)
20+
# @create: image creation job type, see "blockdev-create" (since 3.0)
2121
#
2222
# Since: 1.7
2323
##

tests/qemu-iotests/206

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ from iotests import imgfmt
2626
iotests.verify_image_format(supported_fmts=['qcow2'])
2727

2828
def blockdev_create(vm, options):
29-
result = vm.qmp_log('x-blockdev-create', job_id='job0', options=options)
29+
result = vm.qmp_log('blockdev-create', job_id='job0', options=options)
3030

3131
if 'return' in result:
3232
assert result['return'] == {}

tests/qemu-iotests/206.out

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
=== Successful image creation (defaults) ===
22

3-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
3+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
44
{u'return': {}}
55
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
66
{u'return': {}}
77

88
{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}
99
{u'return': {}}
10-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'imgfile', 'size': 134217728}}}
10+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'imgfile', 'size': 134217728}}}
1111
{u'return': {}}
1212
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
1313
{u'return': {}}
@@ -24,12 +24,12 @@ Format specific information:
2424

2525
=== Successful image creation (inline blockdev-add, explicit defaults) ===
2626

27-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'nocow': False, 'preallocation': 'off', 'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
27+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'nocow': False, 'preallocation': 'off', 'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
2828
{u'return': {}}
2929
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
3030
{u'return': {}}
3131

32-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 65536, 'refcount-bits': 16, 'version': 'v3', 'preallocation': 'off', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'lazy-refcounts': False, 'driver': 'qcow2', 'size': 67108864}}}
32+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 65536, 'refcount-bits': 16, 'version': 'v3', 'preallocation': 'off', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'lazy-refcounts': False, 'driver': 'qcow2', 'size': 67108864}}}
3333
{u'return': {}}
3434
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
3535
{u'return': {}}
@@ -46,12 +46,12 @@ Format specific information:
4646

4747
=== Successful image creation (v3 non-default options) ===
4848

49-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'nocow': True, 'preallocation': 'falloc', 'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
49+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'nocow': True, 'preallocation': 'falloc', 'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
5050
{u'return': {}}
5151
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
5252
{u'return': {}}
5353

54-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 2097152, 'refcount-bits': 1, 'version': 'v3', 'preallocation': 'metadata', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'lazy-refcounts': True, 'driver': 'qcow2', 'size': 33554432}}}
54+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 2097152, 'refcount-bits': 1, 'version': 'v3', 'preallocation': 'metadata', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'lazy-refcounts': True, 'driver': 'qcow2', 'size': 33554432}}}
5555
{u'return': {}}
5656
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
5757
{u'return': {}}
@@ -68,12 +68,12 @@ Format specific information:
6868

6969
=== Successful image creation (v2 non-default options) ===
7070

71-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
71+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}}
7272
{u'return': {}}
7373
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
7474
{u'return': {}}
7575

76-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 512, 'backing-fmt': 'qcow2', 'driver': 'qcow2', 'version': 'v2', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'backing-file': 'TEST_DIR/PID-t.qcow2.base', 'size': 33554432}}}
76+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 512, 'backing-fmt': 'qcow2', 'driver': 'qcow2', 'version': 'v2', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'backing-file': 'TEST_DIR/PID-t.qcow2.base', 'size': 33554432}}}
7777
{u'return': {}}
7878
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
7979
{u'return': {}}
@@ -90,7 +90,7 @@ Format specific information:
9090

9191
=== Successful image creation (encrypted) ===
9292

93-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'encrypt': {'key-secret': 'keysec0', 'iter-time': 10, 'cipher-mode': 'ctr', 'ivgen-hash-alg': 'md5', 'cipher-alg': 'twofish-128', 'format': 'luks', 'ivgen-alg': 'plain64', 'hash-alg': 'sha1'}, 'driver': 'qcow2', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'size': 33554432}}}
93+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'encrypt': {'key-secret': 'keysec0', 'iter-time': 10, 'cipher-mode': 'ctr', 'ivgen-hash-alg': 'md5', 'cipher-alg': 'twofish-128', 'format': 'luks', 'ivgen-alg': 'plain64', 'hash-alg': 'sha1'}, 'driver': 'qcow2', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'size': 33554432}}}
9494
{u'return': {}}
9595
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
9696
{u'return': {}}
@@ -144,111 +144,111 @@ Format specific information:
144144

145145
=== Invalid BlockdevRef ===
146146

147-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': "this doesn't exist", 'size': 33554432}}}
147+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': "this doesn't exist", 'size': 33554432}}}
148148
{u'return': {}}
149149
Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exist
150150
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
151151
{u'return': {}}
152152

153153
=== Invalid sizes ===
154-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 1234}}}
154+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 1234}}}
155155
{u'return': {}}
156156
Job failed: Image size must be a multiple of 512 bytes
157157
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
158158
{u'return': {}}
159159

160-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 18446744073709551104L}}}
160+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 18446744073709551104L}}}
161161
{u'return': {}}
162162
Job failed: Could not resize image: Image size cannot be negative
163163
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
164164
{u'return': {}}
165165

166-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775808L}}}
166+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775808L}}}
167167
{u'return': {}}
168168
Job failed: Could not resize image: Image size cannot be negative
169169
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
170170
{u'return': {}}
171171

172-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775296}}}
172+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775296}}}
173173
{u'return': {}}
174174
Job failed: Could not resize image: Failed to grow the L1 table: File too large
175175
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
176176
{u'return': {}}
177177

178178
=== Invalid version ===
179-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'version': 'v1', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
179+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'version': 'v1', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
180180
{u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter 'v1'"}}
181181

182-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'lazy-refcounts': True, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
182+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'lazy-refcounts': True, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
183183
{u'return': {}}
184184
Job failed: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
185185
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
186186
{u'return': {}}
187187

188-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 8, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
188+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 8, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
189189
{u'return': {}}
190190
Job failed: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
191191
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
192192
{u'return': {}}
193193

194194
=== Invalid backing file options ===
195-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'preallocation': 'full', 'driver': 'qcow2', 'backing-file': '/dev/null', 'file': 'node0', 'size': 67108864}}}
195+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'preallocation': 'full', 'driver': 'qcow2', 'backing-file': '/dev/null', 'file': 'node0', 'size': 67108864}}}
196196
{u'return': {}}
197197
Job failed: Backing file and preallocation cannot be used at the same time
198198
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
199199
{u'return': {}}
200200

201-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'backing-fmt': 'qcow2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
201+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'backing-fmt': 'qcow2', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
202202
{u'return': {}}
203203
Job failed: Backing format cannot be used without backing file
204204
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
205205
{u'return': {}}
206206

207207
=== Invalid cluster size ===
208-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 1234, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
208+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 1234, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
209209
{u'return': {}}
210210
Job failed: Cluster size must be a power of two between 512 and 2048k
211211
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
212212
{u'return': {}}
213213

214-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
214+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
215215
{u'return': {}}
216216
Job failed: Cluster size must be a power of two between 512 and 2048k
217217
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
218218
{u'return': {}}
219219

220-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 4194304, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
220+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 4194304, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
221221
{u'return': {}}
222222
Job failed: Cluster size must be a power of two between 512 and 2048k
223223
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
224224
{u'return': {}}
225225

226-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
226+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
227227
{u'return': {}}
228228
Job failed: Cluster size must be a power of two between 512 and 2048k
229229
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
230230
{u'return': {}}
231231

232-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 512, 'driver': 'qcow2', 'file': 'node0', 'size': 281474976710656}}}
232+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'cluster-size': 512, 'driver': 'qcow2', 'file': 'node0', 'size': 281474976710656}}}
233233
{u'return': {}}
234234
Job failed: Could not resize image: Failed to grow the L1 table: File too large
235235
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
236236
{u'return': {}}
237237

238238
=== Invalid refcount width ===
239-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
239+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
240240
{u'return': {}}
241241
Job failed: Refcount width must be a power of two and may not exceed 64 bits
242242
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
243243
{u'return': {}}
244244

245-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
245+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
246246
{u'return': {}}
247247
Job failed: Refcount width must be a power of two and may not exceed 64 bits
248248
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
249249
{u'return': {}}
250250

251-
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 7, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
251+
{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'refcount-bits': 7, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}}
252252
{u'return': {}}
253253
Job failed: Refcount width must be a power of two and may not exceed 64 bits
254254
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}

tests/qemu-iotests/207

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def filter_hash(msg):
3131
return re.sub("'hash': '[0-9a-f]+'", "'hash': HASH", msg)
3232

3333
def blockdev_create(vm, options):
34-
result = vm.qmp_log('x-blockdev-create', job_id='job0', options=options,
34+
result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
3535
filters=[iotests.filter_testfiles, filter_hash])
3636

3737
if 'return' in result:

0 commit comments

Comments
 (0)