migration.c (f774fde5d4e97cbfc64dab6622c2c53c5fe5c9fe) migration.c (9c894df3a37d675652390f7dbbe2f65b7bad7efa)
1/*
2 * QEMU live migration
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 872 unchanged lines hidden (view full) ---

881void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value)
882{
883 uint32_t buf;
884
885 buf = cpu_to_be32(value);
886 migrate_send_rp_message(mis, MIG_RP_MSG_RESUME_ACK, sizeof(buf), &buf);
887}
888
1/*
2 * QEMU live migration
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 872 unchanged lines hidden (view full) ---

881void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value)
882{
883 uint32_t buf;
884
885 buf = cpu_to_be32(value);
886 migrate_send_rp_message(mis, MIG_RP_MSG_RESUME_ACK, sizeof(buf), &buf);
887}
888
889MigrationParameters *qmp_query_migrate_parameters(Error **errp)
890{
891 MigrationParameters *params;
892 MigrationState *s = migrate_get_current();
893
894 /* TODO use QAPI_CLONE() instead of duplicating it inline */
895 params = g_malloc0(sizeof(*params));
896 params->has_compress_level = true;
897 params->compress_level = s->parameters.compress_level;
898 params->has_compress_threads = true;
899 params->compress_threads = s->parameters.compress_threads;
900 params->has_compress_wait_thread = true;
901 params->compress_wait_thread = s->parameters.compress_wait_thread;
902 params->has_decompress_threads = true;
903 params->decompress_threads = s->parameters.decompress_threads;
904 params->has_throttle_trigger_threshold = true;
905 params->throttle_trigger_threshold = s->parameters.throttle_trigger_threshold;
906 params->has_cpu_throttle_initial = true;
907 params->cpu_throttle_initial = s->parameters.cpu_throttle_initial;
908 params->has_cpu_throttle_increment = true;
909 params->cpu_throttle_increment = s->parameters.cpu_throttle_increment;
910 params->has_cpu_throttle_tailslow = true;
911 params->cpu_throttle_tailslow = s->parameters.cpu_throttle_tailslow;
912 params->tls_creds = g_strdup(s->parameters.tls_creds);
913 params->tls_hostname = g_strdup(s->parameters.tls_hostname);
914 params->tls_authz = g_strdup(s->parameters.tls_authz ?
915 s->parameters.tls_authz : "");
916 params->has_max_bandwidth = true;
917 params->max_bandwidth = s->parameters.max_bandwidth;
918 params->has_downtime_limit = true;
919 params->downtime_limit = s->parameters.downtime_limit;
920 params->has_x_checkpoint_delay = true;
921 params->x_checkpoint_delay = s->parameters.x_checkpoint_delay;
922 params->has_block_incremental = true;
923 params->block_incremental = s->parameters.block_incremental;
924 params->has_multifd_channels = true;
925 params->multifd_channels = s->parameters.multifd_channels;
926 params->has_multifd_compression = true;
927 params->multifd_compression = s->parameters.multifd_compression;
928 params->has_multifd_zlib_level = true;
929 params->multifd_zlib_level = s->parameters.multifd_zlib_level;
930 params->has_multifd_zstd_level = true;
931 params->multifd_zstd_level = s->parameters.multifd_zstd_level;
932 params->has_xbzrle_cache_size = true;
933 params->xbzrle_cache_size = s->parameters.xbzrle_cache_size;
934 params->has_max_postcopy_bandwidth = true;
935 params->max_postcopy_bandwidth = s->parameters.max_postcopy_bandwidth;
936 params->has_max_cpu_throttle = true;
937 params->max_cpu_throttle = s->parameters.max_cpu_throttle;
938 params->has_announce_initial = true;
939 params->announce_initial = s->parameters.announce_initial;
940 params->has_announce_max = true;
941 params->announce_max = s->parameters.announce_max;
942 params->has_announce_rounds = true;
943 params->announce_rounds = s->parameters.announce_rounds;
944 params->has_announce_step = true;
945 params->announce_step = s->parameters.announce_step;
946
947 if (s->parameters.has_block_bitmap_mapping) {
948 params->has_block_bitmap_mapping = true;
949 params->block_bitmap_mapping =
950 QAPI_CLONE(BitmapMigrationNodeAliasList,
951 s->parameters.block_bitmap_mapping);
952 }
953
954 return params;
955}
956
957/*
958 * Return true if we're already in the middle of a migration
959 * (i.e. any of the active or setup states)
960 */
961bool migration_is_setup_or_active(int state)
962{
963 switch (state) {
964 case MIGRATION_STATUS_ACTIVE:

--- 2801 unchanged lines hidden (view full) ---

3766 }
3767
3768 if (resume) {
3769 /* This is a resumed migration */
3770 rate_limit = migrate_max_postcopy_bandwidth() /
3771 XFER_LIMIT_RATIO;
3772 } else {
3773 /* This is a fresh new migration */
889/*
890 * Return true if we're already in the middle of a migration
891 * (i.e. any of the active or setup states)
892 */
893bool migration_is_setup_or_active(int state)
894{
895 switch (state) {
896 case MIGRATION_STATUS_ACTIVE:

--- 2801 unchanged lines hidden (view full) ---

3698 }
3699
3700 if (resume) {
3701 /* This is a resumed migration */
3702 rate_limit = migrate_max_postcopy_bandwidth() /
3703 XFER_LIMIT_RATIO;
3704 } else {
3705 /* This is a fresh new migration */
3774 rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
3706 rate_limit = migrate_max_bandwidth() / XFER_LIMIT_RATIO;
3775
3776 /* Notify before starting migration thread */
3777 notifier_list_notify(&migration_state_notifiers, s);
3778 }
3779
3780 qemu_file_set_rate_limit(s->to_dst_file, rate_limit);
3781 qemu_file_set_blocking(s->to_dst_file, true);
3782

--- 273 unchanged lines hidden ---
3707
3708 /* Notify before starting migration thread */
3709 notifier_list_notify(&migration_state_notifiers, s);
3710 }
3711
3712 qemu_file_set_rate_limit(s->to_dst_file, rate_limit);
3713 qemu_file_set_blocking(s->to_dst_file, true);
3714

--- 273 unchanged lines hidden ---