[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 13/56] migrate_init: Call from savevm
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v9 13/56] migrate_init: Call from savevm |
Date: |
Thu, 5 Nov 2015 18:10:40 +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>
Reviewed-by: Juan Quintela <address@hidden>
Reviewd-by: Amit Shah <address@hidden>
---
include/migration/migration.h | 4 +---
include/qemu/typedefs.h | 1 +
migration/migration.c | 2 +-
migration/savevm.c | 2 ++
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 51bc348..82cc3a6 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -42,10 +42,7 @@ struct MigrationParams {
bool shared;
};
-typedef struct MigrationState MigrationState;
-
typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head;
-
/* State for the incoming migration */
struct MigrationIncomingState {
QEMUFile *from_src_file;
@@ -116,6 +113,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 e4b8520..ac5b240 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -43,6 +43,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 6fef544..82efbeb 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -682,7 +682,7 @@ bool migration_has_failed(MigrationState *s)
s->state == MIGRATION_STATUS_FAILED);
}
-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/migration/savevm.c b/migration/savevm.c
index 638aa1f..9dc57d3 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -922,6 +922,8 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
.blk = 0,
.shared = 0
};
+ MigrationState *ms = migrate_init(¶ms);
+ ms->file = f;
if (qemu_savevm_state_blocked(errp)) {
return -EINVAL;
--
2.5.0
- [Qemu-devel] [PATCH v9 06/56] qemu_ram_block_by_name, (continued)
- [Qemu-devel] [PATCH v9 06/56] qemu_ram_block_by_name, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 08/56] Add qemu_get_buffer_in_place to avoid copies some of the time, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 07/56] Rename mis->file to from_src_file, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 09/56] Add wrapper for setting blocking status on a QEMUFile, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 10/56] Add QEMU_MADV_NOHUGEPAGE, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 11/56] ram_debug_dump_bitmap: Dump a migration bitmap as text, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 12/56] ram_load: Factor out host_from_stream_offset call and check, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 13/56] migrate_init: Call from savevm,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v9 16/56] Return path: Open a return path on QEMUFile for sockets, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 15/56] Add Linux userfaultfd.h header, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 14/56] Rename save_live_complete to save_live_complete_precopy, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 17/56] Return path: socket_writev_buffer: Block even on non-blocking fd's, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 18/56] Migration commands, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 19/56] Return path: Control commands, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 20/56] Return path: Send responses from destination to source, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 21/56] migration_is_setup_or_active, Dr. David Alan Gilbert (git), 2015/11/05