aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.h
diff options
context:
space:
mode:
authorAlexey Perevalov <a.perevalov@samsung.com>2017-10-30 16:16:26 +0300
committerJuan Quintela <quintela@redhat.com>2018-01-15 12:48:00 +0100
commit01a87f0bd38b06ff92e0fc08ecf54eefab6d9ca8 (patch)
tree89a329eb9ab41b0f0b5cdf316d3c445468b65650 /migration/migration.h
parent31bf06a9d6844d9977b028bd9b855d53288f979c (diff)
downloadqemu-01a87f0bd38b06ff92e0fc08ecf54eefab6d9ca8.zip
qemu-01a87f0bd38b06ff92e0fc08ecf54eefab6d9ca8.tar.gz
qemu-01a87f0bd38b06ff92e0fc08ecf54eefab6d9ca8.tar.bz2
migration: add postcopy blocktime ctx into MigrationIncomingState
This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, in case this feature is provided by kernel. PostcopyBlocktimeContext is encapsulated inside postcopy-ram.c, due to it being a postcopy-only feature. Also it defines PostcopyBlocktimeContext's instance live time. Information from PostcopyBlocktimeContext instance will be provided much after postcopy migration end, instance of PostcopyBlocktimeContext will live till QEMU exit, but part of it (vcpu_addr, page_fault_vcpu_time) used only during calculation, will be released when postcopy ended or failed. To enable postcopy blocktime calculation on destination, need to request proper compatibility (Patch for documentation will be at the tail of the patch set). As an example following command enable that capability, assume QEMU was started with -chardev socket,id=charmonitor,path=/var/lib/migrate-vm-monitor.sock option to control it [root@host]#printf "{\"execute\" : \"qmp_capabilities\"}\r\n \ {\"execute\": \"migrate-set-capabilities\" , \"arguments\": { \"capabilities\": [ { \"capability\": \"postcopy-blocktime\", \"state\": true } ] } }" | nc -U /var/lib/migrate-vm-monitor.sock Or just with HMP (qemu) migrate_set_capability postcopy-blocktime on Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.h')
-rw-r--r--migration/migration.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/migration/migration.h b/migration/migration.h
index 9ab8d070..7e06c11 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -22,6 +22,8 @@
#include "hw/qdev.h"
#include "io/channel.h"
+struct PostcopyBlocktimeContext;
+
/* State for the incoming migration */
struct MigrationIncomingState {
QEMUFile *from_src_file;
@@ -59,6 +61,12 @@ struct MigrationIncomingState {
/* The coroutine we should enter (back) after failover */
Coroutine *migration_incoming_co;
QemuSemaphore colo_incoming_sem;
+
+ /*
+ * PostcopyBlocktimeContext to keep information for postcopy
+ * live migration, to calculate vCPU block time
+ * */
+ struct PostcopyBlocktimeContext *blocktime_ctx;
};
MigrationIncomingState *migration_incoming_get_current(void);