1==Unplug a SCSI disk and then plug it again==
2{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-zeroes": true}}
3{"return": {}}
4{"execute": "object-add", "arguments": {"id": "iothread0", "qom-type": "iothread"}}
5{"return": {}}
6{"execute": "device_add", "arguments": {"driver": "virtio-scsi", "id": "scsi0", "iothread": "iothread0"}}
7{"return": {}}
8{"execute": "device_add", "arguments": {"drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
9{"return": {}}
10{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
11{"return": {}}
12{"execute": "device_add", "arguments": {"drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
13{"return": {}}
14{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
15{"return": {}}
16{"execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
17{"return": {}}
18==Attach two SCSI disks using the same block device and the same iothread==
19{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true, "read-zeroes": true}}
20{"return": {}}
21{"execute": "object-add", "arguments": {"id": "iothread0", "qom-type": "iothread"}}
22{"return": {}}
23{"execute": "device_add", "arguments": {"driver": "virtio-scsi", "id": "scsi0", "iothread": "iothread0"}}
24{"return": {}}
25{"execute": "device_add", "arguments": {"drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
26{"return": {}}
27{"execute": "device_add", "arguments": {"drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd1"}}
28{"return": {}}
29{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
30{"return": {}}
31{"execute": "device_del", "arguments": {"id": "scsi-hd1"}}
32{"return": {}}
33{"execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
34{"return": {}}
35==Attach two SCSI disks using the same block device but different iothreads==
36{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true, "read-zeroes": true}}
37{"return": {}}
38{"execute": "object-add", "arguments": {"id": "iothread0", "qom-type": "iothread"}}
39{"return": {}}
40{"execute": "object-add", "arguments": {"id": "iothread1", "qom-type": "iothread"}}
41{"return": {}}
42{"execute": "device_add", "arguments": {"driver": "virtio-scsi", "id": "scsi0", "iothread": "iothread0"}}
43{"return": {}}
44{"execute": "device_add", "arguments": {"driver": "virtio-scsi", "id": "scsi1", "iothread": "iothread1"}}
45{"return": {}}
46{"execute": "device_add", "arguments": {"bus": "scsi0.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
47{"return": {}}
48{"execute": "device_add", "arguments": {"bus": "scsi1.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd1"}}
49{"error": {"class": "GenericError", "desc": "Cannot change iothread of active block backend"}}
50{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
51{"return": {}}
52{"execute": "device_add", "arguments": {"bus": "scsi1.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd1"}}
53{"return": {}}
54{"execute": "device_del", "arguments": {"id": "scsi-hd1"}}
55{"return": {}}
56{"execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
57{"return": {}}
58==Attach a SCSI disks using the same block device as a NBD server==
59{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true, "read-zeroes": true}}
60{"return": {}}
61{"execute": "nbd-server-start", "arguments": {"addr": {"data": {"path": "SOCK_DIR/PID-nbd.sock"}, "type": "unix"}}}
62{"return": {}}
63{"execute": "nbd-server-add", "arguments": {"device": "hd0"}}
64{"return": {}}
65{"execute": "object-add", "arguments": {"id": "iothread0", "qom-type": "iothread"}}
66{"return": {}}
67{"execute": "device_add", "arguments": {"driver": "virtio-scsi", "id": "scsi0", "iothread": "iothread0"}}
68{"return": {}}
69{"execute": "device_add", "arguments": {"drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
70{"return": {}}
71....
72----------------------------------------------------------------------
73Ran 4 tests
74
75OK
76