[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/28] migration: Make all posible migration functio
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 06/28] migration: Make all posible migration functions static |
Date: |
Wed, 23 Feb 2011 22:47:15 +0100 |
I have to move two functions postions to avoid forward declarations
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 73 ++++++++++++++++++++++++++++++-----------------------------
migration.h | 12 ---------
2 files changed, 37 insertions(+), 48 deletions(-)
diff --git a/migration.c b/migration.c
index e773806..84a33ae 100644
--- a/migration.c
+++ b/migration.c
@@ -273,15 +273,7 @@ static void migrate_fd_monitor_suspend(MigrationState *s,
Monitor *mon)
}
}
-void migrate_fd_error(MigrationState *s)
-{
- DPRINTF("setting error state\n");
- s->state = MIG_STATE_ERROR;
- notifier_list_notify(&migration_state_notifiers);
- migrate_fd_cleanup(s);
-}
-
-int migrate_fd_cleanup(MigrationState *s)
+static int migrate_fd_cleanup(MigrationState *s)
{
int ret = 0;
@@ -308,7 +300,15 @@ int migrate_fd_cleanup(MigrationState *s)
return ret;
}
-void migrate_fd_put_notify(void *opaque)
+void migrate_fd_error(MigrationState *s)
+{
+ DPRINTF("setting error state\n");
+ s->state = MIG_STATE_ERROR;
+ notifier_list_notify(&migration_state_notifiers);
+ migrate_fd_cleanup(s);
+}
+
+static void migrate_fd_put_notify(void *opaque)
{
MigrationState *s = opaque;
@@ -316,7 +316,8 @@ void migrate_fd_put_notify(void *opaque)
qemu_file_put_notify(s->file);
}
-ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
+static ssize_t migrate_fd_put_buffer(void *opaque, const void *data,
+ size_t size)
{
MigrationState *s = opaque;
ssize_t ret;
@@ -341,29 +342,7 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void
*data, size_t size)
return ret;
}
-void migrate_fd_connect(MigrationState *s)
-{
- int ret;
-
- s->file = qemu_fopen_ops_buffered(s,
- s->bandwidth_limit,
- migrate_fd_put_buffer,
- migrate_fd_put_ready,
- migrate_fd_wait_for_unfreeze,
- migrate_fd_close);
-
- DPRINTF("beginning savevm\n");
- ret = qemu_savevm_state_begin(s->mon, s->file, s->blk, s->shared);
- if (ret < 0) {
- DPRINTF("failed, %d\n", ret);
- migrate_fd_error(s);
- return;
- }
-
- migrate_fd_put_ready(s);
-}
-
-void migrate_fd_put_ready(void *opaque)
+static void migrate_fd_put_ready(void *opaque)
{
MigrationState *s = opaque;
@@ -431,7 +410,7 @@ static void migrate_fd_release(MigrationState *s)
qemu_free(s);
}
-void migrate_fd_wait_for_unfreeze(void *opaque)
+static void migrate_fd_wait_for_unfreeze(void *opaque)
{
MigrationState *s = opaque;
int ret;
@@ -450,7 +429,7 @@ void migrate_fd_wait_for_unfreeze(void *opaque)
} while (ret == -1 && (s->get_error(s)) == EINTR);
}
-int migrate_fd_close(void *opaque)
+static int migrate_fd_close(void *opaque)
{
MigrationState *s = opaque;
@@ -477,6 +456,28 @@ int get_migration_state(void)
}
}
+void migrate_fd_connect(MigrationState *s)
+{
+ int ret;
+
+ s->file = qemu_fopen_ops_buffered(s,
+ s->bandwidth_limit,
+ migrate_fd_put_buffer,
+ migrate_fd_put_ready,
+ migrate_fd_wait_for_unfreeze,
+ migrate_fd_close);
+
+ DPRINTF("beginning savevm\n");
+ ret = qemu_savevm_state_begin(s->mon, s->file, s->blk, s->shared);
+ if (ret < 0) {
+ DPRINTF("failed, %d\n", ret);
+ migrate_fd_error(s);
+ return;
+ }
+
+ migrate_fd_put_ready(s);
+}
+
MigrationState *migrate_create_state(Monitor *mon, int64_t bandwidth_limit,
int detach, int blk, int inc)
{
diff --git a/migration.h b/migration.h
index fe57eac..52cf2fa 100644
--- a/migration.h
+++ b/migration.h
@@ -100,20 +100,8 @@ MigrationState *fd_start_outgoing_migration(Monitor *mon,
void migrate_fd_error(MigrationState *s);
-int migrate_fd_cleanup(MigrationState *s);
-
-void migrate_fd_put_notify(void *opaque);
-
-ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size);
-
void migrate_fd_connect(MigrationState *s);
-void migrate_fd_put_ready(void *opaque);
-
-void migrate_fd_wait_for_unfreeze(void *opaque);
-
-int migrate_fd_close(void *opaque);
-
MigrationState *migrate_create_state(Monitor *mon, int64_t bandwidth_limit,
int detach, int blk, int inc);
--
1.7.4
- [Qemu-devel] [PATCH v2 00/28] Refactor and cleanup migration code, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 01/28] migration: Make *start_outgoing_migration return FdMigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 02/28] migration: Use FdMigrationState instead of MigrationState when possible, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 04/28] migration: Rename FdMigrationState MigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 10/28] migration: Refactor and simplify error checking in migrate_fd_put_ready, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 09/28] migration: Introduce MIG_STATE_NONE, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 12/28] migration: Our release callback was just free, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 13/28] migration: Remove get_status() accessor, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 14/28] migration: Remove migration cancel() callback, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 08/28] migration: Check that migration is active before cancel it, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 06/28] migration: Make all posible migration functions static,
Juan Quintela <=
- [Qemu-devel] [PATCH 03/28] migration: Fold MigrationState into FdMigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 16/28] migration: use global variable directly, Juan Quintela, 2011/02/23
- Re: [Qemu-devel] [PATCH 16/28] migration: use global variable directly, Anthony Liguori, 2011/02/23
- [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly, Juan Quintela, 2011/02/23
- [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly, Anthony Liguori, 2011/02/23
- [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly, Juan Quintela, 2011/02/23
- Re: [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly, Markus Armbruster, 2011/02/24
- [Qemu-devel] Re: [PATCH 16/28] migration: use global variable directly, Paolo Bonzini, 2011/02/24
[Qemu-devel] [PATCH 17/28] migration: another case of global variable assigned to local one, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 18/28] migration: convert current_migration from pointer to struct, Juan Quintela, 2011/02/23