summary refs log tree commit diff stats
path: root/qemu-sockets.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-08-06 16:26:47 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2012-08-13 13:20:39 -0300
commit540c79fec9e8b6a6582ec4c65aa2c4c5366e4b89 (patch)
tree2258c5002deae99c066343530a2ff45fbf7b1988 /qemu-sockets.c
parent02a08fef079469c005d48fe2d181f0e0eb5752ae (diff)
downloadfocaccia-qemu-540c79fec9e8b6a6582ec4c65aa2c4c5366e4b89.tar.gz
focaccia-qemu-540c79fec9e8b6a6582ec4c65aa2c4c5366e4b89.zip
migration: don't rely on any QERR_SOCKET_*
Use the in_progress argument for QERR_SOCKET_CONNECT_IN_PROGRESS. The
other errors are handled the same by checking if the error is set and
then calling migrate_fd_error() if it's.

It's also necessary to change inet_connect_opts() not to set
QERR_SOCKET_CONNECT_IN_PROGRESS. This error is only used by
tcp_start_outgoing_migration() and not changing it along with the
usage of in_progress would break migration.

Furthermore this commit fixes a bug. Today, there's a spurious error
report when migration succeeds:

(qemu) migrate tcp:0:4444
migrate: Connection can not be completed immediately
(qemu)

After this commit no spurious error is reported anymore.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qemu-sockets.c')
-rw-r--r--qemu-sockets.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/qemu-sockets.c b/qemu-sockets.c
index 9cb47d4232..361d890da3 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -284,8 +284,6 @@ int inet_connect_opts(QemuOpts *opts, bool *in_progress, Error **errp)
             if (in_progress) {
                 *in_progress = true;
             }
-
-            error_set(errp, QERR_SOCKET_CONNECT_IN_PROGRESS);
         } else if (rc < 0) {
             if (NULL == e->ai_next)
                 fprintf(stderr, "%s: connect(%s,%s,%s,%s): %s\n", __FUNCTION__,