From patchwork Tue Oct 11 10:00:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 118934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C6B96B6F72 for ; Tue, 11 Oct 2011 22:07:31 +1100 (EST) Received: from localhost ([::1]:46592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZBe-0004Gi-58 for incoming@patchwork.ozlabs.org; Tue, 11 Oct 2011 06:03:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZBW-0004BS-0P for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDZBT-0000DZ-Uf for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:03:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZBT-0000DR-NY for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:03:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9BA3ccQ012787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Oct 2011 06:03:39 -0400 Received: from neno.neno (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9BA1lvw021320; Tue, 11 Oct 2011 06:03:28 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 11 Oct 2011 12:00:35 +0200 Message-Id: <7ec4aec8346d9be666b71cbe20c1dbb8ce4306e7.1318326683.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 15/36] migration: Make *start_outgoing_migration return FdMigrationState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori --- migration-exec.c | 4 ++-- migration-fd.c | 4 ++-- migration-tcp.c | 4 ++-- migration-unix.c | 4 ++-- migration.c | 4 ++-- migration.h | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/migration-exec.c b/migration-exec.c index 2cfb6f2..759aa79 100644 --- a/migration-exec.c +++ b/migration-exec.c @@ -61,7 +61,7 @@ static int exec_close(FdMigrationState *s) return ret; } -MigrationState *exec_start_outgoing_migration(Monitor *mon, +FdMigrationState *exec_start_outgoing_migration(Monitor *mon, const char *command, int64_t bandwidth_limit, int detach, @@ -108,7 +108,7 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon, } migrate_fd_connect(s); - return &s->mig_state; + return s; err_after_open: pclose(f); diff --git a/migration-fd.c b/migration-fd.c index aee690a..8036a27 100644 --- a/migration-fd.c +++ b/migration-fd.c @@ -50,7 +50,7 @@ static int fd_close(FdMigrationState *s) return 0; } -MigrationState *fd_start_outgoing_migration(Monitor *mon, +FdMigrationState *fd_start_outgoing_migration(Monitor *mon, const char *fdname, int64_t bandwidth_limit, int detach, @@ -91,7 +91,7 @@ MigrationState *fd_start_outgoing_migration(Monitor *mon, } migrate_fd_connect(s); - return &s->mig_state; + return s; err_after_open: close(s->fd); diff --git a/migration-tcp.c b/migration-tcp.c index c431e03..05a121f 100644 --- a/migration-tcp.c +++ b/migration-tcp.c @@ -75,7 +75,7 @@ static void tcp_wait_for_connect(void *opaque) } } -MigrationState *tcp_start_outgoing_migration(Monitor *mon, +FdMigrationState *tcp_start_outgoing_migration(Monitor *mon, const char *host_port, int64_t bandwidth_limit, int detach, @@ -131,7 +131,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, } else if (ret >= 0) migrate_fd_connect(s); - return &s->mig_state; + return s; } static void tcp_accept_incoming_migration(void *opaque) diff --git a/migration-unix.c b/migration-unix.c index 6dc985d..0eeedde 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -74,7 +74,7 @@ static void unix_wait_for_connect(void *opaque) } } -MigrationState *unix_start_outgoing_migration(Monitor *mon, +FdMigrationState *unix_start_outgoing_migration(Monitor *mon, const char *path, int64_t bandwidth_limit, int detach, @@ -132,7 +132,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, if (ret >= 0) migrate_fd_connect(s); - return &s->mig_state; + return s; err_after_open: close(s->fd); diff --git a/migration.c b/migration.c index 6bac734..4449594 100644 --- a/migration.c +++ b/migration.c @@ -79,7 +79,7 @@ void process_incoming_migration(QEMUFile *f) int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) { - MigrationState *s = NULL; + FdMigrationState *s = NULL; const char *p; int detach = qdict_get_try_bool(qdict, "detach", 0); int blk = qdict_get_try_bool(qdict, "blk", 0); @@ -124,7 +124,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) current_migration->release(current_migration); } - current_migration = s; + current_migration = &s->mig_state; notifier_list_notify(&migration_state_notifiers, NULL); return 0; } diff --git a/migration.h b/migration.h index 050c56c..58354c7 100644 --- a/migration.h +++ b/migration.h @@ -72,7 +72,7 @@ void do_info_migrate(Monitor *mon, QObject **ret_data); int exec_start_incoming_migration(const char *host_port); -MigrationState *exec_start_outgoing_migration(Monitor *mon, +FdMigrationState *exec_start_outgoing_migration(Monitor *mon, const char *host_port, int64_t bandwidth_limit, int detach, @@ -81,7 +81,7 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon, int tcp_start_incoming_migration(const char *host_port); -MigrationState *tcp_start_outgoing_migration(Monitor *mon, +FdMigrationState *tcp_start_outgoing_migration(Monitor *mon, const char *host_port, int64_t bandwidth_limit, int detach, @@ -90,7 +90,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, int unix_start_incoming_migration(const char *path); -MigrationState *unix_start_outgoing_migration(Monitor *mon, +FdMigrationState *unix_start_outgoing_migration(Monitor *mon, const char *path, int64_t bandwidth_limit, int detach, @@ -99,7 +99,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, int fd_start_incoming_migration(const char *path); -MigrationState *fd_start_outgoing_migration(Monitor *mon, +FdMigrationState *fd_start_outgoing_migration(Monitor *mon, const char *fdname, int64_t bandwidth_limit, int detach,