tos3to4: fix LXC migration where IP addresses are specified
I just upgraded from 3.11.17 to 5.0.2 and my LXC containers didn't migrate correctly -- almost correctly, but the IP address keys were rewritten to suit the new version.
root@turris:/srv/lxc# lxc-ls -l DEBUG
lxc-ls: parse.c: lxc_file_for_each_line_mmap: 142 Failed to parse config file "/srv/lxc/con/config" at line "lxc.net.0.ipv4.ipv4 = 192.168.1.2"
Failed to load config for con
which caused the container to fail to load until it was fixed. The issue was caused by the following invalid config being present after migration:
lxc.net.0.ipv4.ipv4 = xxxxxx
lxc.net.0.ipv6.ipv6 = xxxxxx
The items should look like the following, being a change of key from ipv4
and ipv6
to address
:
lxc.net.0.ipv4.address = xxxxxx
lxc.net.0.ipv6.address = xxxxxx
A patch is attached, which readjusts the given config entries. This is the only LXC issue that affected me - everything else was fine - but there may be other keys that need review as well so they come across between versions.