1=== Successful image creation (defaults) === 2 3{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "size": 0}}} 4{"return": {}} 5{"execute": "job-dismiss", "arguments": {"id": "job0"}} 6{"return": {}} 7 8{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "node-name": "imgfile"}} 9{"return": {}} 10{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "imgfile", "size": 134217728}}} 11{"return": {}} 12{"execute": "job-dismiss", "arguments": {"id": "job0"}} 13{"return": {}} 14 15image: TEST_IMG 16file format: IMGFMT 17virtual size: 128 MiB (134217728 bytes) 18cluster_size: 65536 19Format specific information: 20 compat: 1.1 21 compression type: zlib 22 lazy refcounts: false 23 refcount bits: 16 24 corrupt: false 25 26=== Successful image creation (inline blockdev-add, explicit defaults) === 27 28{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "nocow": false, "preallocation": "off", "size": 0}}} 29{"return": {}} 30{"execute": "job-dismiss", "arguments": {"id": "job0"}} 31{"return": {}} 32 33{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 65536, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2"}, "lazy-refcounts": false, "preallocation": "off", "refcount-bits": 16, "size": 67108864, "version": "v3"}}} 34{"return": {}} 35{"execute": "job-dismiss", "arguments": {"id": "job0"}} 36{"return": {}} 37 38image: TEST_IMG 39file format: IMGFMT 40virtual size: 64 MiB (67108864 bytes) 41cluster_size: 65536 42Format specific information: 43 compat: 1.1 44 compression type: zlib 45 lazy refcounts: false 46 refcount bits: 16 47 corrupt: false 48 49=== Successful image creation (v3 non-default options) === 50 51{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "nocow": true, "preallocation": "falloc", "size": 0}}} 52{"return": {}} 53{"execute": "job-dismiss", "arguments": {"id": "job0"}} 54{"return": {}} 55 56{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 2097152, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2"}, "lazy-refcounts": true, "preallocation": "metadata", "refcount-bits": 1, "size": 33554432, "version": "v3"}}} 57{"return": {}} 58{"execute": "job-dismiss", "arguments": {"id": "job0"}} 59{"return": {}} 60 61image: TEST_IMG 62file format: IMGFMT 63virtual size: 32 MiB (33554432 bytes) 64cluster_size: 2097152 65Format specific information: 66 compat: 1.1 67 compression type: zlib 68 lazy refcounts: true 69 refcount bits: 1 70 corrupt: false 71 72=== Successful image creation (v2 non-default options) === 73 74{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "size": 0}}} 75{"return": {}} 76{"execute": "job-dismiss", "arguments": {"id": "job0"}} 77{"return": {}} 78 79{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"backing-file": "TEST_DIR/PID-t.qcow2.base", "backing-fmt": "qcow2", "cluster-size": 512, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2"}, "size": 33554432, "version": "v2"}}} 80{"return": {}} 81{"execute": "job-dismiss", "arguments": {"id": "job0"}} 82{"return": {}} 83 84image: TEST_IMG 85file format: IMGFMT 86virtual size: 32 MiB (33554432 bytes) 87cluster_size: 512 88backing file: TEST_IMG.base 89backing file format: IMGFMT 90Format specific information: 91 compat: 0.10 92 compression type: zlib 93 refcount bits: 16 94 95=== Successful image creation (encrypted) === 96 97{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "encrypt": {"cipher-alg": "twofish-128", "cipher-mode": "ctr", "format": "luks", "hash-alg": "sha1", "iter-time": 10, "ivgen-alg": "plain64", "ivgen-hash-alg": "md5", "key-secret": "keysec0"}, "file": {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2"}, "size": 33554432}}} 98{"return": {}} 99{"execute": "job-dismiss", "arguments": {"id": "job0"}} 100{"return": {}} 101 102image: TEST_IMG 103file format: IMGFMT 104virtual size: 32 MiB (33554432 bytes) 105encrypted: yes 106cluster_size: 65536 107Format specific information: 108 compat: 1.1 109 compression type: zlib 110 lazy refcounts: false 111 refcount bits: 16 112 encrypt: 113 ivgen alg: plain64 114 hash alg: sha1 115 cipher alg: twofish-128 116 uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 117 format: luks 118 cipher mode: ctr 119 slots: 120 [0]: 121 active: true 122 iters: XXX 123 key offset: 4096 124 stripes: 4000 125 [1]: 126 active: false 127 key offset: 69632 128 [2]: 129 active: false 130 key offset: 135168 131 [3]: 132 active: false 133 key offset: 200704 134 [4]: 135 active: false 136 key offset: 266240 137 [5]: 138 active: false 139 key offset: 331776 140 [6]: 141 active: false 142 key offset: 397312 143 [7]: 144 active: false 145 key offset: 462848 146 payload offset: 528384 147 master key iters: XXX 148 corrupt: false 149 150=== Invalid BlockdevRef === 151 152{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "this doesn't exist", "size": 33554432}}} 153{"return": {}} 154Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exist 155{"execute": "job-dismiss", "arguments": {"id": "job0"}} 156{"return": {}} 157 158=== Invalid sizes === 159{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "size": 1234}}} 160{"return": {}} 161Job failed: Image size must be a multiple of 512 bytes 162{"execute": "job-dismiss", "arguments": {"id": "job0"}} 163{"return": {}} 164 165{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "size": 18446744073709551104}}} 166{"return": {}} 167Job failed: Could not resize image: Image size cannot be negative 168{"execute": "job-dismiss", "arguments": {"id": "job0"}} 169{"return": {}} 170 171{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "size": 9223372036854775808}}} 172{"return": {}} 173Job failed: Could not resize image: Image size cannot be negative 174{"execute": "job-dismiss", "arguments": {"id": "job0"}} 175{"return": {}} 176 177{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "size": 9223372036854775296}}} 178{"return": {}} 179Job failed: Could not resize image: Failed to grow the L1 table: File too large 180{"execute": "job-dismiss", "arguments": {"id": "job0"}} 181{"return": {}} 182 183=== Invalid version === 184{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "size": 67108864, "version": "v1"}}} 185{"error": {"class": "GenericError", "desc": "Invalid parameter 'v1'"}} 186 187{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "lazy-refcounts": true, "size": 67108864, "version": "v2"}}} 188{"return": {}} 189Job failed: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater) 190{"execute": "job-dismiss", "arguments": {"id": "job0"}} 191{"return": {}} 192 193{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "refcount-bits": 8, "size": 67108864, "version": "v2"}}} 194{"return": {}} 195Job failed: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater) 196{"execute": "job-dismiss", "arguments": {"id": "job0"}} 197{"return": {}} 198 199=== Invalid backing file options === 200{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"backing-file": "/dev/null", "driver": "qcow2", "file": "node0", "preallocation": "full", "size": 67108864}}} 201{"return": {}} 202Job failed: Backing file and preallocation cannot be used at the same time 203{"execute": "job-dismiss", "arguments": {"id": "job0"}} 204{"return": {}} 205 206{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"backing-fmt": "qcow2", "driver": "qcow2", "file": "node0", "size": 67108864}}} 207{"return": {}} 208Job failed: Backing format cannot be used without backing file 209{"execute": "job-dismiss", "arguments": {"id": "job0"}} 210{"return": {}} 211 212=== Invalid cluster size === 213{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 1234, "driver": "qcow2", "file": "node0", "size": 67108864}}} 214{"return": {}} 215Job failed: Cluster size must be a power of two between 512 and 2048k 216{"execute": "job-dismiss", "arguments": {"id": "job0"}} 217{"return": {}} 218 219{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 128, "driver": "qcow2", "file": "node0", "size": 67108864}}} 220{"return": {}} 221Job failed: Cluster size must be a power of two between 512 and 2048k 222{"execute": "job-dismiss", "arguments": {"id": "job0"}} 223{"return": {}} 224 225{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 4194304, "driver": "qcow2", "file": "node0", "size": 67108864}}} 226{"return": {}} 227Job failed: Cluster size must be a power of two between 512 and 2048k 228{"execute": "job-dismiss", "arguments": {"id": "job0"}} 229{"return": {}} 230 231{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 0, "driver": "qcow2", "file": "node0", "size": 67108864}}} 232{"return": {}} 233Job failed: Cluster size must be a power of two between 512 and 2048k 234{"execute": "job-dismiss", "arguments": {"id": "job0"}} 235{"return": {}} 236 237{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cluster-size": 512, "driver": "qcow2", "file": "node0", "size": 281474976710656}}} 238{"return": {}} 239Job failed: Could not resize image: Failed to grow the L1 table: File too large 240{"execute": "job-dismiss", "arguments": {"id": "job0"}} 241{"return": {}} 242 243=== Invalid refcount width === 244{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "refcount-bits": 128, "size": 67108864}}} 245{"return": {}} 246Job failed: Refcount width must be a power of two and may not exceed 64 bits 247{"execute": "job-dismiss", "arguments": {"id": "job0"}} 248{"return": {}} 249 250{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "refcount-bits": 0, "size": 67108864}}} 251{"return": {}} 252Job failed: Refcount width must be a power of two and may not exceed 64 bits 253{"execute": "job-dismiss", "arguments": {"id": "job0"}} 254{"return": {}} 255 256{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "qcow2", "file": "node0", "refcount-bits": 7, "size": 67108864}}} 257{"return": {}} 258Job failed: Refcount width must be a power of two and may not exceed 64 bits 259{"execute": "job-dismiss", "arguments": {"id": "job0"}} 260{"return": {}} 261 262