[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 19/45] migrate_init: Call from savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v5 19/45] migrate_init: Call from savevm |
Date: |
Wed, 25 Feb 2015 16:51:42 +0000 |
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>
Reviewed-by: David Gibson <address@hidden>
---
include/migration/migration.h | 3 +--
include/qemu/typedefs.h | 1 +
migration/migration.c | 2 +-
savevm.c | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 81cd1f2..e6a814a 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -48,8 +48,6 @@ enum mig_rpcomm_cmd {
MIG_RP_CMD_PONG, /* Response to a PING; data (seq: be32 ) */
};
-typedef struct MigrationState MigrationState;
-
typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head;
typedef enum {
@@ -146,6 +144,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 6fdcbcd..611db46 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -41,6 +41,7 @@ typedef struct MemoryRegion MemoryRegion;
typedef struct MemoryRegionSection MemoryRegionSection;
typedef struct MigrationIncomingState MigrationIncomingState;
typedef struct MigrationParams MigrationParams;
+typedef struct MigrationState MigrationState;
typedef struct Monitor Monitor;
typedef struct MouseTransformInfo MouseTransformInfo;
typedef struct MSIMessage MSIMessage;
diff --git a/migration/migration.c b/migration/migration.c
index 957115a..2e6adca 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -493,7 +493,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 f65bff3..df48ba8 100644
--- a/savevm.c
+++ b/savevm.c
@@ -982,6 +982,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;
--
2.1.0
- [Qemu-devel] [PATCH v5 06/45] Provide runtime Target page information, (continued)
- [Qemu-devel] [PATCH v5 06/45] Provide runtime Target page information, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 09/45] Migration commands, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 07/45] Return path: Open a return path on QEMUFile for sockets, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 10/45] Return path: Control commands, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 08/45] Return path: socket_writev_buffer: Block even on non-blocking fd's, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 13/45] ram_debug_dump_bitmap: Dump a migration bitmap as text, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 11/45] Return path: Send responses from destination to source, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 12/45] Return path: Source handling of return path, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 14/45] Move loadvm_handlers into MigrationIncomingState, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 15/45] Rework loadvm path for subloops, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 19/45] migrate_init: Call from savevm,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v5 18/45] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 16/45] Add migration-capability boolean for postcopy-ram., Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 17/45] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 21/45] Add Linux userfaultfd header, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 20/45] Modify savevm handlers for postcopy, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 24/45] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 22/45] postcopy: OS support test, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 23/45] migrate_start_postcopy: Command to trigger transition to postcopy, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 25/45] qemu_savevm_state_complete: Postcopy changes, Dr. David Alan Gilbert (git), 2015/02/25
- [Qemu-devel] [PATCH v5 26/45] Postcopy page-map-incoming (PMI) structure, Dr. David Alan Gilbert (git), 2015/02/25