[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/57] Add migration-capability boolean for postcopy-
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 24/57] Add migration-capability boolean for postcopy-ram. |
Date: |
Tue, 10 Nov 2015 15:25:13 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
The 'postcopy ram' capability allows postcopy migration of RAM;
note that the migration starts off in precopy mode until
postcopy mode is triggered (see the migrate_start_postcopy
patch later in the series).
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
include/migration/migration.h | 1 +
migration/migration.c | 23 +++++++++++++++++++++++
qapi-schema.json | 6 +++++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 3dc95f4..4ed7931 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -186,6 +186,7 @@ void migrate_add_blocker(Error *reason);
*/
void migrate_del_blocker(Error *reason);
+bool migrate_postcopy_ram(void);
bool migrate_zero_blocks(void);
bool migrate_auto_converge(void);
diff --git a/migration/migration.c b/migration/migration.c
index e4f91a9..f849f89 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -578,6 +578,20 @@ void
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
for (cap = params; cap; cap = cap->next) {
s->enabled_capabilities[cap->value->capability] = cap->value->state;
}
+
+ if (migrate_postcopy_ram()) {
+ if (migrate_use_compression()) {
+ /* The decompression threads asynchronously write into RAM
+ * rather than use the atomic copies needed to avoid
+ * userfaulting. It should be possible to fix the decompression
+ * threads for compatibility in future.
+ */
+ error_report("Postcopy is not currently compatible with "
+ "compression");
+ s->enabled_capabilities[MIGRATION_CAPABILITY_X_POSTCOPY_RAM] =
+ false;
+ }
+ }
}
void qmp_migrate_set_parameters(bool has_compress_level,
@@ -956,6 +970,15 @@ void qmp_migrate_set_downtime(double value, Error **errp)
max_downtime = (uint64_t)value;
}
+bool migrate_postcopy_ram(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ return s->enabled_capabilities[MIGRATION_CAPABILITY_X_POSTCOPY_RAM];
+}
+
bool migrate_auto_converge(void)
{
MigrationState *s;
diff --git a/qapi-schema.json b/qapi-schema.json
index e18f14c..8638d42 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -540,11 +540,15 @@
# @auto-converge: If enabled, QEMU will automatically throttle down the guest
# to speed up convergence of RAM migration. (since 1.6)
#
+# @x-postcopy-ram: Start executing on the migration target before all of RAM
has
+# been migrated, pulling the remaining pages along as needed. NOTE: If
+# the migration fails during postcopy the VM will fail. (since 2.5)
+#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
- 'compress', 'events'] }
+ 'compress', 'events', 'x-postcopy-ram'] }
##
# @MigrationCapabilityStatus
--
2.5.0
- [Qemu-devel] [PULL 18/57] Migration commands, (continued)
- [Qemu-devel] [PULL 18/57] Migration commands, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 22/57] Return path: Source handling of return path, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 21/57] migration_is_setup_or_active, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 26/57] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 25/57] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 27/57] Modify save_live_pending for postcopy, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 24/57] Add migration-capability boolean for postcopy-ram.,
Juan Quintela <=
[Qemu-devel] [PULL 30/57] migration_completion: Take current state, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 28/57] postcopy: OS support test, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 23/57] Rework loadvm path for subloops, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 29/57] migrate_start_postcopy: Command to trigger transition to postcopy, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 31/57] MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 32/57] Avoid sending vmdescription during postcopy, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 33/57] Add qemu_savevm_state_complete_postcopy, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 36/57] postcopy: Incoming initialisation, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 34/57] Postcopy: Maintain unsentmap, Juan Quintela, 2015/11/10
[Qemu-devel] [PULL 35/57] migration_completion: Take current state, Juan Quintela, 2015/11/10