提交 342ab8d1 编写于 作者: P Paolo Bonzini

migration: centralize call to migrate_fd_error()

The call to migrate_fd_error() was missing for non-socket backends, so
centralize it in qmp_migrate().

Before:

    (qemu) migrate fd:ffff
    migrate: An undefined error has occurred
    (qemu) info migrate
    (qemu)

After:

    (qemu) migrate fd:ffff
    migrate: An undefined error has occurred
    (qemu) info migrate
    capabilities: xbzrle: off
    Migration status: failed
    total time: 0 milliseconds

(The awful error message will be fixed later in the series).
Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 be7059cd
...@@ -79,7 +79,6 @@ int tcp_start_outgoing_migration(MigrationState *s, const char *host_port, ...@@ -79,7 +79,6 @@ int tcp_start_outgoing_migration(MigrationState *s, const char *host_port,
s->fd = inet_nonblocking_connect(host_port, tcp_wait_for_connect, s, &local_err); s->fd = inet_nonblocking_connect(host_port, tcp_wait_for_connect, s, &local_err);
if (local_err != NULL) { if (local_err != NULL) {
migrate_fd_error(s);
error_propagate(errp, local_err); error_propagate(errp, local_err);
return -1; return -1;
} }
......
...@@ -111,7 +111,6 @@ int unix_start_outgoing_migration(MigrationState *s, const char *path) ...@@ -111,7 +111,6 @@ int unix_start_outgoing_migration(MigrationState *s, const char *path)
if (ret < 0) { if (ret < 0) {
DPRINTF("connect failed\n"); DPRINTF("connect failed\n");
migrate_fd_error(s);
return ret; return ret;
} }
migrate_fd_connect(s); migrate_fd_connect(s);
......
...@@ -524,6 +524,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, ...@@ -524,6 +524,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
} }
if (ret < 0 || local_err) { if (ret < 0 || local_err) {
migrate_fd_error(s);
if (!local_err) { if (!local_err) {
error_set_errno(errp, -ret, QERR_UNDEFINED_ERROR); error_set_errno(errp, -ret, QERR_UNDEFINED_ERROR);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册