2023-03-01 23:18:45 +03:00
|
|
|
/*
|
|
|
|
* QEMU migration capabilities
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012-2023 Red Hat Inc
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Orit Wasserman <owasserm@redhat.com>
|
|
|
|
* Juan Quintela <quintela@redhat.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QEMU_MIGRATION_OPTIONS_H
|
|
|
|
#define QEMU_MIGRATION_OPTIONS_H
|
|
|
|
|
2023-03-02 14:55:57 +03:00
|
|
|
#include "hw/qdev-properties.h"
|
|
|
|
#include "hw/qdev-properties-system.h"
|
|
|
|
|
|
|
|
/* migration properties */
|
|
|
|
|
|
|
|
extern Property migration_properties[];
|
|
|
|
|
2023-03-01 23:18:45 +03:00
|
|
|
/* capabilities */
|
|
|
|
|
|
|
|
bool migrate_auto_converge(void);
|
|
|
|
bool migrate_background_snapshot(void);
|
2023-03-02 00:23:57 +03:00
|
|
|
bool migrate_block(void);
|
2023-03-02 00:00:16 +03:00
|
|
|
bool migrate_colo(void);
|
2023-03-02 00:03:48 +03:00
|
|
|
bool migrate_compress(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_dirty_bitmaps(void);
|
2023-06-07 18:30:50 +03:00
|
|
|
bool migrate_dirty_limit(void);
|
2023-03-02 00:08:09 +03:00
|
|
|
bool migrate_events(void);
|
2024-02-29 18:30:01 +03:00
|
|
|
bool migrate_mapped_ram(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_ignore_shared(void);
|
|
|
|
bool migrate_late_block_activate(void);
|
2023-03-02 00:10:29 +03:00
|
|
|
bool migrate_multifd(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_pause_before_switchover(void);
|
|
|
|
bool migrate_postcopy_blocktime(void);
|
|
|
|
bool migrate_postcopy_preempt(void);
|
|
|
|
bool migrate_postcopy_ram(void);
|
2023-03-02 00:41:55 +03:00
|
|
|
bool migrate_rdma_pin_all(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_release_ram(void);
|
2023-03-02 00:25:47 +03:00
|
|
|
bool migrate_return_path(void);
|
2023-06-21 14:11:54 +03:00
|
|
|
bool migrate_switchover_ack(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_validate_uuid(void);
|
2023-03-02 00:20:13 +03:00
|
|
|
bool migrate_xbzrle(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
bool migrate_zero_blocks(void);
|
2023-03-02 00:17:14 +03:00
|
|
|
bool migrate_zero_copy_send(void);
|
2023-03-01 23:18:45 +03:00
|
|
|
|
2023-03-02 12:44:20 +03:00
|
|
|
/*
|
|
|
|
* pseudo capabilities
|
|
|
|
*
|
|
|
|
* These are functions that are used in a similar way to capabilities
|
|
|
|
* check, but they are not a capability.
|
|
|
|
*/
|
|
|
|
|
2022-06-21 13:13:14 +03:00
|
|
|
bool migrate_multifd_flush_after_each_section(void);
|
2023-03-02 12:44:20 +03:00
|
|
|
bool migrate_postcopy(void);
|
2023-10-11 23:35:15 +03:00
|
|
|
bool migrate_rdma(void);
|
2023-03-02 12:41:23 +03:00
|
|
|
bool migrate_tls(void);
|
2023-03-02 12:44:20 +03:00
|
|
|
|
2023-03-02 01:05:53 +03:00
|
|
|
/* capabilities helpers */
|
|
|
|
|
|
|
|
bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp);
|
2023-03-02 01:25:44 +03:00
|
|
|
bool migrate_cap_set(int cap, bool value, Error **errp);
|
2023-03-02 01:05:53 +03:00
|
|
|
|
2023-03-02 02:39:03 +03:00
|
|
|
/* parameters */
|
|
|
|
|
2023-03-02 14:49:16 +03:00
|
|
|
const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void);
|
2023-05-03 21:10:36 +03:00
|
|
|
bool migrate_has_block_bitmap_mapping(void);
|
|
|
|
|
2023-03-02 02:49:47 +03:00
|
|
|
bool migrate_block_incremental(void);
|
2023-03-02 03:04:55 +03:00
|
|
|
uint32_t migrate_checkpoint_delay(void);
|
2023-03-02 02:39:03 +03:00
|
|
|
int migrate_compress_level(void);
|
|
|
|
int migrate_compress_threads(void);
|
|
|
|
int migrate_compress_wait_thread(void);
|
2023-03-02 12:20:49 +03:00
|
|
|
uint8_t migrate_cpu_throttle_increment(void);
|
2023-03-02 03:22:44 +03:00
|
|
|
uint8_t migrate_cpu_throttle_initial(void);
|
2023-03-02 12:29:51 +03:00
|
|
|
bool migrate_cpu_throttle_tailslow(void);
|
2023-03-02 02:39:03 +03:00
|
|
|
int migrate_decompress_threads(void);
|
2023-03-02 14:00:43 +03:00
|
|
|
uint64_t migrate_downtime_limit(void);
|
2023-03-02 03:13:01 +03:00
|
|
|
uint8_t migrate_max_cpu_throttle(void);
|
2023-03-02 13:00:12 +03:00
|
|
|
uint64_t migrate_max_bandwidth(void);
|
migration: Allow user to specify available switchover bandwidth
Migration bandwidth is a very important value to live migration. It's
because it's one of the major factors that we'll make decision on when to
switchover to destination in a precopy process.
This value is currently estimated by QEMU during the whole live migration
process by monitoring how fast we were sending the data. This can be the
most accurate bandwidth if in the ideal world, where we're always feeding
unlimited data to the migration channel, and then it'll be limited to the
bandwidth that is available.
However in reality it may be very different, e.g., over a 10Gbps network we
can see query-migrate showing migration bandwidth of only a few tens of
MB/s just because there are plenty of other things the migration thread
might be doing. For example, the migration thread can be busy scanning
zero pages, or it can be fetching dirty bitmap from other external dirty
sources (like vhost or KVM). It means we may not be pushing data as much
as possible to migration channel, so the bandwidth estimated from "how many
data we sent in the channel" can be dramatically inaccurate sometimes.
With that, the decision to switchover will be affected, by assuming that we
may not be able to switchover at all with such a low bandwidth, but in
reality we can.
The migration may not even converge at all with the downtime specified,
with that wrong estimation of bandwidth, keeping iterations forever with a
low estimation of bandwidth.
The issue is QEMU itself may not be able to avoid those uncertainties on
measuing the real "available migration bandwidth". At least not something
I can think of so far.
One way to fix this is when the user is fully aware of the available
bandwidth, then we can allow the user to help providing an accurate value.
For example, if the user has a dedicated channel of 10Gbps for migration
for this specific VM, the user can specify this bandwidth so QEMU can
always do the calculation based on this fact, trusting the user as long as
specified. It may not be the exact bandwidth when switching over (in which
case qemu will push migration data as fast as possible), but much better
than QEMU trying to wildly guess, especially when very wrong.
A new parameter "avail-switchover-bandwidth" is introduced just for this.
So when the user specified this parameter, instead of trusting the
estimated value from QEMU itself (based on the QEMUFile send speed), it
trusts the user more by using this value to decide when to switchover,
assuming that we'll have such bandwidth available then.
Note that specifying this value will not throttle the bandwidth for
switchover yet, so QEMU will always use the full bandwidth possible for
sending switchover data, assuming that should always be the most important
way to use the network at that time.
This can resolve issues like "unconvergence migration" which is caused by
hilarious low "migration bandwidth" detected for whatever reason.
Reported-by: Zhiyi Guo <zhguo@redhat.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231010221922.40638-1-peterx@redhat.com>
2023-10-11 01:19:22 +03:00
|
|
|
uint64_t migrate_avail_switchover_bandwidth(void);
|
2023-05-04 14:38:33 +03:00
|
|
|
uint64_t migrate_max_postcopy_bandwidth(void);
|
2023-10-25 22:44:24 +03:00
|
|
|
MigMode migrate_mode(void);
|
2023-03-02 02:39:03 +03:00
|
|
|
int migrate_multifd_channels(void);
|
|
|
|
MultiFDCompression migrate_multifd_compression(void);
|
|
|
|
int migrate_multifd_zlib_level(void);
|
|
|
|
int migrate_multifd_zstd_level(void);
|
2023-03-02 02:59:13 +03:00
|
|
|
uint8_t migrate_throttle_trigger_threshold(void);
|
2023-03-02 14:33:50 +03:00
|
|
|
const char *migrate_tls_authz(void);
|
2023-03-02 14:17:06 +03:00
|
|
|
const char *migrate_tls_creds(void);
|
2023-03-02 14:37:21 +03:00
|
|
|
const char *migrate_tls_hostname(void);
|
2023-03-02 02:39:03 +03:00
|
|
|
uint64_t migrate_xbzrle_cache_size(void);
|
|
|
|
|
2023-03-02 14:05:03 +03:00
|
|
|
/* parameters setters */
|
|
|
|
|
|
|
|
void migrate_set_block_incremental(bool value);
|
|
|
|
|
2023-03-02 12:13:16 +03:00
|
|
|
/* parameters helpers */
|
|
|
|
|
|
|
|
bool migrate_params_check(MigrationParameters *params, Error **errp);
|
2023-03-02 12:35:24 +03:00
|
|
|
void migrate_params_init(MigrationParameters *params);
|
2023-03-02 14:10:33 +03:00
|
|
|
void block_cleanup_parameters(void);
|
2023-03-02 12:13:16 +03:00
|
|
|
|
2023-03-01 23:18:45 +03:00
|
|
|
#endif
|