@samitouri / QOSamiQemu / commits / 2a402535ba

qemu-colo.rst: Simplify the block replication setup

On the primary side we don't actually need the replication block driver, since it only passes trough all IO. So simplify the setup and also use 'blockdev-add' instead of 'human-monitor-command'. This is how my clients use colo in production. Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Lukas Straub <lukasstraub2@web.de> Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v11-17-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas <farosas@suse.de>

Lukas Straub committed Mar 2, 2026 at 12:45 UTC 2a402535ba2da6bfd2d84872283740486bd940de
1 file changed +7 -7
docs/system/qemu-colo.rst
+7 -7
@@ -242,8 +242,8 @@ Note:
242 **4.** On Primary VM's QEMU monitor, issue command::
243
244 {"execute":"qmp_capabilities"}
245 - {"execute": "human-monitor-command", "arguments": {"command-line": "drive_add -n buddy driver=replication,mode=primary,file.driver=nbd,file.host=127.0.0.2,file.port=9999,file.export=parent0,node-name=replication0"}}
246 - {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", "node": "replication0" } }
245 + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name": "nbd0", "server": {"type": "inet", "host": "127.0.0.2", "port": "9999"}, "export": "parent0", "detect-zeroes": "on"} }
246 + {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", "node": "nbd0" } }
247 {"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"capability": "x-colo", "state": true } ] } }
248 {"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } }
249
@@ -271,7 +271,7 @@ Primary Failover
271 The Secondary died, resume on the Primary::
272
273 {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "child": "children.1"} }
274 - {"execute": "human-monitor-command", "arguments":{ "command-line": "drive_del replication0" } }
274 + {"execute": "blockdev-del", "arguments": {"node-name": "nbd0"} }
275 {"execute": "object-del", "arguments":{ "id": "comp0" } }
276 {"execute": "object-del", "arguments":{ "id": "iothread1" } }
277 {"execute": "object-del", "arguments":{ "id": "m0" } }
@@ -311,8 +311,8 @@ Wait until disk is synced, then::
311 {"execute": "stop"}
312 {"execute": "block-job-cancel", "arguments":{ "device": "resync"} }
313
314 - {"execute": "human-monitor-command", "arguments":{ "command-line": "drive_add -n buddy driver=replication,mode=primary,file.driver=nbd,file.host=127.0.0.2,file.port=9999,file.export=parent0,node-name=replication0"}}
315 - {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "node": "replication0" } }
314 + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name": "nbd0", "server": {"type": "inet", "host": "127.0.0.2", "port": "9999"}, "export": "parent0", "detect-zeroes": "on"} }
315 + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "node": "nbd0" } }
316
317 {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id": "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } }
318 {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" } }
@@ -343,8 +343,8 @@ Wait until disk is synced, then::
343 {"execute": "stop"}
344 {"execute": "block-job-cancel", "arguments":{ "device": "resync" } }
345
346 - {"execute": "human-monitor-command", "arguments":{ "command-line": "drive_add -n buddy driver=replication,mode=primary,file.driver=nbd,file.host=127.0.0.1,file.port=9999,file.export=parent0,node-name=replication0"}}
347 - {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "node": "replication0" } }
346 + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name": "nbd0", "server": {"type": "inet", "host": "127.0.0.1", "port": "9999"}, "export": "parent0", "detect-zeroes": "on"} }
347 + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "node": "nbd0" } }
348
349 {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id": "m0", "insert": "before", "position": "id=rew0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } }
350 {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "id": "redire0", "insert": "before", "position": "id=rew0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" } }