[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 21/47] migrate_init: Call from savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v3 21/47] migrate_init: Call from savevm |
Date: |
Thu, 28 Aug 2014 16:03:38 +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 2c078c4..3aeae47 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -140,6 +140,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 2fa128f..6097c3c 100644
--- a/migration.c
+++ b/migration.c
@@ -465,7 +465,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 v3 12/47] Return path: Control commands, (continued)
- [Qemu-devel] [PATCH v3 12/47] Return path: Control commands, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 13/47] Return path: Send responses from destination to source, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 16/47] ram_debug_dump_bitmap: Dump a migration bitmap as text, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 17/47] Rework loadvm path for subloops, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 06/47] Add qemu_get_counted_string to read a string prefixed by a count byte, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 18/47] Add migration-capability boolean for postcopy-ram., Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 20/47] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 22/47] Allow savevm handlers to state whether they could go into postcopy, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 23/47] postcopy: OS support test, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 11/47] Migration commands, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 21/47] migrate_init: Call from savevm,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v3 24/47] migrate_start_postcopy: Command to trigger transition to postcopy, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 25/47] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 27/47] Postcopy: Maintain sentmap during postcopy pre phase, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 28/47] Postcopy page-map-incoming (PMI) structure, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 29/47] postcopy: Add incoming_init/cleanup functions, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 26/47] qemu_savevm_state_complete: Postcopy changes, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 15/47] qemu_loadvm errors and debug, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 19/47] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 31/47] postcopy: ram_enable_notify to switch on userfault, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 34/47] mig fd_connect: open return path, Dr. David Alan Gilbert (git), 2014/08/28