[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 17/42] Add migration-capability boolean for postc
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v7 17/42] Add migration-capability boolean for postcopy-ram. |
Date: |
Tue, 16 Jun 2015 11:26:30 +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>
---
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 1bf78f6..da4b72f 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -183,6 +183,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 a743018..cd89a9b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -408,6 +408,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,
@@ -770,6 +784,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 6e17a5c..0b6fe54 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -526,11 +526,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.4)
+#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
- 'compress'] }
+ 'compress', 'x-postcopy-ram'] }
##
# @MigrationCapabilityStatus
--
2.4.3
- [Qemu-devel] [PATCH v7 06/42] Add wrapper for setting blocking status on a QEMUFile, (continued)
- [Qemu-devel] [PATCH v7 06/42] Add wrapper for setting blocking status on a QEMUFile, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 07/42] ram_debug_dump_bitmap: Dump a migration bitmap as text, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 08/42] migrate_init: Call from savevm, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 09/42] Rename save_live_complete to save_live_complete_precopy, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 10/42] Return path: Open a return path on QEMUFile for sockets, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 11/42] Return path: socket_writev_buffer: Block even on non-blocking fd's, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 12/42] Migration commands, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 13/42] Return path: Control commands, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 14/42] Return path: Send responses from destination to source, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 15/42] Return path: Source handling of return path, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 17/42] Add migration-capability boolean for postcopy-ram.,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v7 16/42] Rework loadvm path for subloops, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 19/42] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 20/42] Modify save_live_pending for postcopy, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 18/42] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 22/42] migrate_start_postcopy: Command to trigger transition to postcopy, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 21/42] postcopy: OS support test, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 23/42] MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state, Dr. David Alan Gilbert (git), 2015/06/16
- [Qemu-devel] [PATCH v7 24/42] Add qemu_savevm_state_complete_postcopy, Dr. David Alan Gilbert (git), 2015/06/16