On Mon, Mar 11, 2013 at 19:40:52 +0100, Ján Tomko wrote:
Hello.
We can only tell QEMU on the destination to listen either on IPv6 or on
IPv4.
If we're supplied with a numeric v6 address, that's the only thing we
need to know to set the listen address to [::].
For hostnames, we can either assume this based on how it resolves by
default on the destination (we keep trying all the resolved addresses on
the source, but this might break a few cases), which John found
disgusting, so that leaves user input:
How about a VIR_DOMAIN_MIGRATE_IPV6 flag, depending on which we set the
listen address on the destination and creating a new function
virNetSocketNewConnectTCPHints, where we would add IPv4/IPv6 hint
based on the presence/absence of this flag?
Yeah, I think using an explicit flag would be the best approach. As we
learnt several times, implementing automagic behavior is too fragile and
leads to ugly code and confusion. IIUC, we would tell QEMU to listen on
:: iff either migrateuri uses IPv6 address explicitly or
VIR_DOMAIN_MIGRATE_IPV6 flag is set. In all other cases, 0.0.0.0 address
will be passed to QEMU. In other words, unless a user takes an explicit
action, migration will use IPv4 regardless on libvirt version.
Would it be better to auto-add this flag for numeric addresses, or
just
check for them both in the Prepare phase on the dest (and set
listen_addr accordingly) and before connecting from the source, so we
don't use the IPv4 hint (in case we wanted to use the partial fix for
just numeric addresses for older libvirt).
I don't think auto-adding the flag is wise.
Jirka