From: Yoshiaki Tamura Date: Wed, 9 Jun 2010 21:50:10 +0000 (+0900) Subject: migration-tcp: call migrate_fd_error() instead of close() and free(). X-Git-Tag: pull-nvme-20200902~11564 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=304e3a7c802969811fe82b6247f63fcba063f52e;p=qemu-nvme.git migration-tcp: call migrate_fd_error() instead of close() and free(). This patch fixes the following error report. When changing migration-tcp.c to call migrate_fd_error() instead of close() and free() by itself, monitor is resumed, and returns allocated mig_state is set to current_migration in migration.c allows us to print "info migrate". Reported-by: Cole Robinson Signed-off-by: Yoshiaki Tamura Signed-off-by: Anthony Liguori --- diff --git a/migration-tcp.c b/migration-tcp.c index 95ce722fec..43af2e0450 100644 --- a/migration-tcp.c +++ b/migration-tcp.c @@ -128,9 +128,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) { DPRINTF("connect failed\n"); - close(s->fd); - qemu_free(s); - return NULL; + migrate_fd_error(s); } else if (ret >= 0) migrate_fd_connect(s);