Merge remote-tracking branch 'remotes/nvme/tags/nvme-fixes-20210407-pull-request...
[qemu/ar7.git] / tests / qemu-iotests / 307.out
blobdaa8ad2da0e94f9d8043bd8f1078af8324b5f127
1 wrote 4096/4096 bytes at offset 0
2 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
4 === Launch VM ===
5 {"execute": "nbd-server-start", "arguments": {"addr": {"data": {"path": "SOCK_DIR/PID-socket"}, "type": "unix"}}}
6 {"return": {}}
7 {"execute": "query-block-exports", "arguments": {}}
8 {"return": []}
10 === Create a read-only NBD export ===
11 {"execute": "block-export-add", "arguments": {"id": "export0", "node-name": "fmt", "type": "nbd"}}
12 {"return": {}}
13 {"execute": "query-block-exports", "arguments": {}}
14 {"return": [{"id": "export0", "node-name": "fmt", "shutting-down": false, "type": "nbd"}]}
15 exports available: 1
16  export: 'fmt'
17   size:  67108864
18   flags: 0x58f ( readonly flush fua df multi cache )
19   min block: XXX
20   opt block: XXX
21   max block: XXX
22   available meta contexts: 1
23    base:allocation
26 === Try a few invalid things ===
27 {"execute": "block-export-add", "arguments": {"id": "#invalid", "node-name": "fmt", "type": "nbd"}}
28 {"error": {"class": "GenericError", "desc": "Invalid block export id"}}
29 {"execute": "block-export-add", "arguments": {"id": "export0", "node-name": "fmt", "type": "nbd"}}
30 {"error": {"class": "GenericError", "desc": "Block export id 'export0' is already in use"}}
31 {"execute": "block-export-add", "arguments": {"id": "export1", "node-name": "ro", "type": "nbd", "writable": true}}
32 {"error": {"class": "GenericError", "desc": "Cannot export read-only node as writable"}}
33 {"execute": "block-export-del", "arguments": {"id": "export1"}}
34 {"error": {"class": "GenericError", "desc": "Export 'export1' is not found"}}
35 {"execute": "query-block-exports", "arguments": {}}
36 {"return": [{"id": "export0", "node-name": "fmt", "shutting-down": false, "type": "nbd"}]}
38 === Move export to an iothread ===
39 {"execute": "device_add", "arguments": {"drive": "fmt", "driver": "scsi-hd", "id": "sda"}}
40 {"return": {}}
41 {"execute": "query-block-exports", "arguments": {}}
42 {"return": [{"id": "export0", "node-name": "fmt", "shutting-down": false, "type": "nbd"}]}
43 exports available: 1
44  export: 'fmt'
45   size:  67108864
46   flags: 0x58f ( readonly flush fua df multi cache )
47   min block: XXX
48   opt block: XXX
49   max block: XXX
50   available meta contexts: 1
51    base:allocation
54 === Add a writable export ===
55 {"execute": "block-export-add", "arguments": {"description": "This is the writable second export", "id": "export1", "name": "export1", "node-name": "fmt", "type": "nbd", "writable": true, "writethrough": true}}
56 {"error": {"class": "GenericError", "desc": "Conflicts with use by sda as 'root', which does not allow 'write' on fmt"}}
57 {"execute": "device_del", "arguments": {"id": "sda"}}
58 {"return": {}}
59 {"data": {"device": "sda", "path": "/machine/peripheral/sda"}, "event": "DEVICE_DELETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
60 {"execute": "device_add", "arguments": {"drive": "fmt", "driver": "scsi-hd", "id": "sda", "share-rw": true}}
61 {"return": {}}
62 {"execute": "block-export-add", "arguments": {"description": "This is the writable second export", "id": "export1", "name": "export1", "node-name": "fmt", "type": "nbd", "writable": true, "writethrough": true}}
63 {"return": {}}
64 {"execute": "query-block-exports", "arguments": {}}
65 {"return": [{"id": "export1", "node-name": "fmt", "shutting-down": false, "type": "nbd"}, {"id": "export0", "node-name": "fmt", "shutting-down": false, "type": "nbd"}]}
66 exports available: 2
67  export: 'fmt'
68   size:  67108864
69   flags: 0x58f ( readonly flush fua df multi cache )
70   min block: XXX
71   opt block: XXX
72   max block: XXX
73   available meta contexts: 1
74    base:allocation
75  export: 'export1'
76   description: This is the writable second export
77   size:  67108864
78   flags: 0xced ( flush fua trim zeroes df cache fast-zero )
79   min block: XXX
80   opt block: XXX
81   max block: XXX
82   available meta contexts: 1
83    base:allocation
86 === Connect qemu-io to export1, try removing exports ===
87 read 4096/4096 bytes at offset 0
88 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
90 wrote 4096/4096 bytes at offset 4096
91 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
93 {"execute": "block-export-del", "arguments": {"id": "export1"}}
94 {"error": {"class": "GenericError", "desc": "export 'export1' still in use"}}
95 {"execute": "block-export-del", "arguments": {"id": "export0"}}
96 {"return": {}}
97 [{"data": {"id": "export0"}, "event": "BLOCK_EXPORT_DELETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}]
98 {"execute": "query-block-exports", "arguments": {}}
99 {"return": [{"id": "export1", "node-name": "fmt", "shutting-down": false, "type": "nbd"}]}
100 exports available: 1
101  export: 'export1'
102   description: This is the writable second export
103   size:  67108864
104   flags: 0xced ( flush fua trim zeroes df cache fast-zero )
105   min block: XXX
106   opt block: XXX
107   max block: XXX
108   available meta contexts: 1
109    base:allocation
112 === Connect qemu-io again, try force removing ===
113 {"execute": "block-export-del", "arguments": {"id": "export1"}}
114 {"error": {"class": "GenericError", "desc": "export 'export1' still in use"}}
115 {"execute": "block-export-del", "arguments": {"id": "export1", "mode": "hard"}}
116 {"return": {}}
117 read failed: Input/output error
119 {"execute": "query-block-exports", "arguments": {}}
120 {"return": []}
121 exports available: 0
124 === Shut down QEMU ===