1QA output created by 223 2 3=== Create partially sparse image, then add dirty bitmaps === 4 5Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304 6wrote 2097152/2097152 bytes at offset 1048576 72 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 8Testing: 9QMP_VERSION 10{"return": {}} 11{"return": {}} 12{"return": {}} 13{"return": {}} 14{"return": {}} 15{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} 16 17 18=== Write part of the file under active bitmap === 19 20wrote 512/512 bytes at offset 512 21512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 22wrote 2097152/2097152 bytes at offset 2097152 232 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 24 25=== End dirty bitmaps, and start serving image over NBD === 26 27{"execute":"qmp_capabilities"} 28{"return": {}} 29{"execute":"blockdev-add", 30 "arguments":{"driver":"IMGFMT", "node-name":"n", 31 "file":{"driver":"file", "filename":"TEST_DIR/t.IMGFMT"}}} 32{"return": {}} 33{"execute":"block-dirty-bitmap-disable", 34 "arguments":{"node":"n", "name":"b"}} 35{"return": {}} 36{"execute":"blockdev-add", 37 "arguments":{"driver":"null-co", "node-name":"null", 38 "size": 4194304}} 39{"return": {}} 40{"execute":"block-dirty-bitmap-add", 41 "arguments":{"node":"null", "name":"b3"}} 42{"return": {}} 43 44=== Set up NBD with normal access === 45 46{"execute":"nbd-server-add", 47 "arguments":{"device":"n"}} 48{"error": {"class": "GenericError", "desc": "NBD server not running"}} 49{"execute":"nbd-server-start", 50 "arguments":{"addr":{"type":"unix", 51 "data":{"path":"SOCK_DIR/nbd"}}}} 52{"return": {}} 53{"execute":"nbd-server-start", 54 "arguments":{"addr":{"type":"unix", 55 "data":{"path":"SOCK_DIR/nbd1"}}}} 56{"error": {"class": "GenericError", "desc": "NBD server already running"}} 57exports available: 0 58{"execute":"nbd-server-add", 59 "arguments":{"device":"n", "bitmap":"b"}} 60{"return": {}} 61{"execute":"nbd-server-add", 62 "arguments":{"device":"nosuch"}} 63{"error": {"class": "GenericError", "desc": "Cannot find device='nosuch' nor node-name='nosuch'"}} 64{"execute":"nbd-server-add", 65 "arguments":{"device":"n"}} 66{"error": {"class": "GenericError", "desc": "Block export id 'n' is already in use"}} 67{"execute":"nbd-server-add", 68 "arguments":{"device":"n", "name":"n2", 69 "bitmap":"b2"}} 70{"error": {"class": "GenericError", "desc": "Enabled bitmap 'b2' incompatible with readonly export"}} 71{"execute":"nbd-server-add", 72 "arguments":{"device":"n", "name":"n2", 73 "bitmap":"b3"}} 74{"error": {"class": "GenericError", "desc": "Bitmap 'b3' is not found"}} 75{"execute":"nbd-server-add", 76 "arguments":{"device":"n", "name":"n2", "writable":true, 77 "description":"some text", "bitmap":"b2"}} 78{"return": {}} 79{"execute":"block-export-add", 80 "arguments":{"type": "nbd", "node-name":"n", "id":"n3", "name": "n3", 81 "bitmaps":[{"node":"null","name":"b3"}]}} 82{"return": {}} 83exports available: 3 84 export: 'n' 85 size: 4194304 86 flags: 0x58f ( readonly flush fua df multi cache ) 87 min block: 1 88 opt block: 4096 89 max block: 33554432 90 available meta contexts: 2 91 base:allocation 92 qemu:dirty-bitmap:b 93 export: 'n2' 94 description: some text 95 size: 4194304 96 flags: 0xded ( flush fua trim zeroes df multi cache fast-zero ) 97 min block: 1 98 opt block: 4096 99 max block: 33554432 100 available meta contexts: 2 101 base:allocation 102 qemu:dirty-bitmap:b2 103 export: 'n3' 104 size: 4194304 105 flags: 0x58f ( readonly flush fua df multi cache ) 106 min block: 1 107 opt block: 4096 108 max block: 33554432 109 available meta contexts: 2 110 base:allocation 111 qemu:dirty-bitmap:b3 112 113=== Contrast normal status to large granularity dirty-bitmap === 114 115read 512/512 bytes at offset 512 116512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 117read 524288/524288 bytes at offset 524288 118512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 119read 1048576/1048576 bytes at offset 1048576 1201 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 121read 2097152/2097152 bytes at offset 2097152 1222 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 123[{ "start": 0, "length": 4096, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 124{ "start": 4096, "length": 1044480, "depth": 0, "present": true, "zero": true, "data": false, "offset": OFFSET}, 125{ "start": 1048576, "length": 3145728, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}] 126[{ "start": 0, "length": 65536, "depth": 0, "present": false, "zero": false, "data": false}, 127{ "start": 65536, "length": 2031616, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 128{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 129 130=== Contrast to small granularity dirty-bitmap === 131 132[{ "start": 0, "length": 512, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 133{ "start": 512, "length": 512, "depth": 0, "present": false, "zero": false, "data": false}, 134{ "start": 1024, "length": 2096128, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 135{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 136 137=== Check bitmap taken from another node === 138 139[{ "start": 0, "length": 4194304, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}] 140 141=== End qemu NBD server === 142 143{"execute":"nbd-server-remove", 144 "arguments":{"name":"n"}} 145{"return": {}} 146{"execute":"nbd-server-remove", 147 "arguments":{"name":"n2"}} 148{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n"}} 149{"return": {}} 150{"execute":"nbd-server-remove", 151 "arguments":{"name":"n2"}} 152{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n2"}} 153{"error": {"class": "GenericError", "desc": "Export 'n2' is not found"}} 154{"execute":"nbd-server-stop"} 155{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n3"}} 156{"return": {}} 157{"execute":"nbd-server-stop"} 158{"error": {"class": "GenericError", "desc": "NBD server not running"}} 159 160=== Set up NBD with iothread access === 161 162{"execute":"x-blockdev-set-iothread", 163 "arguments":{"node-name":"n", "iothread":"io0"}} 164{"return": {}} 165{"execute":"nbd-server-add", 166 "arguments":{"device":"n"}} 167{"error": {"class": "GenericError", "desc": "NBD server not running"}} 168{"execute":"nbd-server-start", 169 "arguments":{"addr":{"type":"unix", 170 "data":{"path":"SOCK_DIR/nbd"}}}} 171{"return": {}} 172{"execute":"nbd-server-start", 173 "arguments":{"addr":{"type":"unix", 174 "data":{"path":"SOCK_DIR/nbd1"}}}} 175{"error": {"class": "GenericError", "desc": "NBD server already running"}} 176exports available: 0 177{"execute":"nbd-server-add", 178 "arguments":{"device":"n", "bitmap":"b"}} 179{"return": {}} 180{"execute":"nbd-server-add", 181 "arguments":{"device":"nosuch"}} 182{"error": {"class": "GenericError", "desc": "Cannot find device='nosuch' nor node-name='nosuch'"}} 183{"execute":"nbd-server-add", 184 "arguments":{"device":"n"}} 185{"error": {"class": "GenericError", "desc": "Block export id 'n' is already in use"}} 186{"execute":"nbd-server-add", 187 "arguments":{"device":"n", "name":"n2", 188 "bitmap":"b2"}} 189{"error": {"class": "GenericError", "desc": "Enabled bitmap 'b2' incompatible with readonly export"}} 190{"execute":"nbd-server-add", 191 "arguments":{"device":"n", "name":"n2", 192 "bitmap":"b3"}} 193{"error": {"class": "GenericError", "desc": "Bitmap 'b3' is not found"}} 194{"execute":"nbd-server-add", 195 "arguments":{"device":"n", "name":"n2", "writable":true, 196 "description":"some text", "bitmap":"b2"}} 197{"return": {}} 198{"execute":"block-export-add", 199 "arguments":{"type": "nbd", "node-name":"n", "id":"n3", "name": "n3", 200 "bitmaps":[{"node":"null","name":"b3"}]}} 201{"return": {}} 202exports available: 3 203 export: 'n' 204 size: 4194304 205 flags: 0x58f ( readonly flush fua df multi cache ) 206 min block: 1 207 opt block: 4096 208 max block: 33554432 209 available meta contexts: 2 210 base:allocation 211 qemu:dirty-bitmap:b 212 export: 'n2' 213 description: some text 214 size: 4194304 215 flags: 0xded ( flush fua trim zeroes df multi cache fast-zero ) 216 min block: 1 217 opt block: 4096 218 max block: 33554432 219 available meta contexts: 2 220 base:allocation 221 qemu:dirty-bitmap:b2 222 export: 'n3' 223 size: 4194304 224 flags: 0x58f ( readonly flush fua df multi cache ) 225 min block: 1 226 opt block: 4096 227 max block: 33554432 228 available meta contexts: 2 229 base:allocation 230 qemu:dirty-bitmap:b3 231 232=== Contrast normal status to large granularity dirty-bitmap === 233 234read 512/512 bytes at offset 512 235512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 236read 524288/524288 bytes at offset 524288 237512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 238read 1048576/1048576 bytes at offset 1048576 2391 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 240read 2097152/2097152 bytes at offset 2097152 2412 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 242[{ "start": 0, "length": 4096, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 243{ "start": 4096, "length": 1044480, "depth": 0, "present": true, "zero": true, "data": false, "offset": OFFSET}, 244{ "start": 1048576, "length": 3145728, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}] 245[{ "start": 0, "length": 65536, "depth": 0, "present": false, "zero": false, "data": false}, 246{ "start": 65536, "length": 2031616, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 247{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 248 249=== Contrast to small granularity dirty-bitmap === 250 251[{ "start": 0, "length": 512, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 252{ "start": 512, "length": 512, "depth": 0, "present": false, "zero": false, "data": false}, 253{ "start": 1024, "length": 2096128, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 254{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 255 256=== Check bitmap taken from another node === 257 258[{ "start": 0, "length": 4194304, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}] 259 260=== End qemu NBD server === 261 262{"execute":"nbd-server-remove", 263 "arguments":{"name":"n"}} 264{"return": {}} 265{"execute":"nbd-server-remove", 266 "arguments":{"name":"n2"}} 267{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n"}} 268{"return": {}} 269{"execute":"nbd-server-remove", 270 "arguments":{"name":"n2"}} 271{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n2"}} 272{"error": {"class": "GenericError", "desc": "Export 'n2' is not found"}} 273{"execute":"nbd-server-stop"} 274{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_EXPORT_DELETED", "data": {"id": "n3"}} 275{"return": {}} 276{"execute":"nbd-server-stop"} 277{"error": {"class": "GenericError", "desc": "NBD server not running"}} 278{"execute":"quit"} 279{"return": {}} 280{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} 281 282=== Use qemu-nbd as server === 283 284[{ "start": 0, "length": 65536, "depth": 0, "present": false, "zero": false, "data": false}, 285{ "start": 65536, "length": 2031616, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 286{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 287[{ "start": 0, "length": 512, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 288{ "start": 512, "length": 512, "depth": 0, "present": false, "zero": false, "data": false}, 289{ "start": 1024, "length": 11321, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}] 290[{ "start": 12345, "length": 2084807, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET}, 291{ "start": 2097152, "length": 2097152, "depth": 0, "present": false, "zero": false, "data": false}] 292*** done 293