[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 17/43] migrate_init: Call from savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v2 17/43] migrate_init: Call from savevm |
Date: |
Mon, 11 Aug 2014 15:29:33 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Suspend to file is very much like a migrate, and it makes life
easier if we have the Migration state available, so initialise it
in the savevm.c code for suspending.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
include/migration/migration.h | 1 +
include/qemu/typedefs.h | 1 +
migration.c | 2 +-
savevm.c | 2 ++
4 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index e3f4494..bbb616e 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -141,6 +141,7 @@ int migrate_fd_close(MigrationState *s);
void add_migration_state_change_notifier(Notifier *notify);
void remove_migration_state_change_notifier(Notifier *notify);
+MigrationState *migrate_init(const MigrationParams *params);
bool migration_in_setup(MigrationState *);
bool migration_has_finished(MigrationState *);
bool migration_has_failed(MigrationState *);
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 0f79b5c..8539de6 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -16,6 +16,7 @@ struct Monitor;
typedef struct Monitor Monitor;
typedef struct MigrationIncomingState MigrationIncomingState;
typedef struct MigrationParams MigrationParams;
+typedef struct MigrationState MigrationState;
typedef struct Property Property;
typedef struct PropertyInfo PropertyInfo;
diff --git a/migration.c b/migration.c
index bd7071a..500de77 100644
--- a/migration.c
+++ b/migration.c
@@ -462,7 +462,7 @@ bool migration_has_failed(MigrationState *s)
s->state == MIG_STATE_ERROR);
}
-static MigrationState *migrate_init(const MigrationParams *params)
+MigrationState *migrate_init(const MigrationParams *params)
{
MigrationState *s = migrate_get_current();
int64_t bandwidth_limit = s->bandwidth_limit;
diff --git a/savevm.c b/savevm.c
index 171676d..809bd04 100644
--- a/savevm.c
+++ b/savevm.c
@@ -941,6 +941,8 @@ static int qemu_savevm_state(QEMUFile *f)
.blk = 0,
.shared = 0
};
+ MigrationState *ms = migrate_init(¶ms);
+ ms->file = f;
if (qemu_savevm_state_blocked(NULL)) {
return -EINVAL;
--
1.9.3
- [Qemu-devel] [PATCH v2 08/43] Return path: Control commands, (continued)
- [Qemu-devel] [PATCH v2 08/43] Return path: Control commands, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 09/43] Return path: Send responses from destination to source, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 10/43] Return path: Source handling of return path, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 11/43] qemu_loadvm errors and debug, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 12/43] ram_debug_dump_bitmap: Dump a migration bitmap as text, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 13/43] Rework loadvm path for subloops, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 14/43] Add migration-capability boolean for postcopy-ram., Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 15/43] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 16/43] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 17/43] migrate_init: Call from savevm,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v2 19/43] postcopy: OS support test, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 18/43] Allow savevm handlers to state whether they could go into postcopy, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 20/43] migrate_start_postcopy: Command to trigger transition to postcopy, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 22/43] qemu_savevm_state_complete: Postcopy changes, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 24/43] Postcopy page-map-incoming (PMI) structure, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 21/43] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state, Dr. David Alan Gilbert (git), 2014/08/11
- [Qemu-devel] [PATCH v2 25/43] postcopy: Add incoming_init/cleanup functions, Dr. David Alan Gilbert (git), 2014/08/11