| 1 | === Successful image creation (defaults) === |
| 2 | |
| 3 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "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.vdi", "node-name": "imgfile"}} |
| 9 | {"return": {}} |
| 10 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "imgfile", "size": 134217728}}} |
| 11 | {"return": {}} |
| 12 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 13 | {"return": {}} |
| 14 | |
| 15 | image: TEST_IMG |
| 16 | file format: IMGFMT |
| 17 | virtual size: 128 MiB (134217728 bytes) |
| 18 | cluster_size: 1048576 |
| 19 | |
| 20 | [{"compressed": false, "data": false, "depth": 0, "length": 134217728, "present": true, "start": 0, "zero": true}] |
| 21 | === Successful image creation (explicit defaults) === |
| 22 | |
| 23 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "size": 0}}} |
| 24 | {"return": {}} |
| 25 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 26 | {"return": {}} |
| 27 | |
| 28 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.vdi"}, "preallocation": "off", "size": 67108864}}} |
| 29 | {"return": {}} |
| 30 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 31 | {"return": {}} |
| 32 | |
| 33 | image: TEST_IMG |
| 34 | file format: IMGFMT |
| 35 | virtual size: 64 MiB (67108864 bytes) |
| 36 | cluster_size: 1048576 |
| 37 | |
| 38 | [{"compressed": false, "data": false, "depth": 0, "length": 67108864, "present": true, "start": 0, "zero": true}] |
| 39 | === Successful image creation (with non-default options) === |
| 40 | |
| 41 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "size": 0}}} |
| 42 | {"return": {}} |
| 43 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 44 | {"return": {}} |
| 45 | |
| 46 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.vdi"}, "preallocation": "metadata", "size": 33554432}}} |
| 47 | {"return": {}} |
| 48 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 49 | {"return": {}} |
| 50 | |
| 51 | image: TEST_IMG |
| 52 | file format: IMGFMT |
| 53 | virtual size: 32 MiB (33554432 bytes) |
| 54 | cluster_size: 1048576 |
| 55 | |
| 56 | [{"compressed": false, "data": true, "depth": 0, "length": 3072, "offset": 1024, "present": true, "start": 0, "zero": false}, {"compressed": false, "data": true, "depth": 0, "length": 33551360, "offset": 4096, "present": true, "start": 3072, "zero": true}] |
| 57 | === Invalid BlockdevRef === |
| 58 | |
| 59 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "this doesn't exist", "size": 33554432}}} |
| 60 | {"return": {}} |
| 61 | Job failed: Cannot find device='this doesn't exist' nor node-name='this doesn't exist' |
| 62 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 63 | {"return": {}} |
| 64 | |
| 65 | === Zero size === |
| 66 | |
| 67 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "node0", "size": 0}}} |
| 68 | {"return": {}} |
| 69 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 70 | {"return": {}} |
| 71 | |
| 72 | image: TEST_IMG |
| 73 | file format: IMGFMT |
| 74 | virtual size: 0 B (0 bytes) |
| 75 | cluster_size: 1048576 |
| 76 | |
| 77 | === Maximum size === |
| 78 | |
| 79 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "node0", "size": 562949819203584}}} |
| 80 | {"return": {}} |
| 81 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 82 | {"return": {}} |
| 83 | |
| 84 | image: TEST_IMG |
| 85 | file format: IMGFMT |
| 86 | virtual size: 512 TiB (562949819203584 bytes) |
| 87 | cluster_size: 1048576 |
| 88 | |
| 89 | === Invalid sizes === |
| 90 | |
| 91 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "node0", "size": 18446744073709551104}}} |
| 92 | {"return": {}} |
| 93 | Job failed: Unsupported VDI image size (size is 0xfffffffffffffe00, max supported is 0x1fffff8000000) |
| 94 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 95 | {"return": {}} |
| 96 | |
| 97 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "node0", "size": 9223372036854775808}}} |
| 98 | {"return": {}} |
| 99 | Job failed: Unsupported VDI image size (size is 0x8000000000000000, max supported is 0x1fffff8000000) |
| 100 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 101 | {"return": {}} |
| 102 | |
| 103 | {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vdi", "file": "node0", "size": 562949819203585}}} |
| 104 | {"return": {}} |
| 105 | Job failed: Unsupported VDI image size (size is 0x1fffff8000001, max supported is 0x1fffff8000000) |
| 106 | {"execute": "job-dismiss", "arguments": {"id": "job0"}} |
| 107 | {"return": {}} |
| 108 |