lib: qemu: rbd: Properly escape IPv6 addresses.

Each ':' character in the address must be escaped from qemu.

Thanks: Jonathan Wright
This commit is contained in:
Richard W.M. Jones
2019-04-01 16:36:15 +01:00
parent f79129b8dc
commit e047cc4da8
5 changed files with 62 additions and 26 deletions

View File

@@ -56,7 +56,7 @@ rm -f "$DEBUG_QEMU_FILE"
$guestfish -d ceph1 run ||:
check_output
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:mon_host=1.2.3.4\\:1234\\;1.2.3.5\\:1235\\;1.2.3.6\\:1236:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph1
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:mon_host=1.2.3.4\\:1234\\;1.2.3.5\\:1235\\;1.2.3.6\\:1236\\;\[fe80\\:\\:1\]\\:1237:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph1
rm "$DEBUG_QEMU_FILE"
$guestfish -d ceph2 run ||:

View File

@@ -35,6 +35,7 @@
<host name='1.2.3.4' port='1234'/>
<host name='1.2.3.5' port='1235'/>
<host name='1.2.3.6' port='1236'/>
<host name='[fe80::1]' port='1237'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>