Red Hat Bugzilla – Bug 846013
Support migration with IPv6 addresses
Last modified: 2013-11-21 03:30:10 EST
Description of problem: URI parsing/formating in qemuMigrationPrepareDirect is not ready for IPv6 addresses: /* Get the port number. */ p = strrchr (uri_in, ':'); if (p == strchr(uri_in, ':')) { /* Generate a port */ this_port = QEMUD_MIGRATION_FIRST_PORT + port++; if (port == QEMUD_MIGRATION_NUM_PORTS) port = 0; /* Caller frees */ if (virAsprintf(uri_out, "%s:%d", uri_in, this_port) < 0) { virReportOOMError(); goto cleanup; } } else { p++; /* definitely has a ':' in it, see above */ this_port = virParseNumber (&p); if (this_port == -1 || p-uri_in != strlen (uri_in)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("URI ended with incorrect ':port'")); goto cleanup; } } } if (*uri_out) VIR_DEBUG("Generated uri_out=%s", *uri_out); /* QEMU will be started with -incoming tcp:0.0.0.0:port */ snprintf(migrateFrom, sizeof(migrateFrom), "tcp:0.0.0.0:%d", this_port); Version-Release number of selected component (if applicable): libvirt-0.10.0-0rc0.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. virsh migrate qemu qemu+tcp://host2/system tcp:[fec0::2] Actual results: virsh # migrate qemu qemu+tcp://host2/system tcp:[fec0::2] error: invalid argument: URI ended with incorrect ':port' Additional info: Using IPv4 address, migration works as expected: virsh # migrate qemu qemu+tcp://host2/system tcp:192.168.123.12
The last line from the code snippet snprintf(migrateFrom, sizeof(migrateFrom), "tcp:0.0.0.0:%d", this_port); reveals another issue we have in IPv6 migrations. We tell qemu to listen on 0.0.0.0, that is, IPv4 only. We should allow it to listen on IPv6 as well, however, we need to do something more clever than tcp:[::]:%d since this wouldn't work if IPv6 was explicitly disabled on the host.
I proposed a fix upstream: https://www.redhat.com/archives/libvir-list/2013-February/msg00931.html
Fixed upstream by: commit f03dcc5df141370c09da93135ad2f921c0af55b9 Author: Ján Tomko <jtomko@redhat.com> AuthorDate: 2013-03-22 14:52:25 +0100 Commit: Ján Tomko <jtomko@redhat.com> CommitDate: 2013-04-02 11:23:47 +0200 qemu: Allow migration over IPv6 Allow migration over IPv6 by listening on [::] instead of 0.0.0.0 when QEMU supports it (QEMU_CAPS_IPV6_MIGRATION) and there is at least one v6 address configured on the system. Use virURIParse in qemuMigrationPrepareDirect to allow parsing IPv6 addresses, which would cause an 'incorrect :port' error message before. Move setting of migrateFrom from qemuMigrationPrepare{Direct,Tunnel} after domain XML parsing, since we need the QEMU binary path from it to get its capabilities.
Packages have been delivered to customer. Waiting on customer testing feedback
Test on qemu-kvm-rhev-0.12.1.2-2.377.el6.x86_64 kernel-2.6.32-396.el6.x86_64 libvirt-0.10.2-19.el6.x86_64 When do migration with #virsh migrate mig qemu+tcp://test2/system tcp:[3ffe::102] error: End of file while reading data: Input/output error The target libvirtd crash the dumping log will be attached
Created attachment 771460 [details] libvirtd.log for crash
According to the log, it looks like the crash is similar to bug 982544. Could you provide backtrace of all libvirtd's threads when the deamon crashed?
Created attachment 771948 [details] backtrace
This is the same crash as in bug 982544. As Jiri Denemark said there: > The backtrace shows libvirtd crashed as a result of a bug introduced by a > patch for 977961. This regression is fixed by a follow-up patch mentioned in > https://bugzilla.redhat.com/show_bug.cgi?id=977961#c8
Verify pass on libvirt-0.10.2-21.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.379.el6.x86_64 kernel-2.6.32-398.el6.x86_64 Migration with #virsh migrate mig qemu+tcp://test2/system tcp:[3ffe::102] can succeed without error
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1581.html