[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 23/47] migrate_init: Call from savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v4 23/47] migrate_init: Call from savevm |
Date: |
Fri, 3 Oct 2014 18:47:29 +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 527423e..3a45b2a 100644
--- a/migration.c
+++ b/migration.c
@@ -488,7 +488,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 bffe890..a368a25 100644
--- a/savevm.c
+++ b/savevm.c
@@ -949,6 +949,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 v4 19/47] Rework loadvm path for subloops, (continued)
[Qemu-devel] [PATCH v4 20/47] Add migration-capability boolean for postcopy-ram., Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 21/47] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 22/47] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 23/47] migrate_init: Call from savevm,
Dr. David Alan Gilbert (git) <=
[Qemu-devel] [PATCH v4 24/47] Allow savevm handlers to state whether they could go into postcopy, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 25/47] postcopy: OS support test, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 26/47] migrate_start_postcopy: Command to trigger transition to postcopy, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 27/47] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 28/47] qemu_savevm_state_complete: Postcopy changes, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 29/47] Postcopy page-map-incoming (PMI) structure, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 30/47] Postcopy: Maintain sentmap and calculate discard, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 31/47] postcopy: Incoming initialisation, Dr. David Alan Gilbert (git), 2014/10/03
[Qemu-devel] [PATCH v4 32/47] postcopy: ram_enable_notify to switch on userfault, Dr. David Alan Gilbert (git), 2014/10/03