mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'migration-20230424-pull-request' of https://gitlab.com/juan.quintela/qemu into staging
Migration Pull request Everything that was reviewed since last PULL request: - fix to control flow (eric) - rearrange of hmp commands (juan) - Make capabilities more consistent and coherent (juan) Not all of them reviewed yet, so only the ones reviewed. Later, Juan. PD. I am waiting to finish review of the compression fixes to send them. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmRGf0kACgkQ9IfvGFhy # 1yNojRAAhvOZoYRpTizbSo7wOr2TpO4F1R/opWECubBvw3/yTo3ifsVjovRo/nxe # zmCXnY/ykqxskb/OMNyLZQYG4MPT24nyf7dhT3VxcFjTYsaNU59yvJoBtvy7Oq5h # 3Yk0459eKmsP39IXFlAMMRBwX+Hu3aE/8xAAHOowAhkmDkMFYjf7I1Lxpuarbhp+ # k9O5eqdNchG21YUzWXUe4ivAWqZmvzXtkwCp+XJ/KizjIEKgsm8HO1nwm5mtpmnu # SS9Kkf957jYHqK73YXQhUV+iQ0kCVpclBPfZc2KuzudPi/aMG6LEVKfV//z5KIAz # amME/6D1oSBfpgtqoCCPELdNfZOz+ZIa+XJzXlWkuiBDu9yNpUP339EVClmStwFu # 1UAOJIs8VUjPr9zTItgCDjZ17nh4Q0I04aMGuxgQIu82e8CTgS/QrnH2Tr2lUoMO # QLgYAetVIDGVVFAA9Clba4C7AbS5hBeWMnd9Qd4cP93d6Z/C65xUv0a9mI7edpMb # RNbvg73ZZCb6tye25cPSr07VaGTS+TELVMEh9RX3KZrfMTsHfGQ/ZHZv9wqJrQ04 # 0wCidqBIbBk+BN8AtJ9vwqtPpL/Nf/BwDKPiwOVuZHCcrP+veXtlKb00SwNpJwkN # x3Ld4cq22ZLeqO4dMueK16ij0ZpuXsF7jM/ptEvxrw6oxh/6xYQ= # =g5gx # -----END PGP SIGNATURE----- # gpg: Signature made Mon 24 Apr 2023 02:08:25 PM BST # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [undefined] # gpg: aka "Juan Quintela <quintela@trasno.org>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * tag 'migration-20230424-pull-request' of https://gitlab.com/juan.quintela/qemu: (30 commits) migration: Create migrate_max_bandwidth() function migration: Move migrate_postcopy() to options.c migration: Create migrate_cpu_throttle_tailslow() function migration: Create migrate_cpu_throttle_increment() function migration: Create migrate_cpu_throttle_initial() to option.c migration: Move migrate_announce_params() to option.c migration: Create migrate_max_cpu_throttle() migration: Create migrate_checkpoint_delay() migration: Create migrate_throttle_trigger_threshold() migration: Move migrate_use_block_incremental() to option.c migration: Use migrate_max_postcopy_bandwidth() migration: Move parameters functions to option.c migration: Move migrate_cap_set() to options.c migration: Move qmp_migrate_set_capabilities() to options.c migration: Move qmp_query_migrate_capabilities() to options.c migration: Move migrate_caps_check() to options.c migration: Create migrate_rdma_pin_all() function migration: Move migrate_use_return() to options.c migration: Move migrate_use_block() to options.c migration: Move migrate_use_xbzrle() to options.c ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "migration/misc.h"
|
||||
#include "migration/migration.h"
|
||||
#include "migration/options.h"
|
||||
|
||||
#include "hw/virtio/virtio-bus.h"
|
||||
#include "hw/virtio/virtio-access.h"
|
||||
|
||||
@@ -66,7 +66,6 @@ bool migration_has_finished(MigrationState *);
|
||||
bool migration_has_failed(MigrationState *);
|
||||
/* ...and after the device transmission */
|
||||
bool migration_in_postcopy_after_devices(MigrationState *);
|
||||
void migration_global_dump(Monitor *mon);
|
||||
/* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */
|
||||
bool migration_in_incoming_postcopy(void);
|
||||
/* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
#include "qapi/qapi-visit-migration.h"
|
||||
#include "qapi/clone-visitor.h"
|
||||
#include "trace.h"
|
||||
#include "options.h"
|
||||
|
||||
#define CHUNK_SIZE (1 << 10)
|
||||
|
||||
|
||||
+3
-2
@@ -28,6 +28,7 @@
|
||||
#include "migration/vmstate.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "trace.h"
|
||||
#include "options.h"
|
||||
|
||||
#define BLK_MIG_BLOCK_SIZE (1ULL << 20)
|
||||
#define BDRV_SECTORS_PER_DIRTY_CHUNK (BLK_MIG_BLOCK_SIZE >> BDRV_SECTOR_BITS)
|
||||
@@ -416,7 +417,7 @@ static int init_blk_migration(QEMUFile *f)
|
||||
bmds->bulk_completed = 0;
|
||||
bmds->total_sectors = sectors;
|
||||
bmds->completed_sectors = 0;
|
||||
bmds->shared_base = migrate_use_block_incremental();
|
||||
bmds->shared_base = migrate_block_incremental();
|
||||
|
||||
assert(i < num_bs);
|
||||
bmds_bs[i].bmds = bmds;
|
||||
@@ -1000,7 +1001,7 @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
|
||||
|
||||
static bool block_is_active(void *opaque)
|
||||
{
|
||||
return migrate_use_block();
|
||||
return migrate_block();
|
||||
}
|
||||
|
||||
static SaveVMHandlers savevm_block_handlers = {
|
||||
|
||||
+3
-3
@@ -36,6 +36,7 @@
|
||||
#include "sysemu/cpus.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "net/filter.h"
|
||||
#include "options.h"
|
||||
|
||||
static bool vmstate_loading;
|
||||
static Notifier packets_compare_notifier;
|
||||
@@ -575,7 +576,7 @@ static void colo_process_checkpoint(MigrationState *s)
|
||||
trace_colo_vm_state_change("stop", "run");
|
||||
|
||||
timer_mod(s->colo_delay_timer, qemu_clock_get_ms(QEMU_CLOCK_HOST) +
|
||||
s->parameters.x_checkpoint_delay);
|
||||
migrate_checkpoint_delay());
|
||||
|
||||
while (s->state == MIGRATION_STATUS_COLO) {
|
||||
if (failover_get_state() != FAILOVER_STATUS_NONE) {
|
||||
@@ -650,8 +651,7 @@ void colo_checkpoint_notify(void *opaque)
|
||||
|
||||
qemu_event_set(&s->colo_checkpoint_event);
|
||||
s->colo_checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
|
||||
next_notify_time = s->colo_checkpoint_time +
|
||||
s->parameters.x_checkpoint_delay;
|
||||
next_notify_time = s->colo_checkpoint_time + migrate_checkpoint_delay();
|
||||
timer_mod(s->colo_delay_timer, next_notify_time);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ softmmu_ss.add(files(
|
||||
'migration.c',
|
||||
'multifd.c',
|
||||
'multifd-zlib.c',
|
||||
'options.c',
|
||||
'postcopy-ram.c',
|
||||
'savevm.c',
|
||||
'socket.c',
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "block/qapi.h"
|
||||
#include "migration/misc.h"
|
||||
#include "migration/snapshot.h"
|
||||
#include "monitor/hmp.h"
|
||||
#include "monitor/monitor.h"
|
||||
@@ -30,6 +29,27 @@
|
||||
#include "qemu/sockets.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "ui/qemu-spice.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "migration.h"
|
||||
|
||||
static void migration_global_dump(Monitor *mon)
|
||||
{
|
||||
MigrationState *ms = migrate_get_current();
|
||||
|
||||
monitor_printf(mon, "globals:\n");
|
||||
monitor_printf(mon, "store-global-state: %s\n",
|
||||
ms->store_global_state ? "on" : "off");
|
||||
monitor_printf(mon, "only-migratable: %s\n",
|
||||
only_migratable ? "on" : "off");
|
||||
monitor_printf(mon, "send-configuration: %s\n",
|
||||
ms->send_configuration ? "on" : "off");
|
||||
monitor_printf(mon, "send-section-footer: %s\n",
|
||||
ms->send_section_footer ? "on" : "off");
|
||||
monitor_printf(mon, "decompress-error-check: %s\n",
|
||||
ms->decompress_error_check ? "on" : "off");
|
||||
monitor_printf(mon, "clear-bitmap-shift: %u\n",
|
||||
ms->clear_bitmap_shift);
|
||||
}
|
||||
|
||||
void hmp_info_migrate(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
@@ -616,23 +636,6 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *err = NULL;
|
||||
const char *protocol = qdict_get_str(qdict, "protocol");
|
||||
const char *hostname = qdict_get_str(qdict, "hostname");
|
||||
bool has_port = qdict_haskey(qdict, "port");
|
||||
int port = qdict_get_try_int(qdict, "port", -1);
|
||||
bool has_tls_port = qdict_haskey(qdict, "tls-port");
|
||||
int tls_port = qdict_get_try_int(qdict, "tls-port", -1);
|
||||
const char *cert_subject = qdict_get_try_str(qdict, "cert-subject");
|
||||
|
||||
qmp_client_migrate_info(protocol, hostname,
|
||||
has_port, port, has_tls_port, tls_port,
|
||||
cert_subject, &err);
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
void hmp_migrate_start_postcopy(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *err = NULL;
|
||||
|
||||
+22
-697
File diff suppressed because it is too large
Load Diff
@@ -447,50 +447,10 @@ bool migration_is_blocked(Error **errp);
|
||||
bool migration_in_postcopy(void);
|
||||
MigrationState *migrate_get_current(void);
|
||||
|
||||
bool migrate_postcopy(void);
|
||||
|
||||
bool migrate_release_ram(void);
|
||||
bool migrate_postcopy_ram(void);
|
||||
bool migrate_zero_blocks(void);
|
||||
bool migrate_dirty_bitmaps(void);
|
||||
bool migrate_ignore_shared(void);
|
||||
bool migrate_validate_uuid(void);
|
||||
|
||||
bool migrate_auto_converge(void);
|
||||
bool migrate_use_multifd(void);
|
||||
bool migrate_pause_before_switchover(void);
|
||||
int migrate_multifd_channels(void);
|
||||
MultiFDCompression migrate_multifd_compression(void);
|
||||
int migrate_multifd_zlib_level(void);
|
||||
int migrate_multifd_zstd_level(void);
|
||||
|
||||
#ifdef CONFIG_LINUX
|
||||
bool migrate_use_zero_copy_send(void);
|
||||
#else
|
||||
#define migrate_use_zero_copy_send() (false)
|
||||
#endif
|
||||
int migrate_use_tls(void);
|
||||
int migrate_use_xbzrle(void);
|
||||
uint64_t migrate_xbzrle_cache_size(void);
|
||||
bool migrate_colo_enabled(void);
|
||||
|
||||
bool migrate_use_block(void);
|
||||
bool migrate_use_block_incremental(void);
|
||||
int migrate_max_cpu_throttle(void);
|
||||
bool migrate_use_return_path(void);
|
||||
|
||||
uint64_t ram_get_total_transferred_pages(void);
|
||||
|
||||
bool migrate_use_compression(void);
|
||||
int migrate_compress_level(void);
|
||||
int migrate_compress_threads(void);
|
||||
int migrate_compress_wait_thread(void);
|
||||
int migrate_decompress_threads(void);
|
||||
bool migrate_use_events(void);
|
||||
bool migrate_postcopy_blocktime(void);
|
||||
bool migrate_background_snapshot(void);
|
||||
bool migrate_postcopy_preempt(void);
|
||||
|
||||
/* Sending on the return path - generic and then for each message type */
|
||||
void migrate_send_rp_shut(MigrationIncomingState *mis,
|
||||
uint32_t value);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "qapi/error.h"
|
||||
#include "migration.h"
|
||||
#include "trace.h"
|
||||
#include "options.h"
|
||||
#include "multifd.h"
|
||||
|
||||
struct zlib_data {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "qapi/error.h"
|
||||
#include "migration.h"
|
||||
#include "trace.h"
|
||||
#include "options.h"
|
||||
#include "multifd.h"
|
||||
|
||||
struct zstd_data {
|
||||
|
||||
+12
-12
@@ -25,7 +25,7 @@
|
||||
#include "trace.h"
|
||||
#include "multifd.h"
|
||||
#include "threadinfo.h"
|
||||
|
||||
#include "options.h"
|
||||
#include "qemu/yank.h"
|
||||
#include "io/channel-socket.h"
|
||||
#include "yank_functions.h"
|
||||
@@ -516,7 +516,7 @@ void multifd_save_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return;
|
||||
}
|
||||
multifd_send_terminate_threads(NULL);
|
||||
@@ -587,7 +587,7 @@ int multifd_send_sync_main(QEMUFile *f)
|
||||
int i;
|
||||
bool flush_zero_copy;
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return 0;
|
||||
}
|
||||
if (multifd_send_state->pages->num) {
|
||||
@@ -608,7 +608,7 @@ int multifd_send_sync_main(QEMUFile *f)
|
||||
* all the dirty bitmaps.
|
||||
*/
|
||||
|
||||
flush_zero_copy = migrate_use_zero_copy_send();
|
||||
flush_zero_copy = migrate_zero_copy_send();
|
||||
|
||||
for (i = 0; i < migrate_multifd_channels(); i++) {
|
||||
MultiFDSendParams *p = &multifd_send_state->params[i];
|
||||
@@ -653,7 +653,7 @@ static void *multifd_send_thread(void *opaque)
|
||||
MigrationThread *thread = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret = 0;
|
||||
bool use_zero_copy_send = migrate_use_zero_copy_send();
|
||||
bool use_zero_copy_send = migrate_zero_copy_send();
|
||||
|
||||
thread = MigrationThreadAdd(p->name, qemu_get_thread_id());
|
||||
|
||||
@@ -911,7 +911,7 @@ int multifd_save_setup(Error **errp)
|
||||
uint32_t page_count = MULTIFD_PACKET_SIZE / qemu_target_page_size();
|
||||
uint8_t i;
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -945,7 +945,7 @@ int multifd_save_setup(Error **errp)
|
||||
p->page_size = qemu_target_page_size();
|
||||
p->page_count = page_count;
|
||||
|
||||
if (migrate_use_zero_copy_send()) {
|
||||
if (migrate_zero_copy_send()) {
|
||||
p->write_flags = QIO_CHANNEL_WRITE_FLAG_ZERO_COPY;
|
||||
} else {
|
||||
p->write_flags = 0;
|
||||
@@ -1016,7 +1016,7 @@ static void multifd_recv_terminate_threads(Error *err)
|
||||
|
||||
void multifd_load_shutdown(void)
|
||||
{
|
||||
if (migrate_use_multifd()) {
|
||||
if (migrate_multifd()) {
|
||||
multifd_recv_terminate_threads(NULL);
|
||||
}
|
||||
}
|
||||
@@ -1025,7 +1025,7 @@ void multifd_load_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return;
|
||||
}
|
||||
multifd_recv_terminate_threads(NULL);
|
||||
@@ -1072,7 +1072,7 @@ void multifd_recv_sync_main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < migrate_multifd_channels(); i++) {
|
||||
@@ -1170,7 +1170,7 @@ int multifd_load_setup(Error **errp)
|
||||
* Return successfully if multiFD recv state is already initialised
|
||||
* or multiFD is not enabled.
|
||||
*/
|
||||
if (multifd_recv_state || !migrate_use_multifd()) {
|
||||
if (multifd_recv_state || !migrate_multifd()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1216,7 +1216,7 @@ bool multifd_recv_all_channels_created(void)
|
||||
{
|
||||
int thread_count = migrate_multifd_channels();
|
||||
|
||||
if (!migrate_use_multifd()) {
|
||||
if (!migrate_multifd()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
/* capabilities */
|
||||
|
||||
bool migrate_auto_converge(void);
|
||||
bool migrate_background_snapshot(void);
|
||||
bool migrate_block(void);
|
||||
bool migrate_colo(void);
|
||||
bool migrate_compress(void);
|
||||
bool migrate_dirty_bitmaps(void);
|
||||
bool migrate_events(void);
|
||||
bool migrate_ignore_shared(void);
|
||||
bool migrate_late_block_activate(void);
|
||||
bool migrate_multifd(void);
|
||||
bool migrate_pause_before_switchover(void);
|
||||
bool migrate_postcopy_blocktime(void);
|
||||
bool migrate_postcopy_preempt(void);
|
||||
bool migrate_postcopy_ram(void);
|
||||
bool migrate_rdma_pin_all(void);
|
||||
bool migrate_release_ram(void);
|
||||
bool migrate_return_path(void);
|
||||
bool migrate_validate_uuid(void);
|
||||
bool migrate_xbzrle(void);
|
||||
bool migrate_zero_blocks(void);
|
||||
bool migrate_zero_copy_send(void);
|
||||
|
||||
/*
|
||||
* pseudo capabilities
|
||||
*
|
||||
* These are functions that are used in a similar way to capabilities
|
||||
* check, but they are not a capability.
|
||||
*/
|
||||
|
||||
bool migrate_postcopy(void);
|
||||
|
||||
/* capabilities helpers */
|
||||
|
||||
bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp);
|
||||
bool migrate_cap_set(int cap, bool value, Error **errp);
|
||||
|
||||
/* parameters */
|
||||
|
||||
bool migrate_block_incremental(void);
|
||||
uint32_t migrate_checkpoint_delay(void);
|
||||
int migrate_compress_level(void);
|
||||
int migrate_compress_threads(void);
|
||||
int migrate_compress_wait_thread(void);
|
||||
uint8_t migrate_cpu_throttle_increment(void);
|
||||
uint8_t migrate_cpu_throttle_initial(void);
|
||||
bool migrate_cpu_throttle_tailslow(void);
|
||||
int migrate_decompress_threads(void);
|
||||
uint8_t migrate_max_cpu_throttle(void);
|
||||
uint64_t migrate_max_bandwidth(void);
|
||||
int64_t migrate_max_postcopy_bandwidth(void);
|
||||
int migrate_multifd_channels(void);
|
||||
MultiFDCompression migrate_multifd_compression(void);
|
||||
int migrate_multifd_zlib_level(void);
|
||||
int migrate_multifd_zstd_level(void);
|
||||
uint8_t migrate_throttle_trigger_threshold(void);
|
||||
uint64_t migrate_xbzrle_cache_size(void);
|
||||
|
||||
#endif
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "tls.h"
|
||||
#include "qemu/userfaultfd.h"
|
||||
#include "qemu/mmap-alloc.h"
|
||||
#include "options.h"
|
||||
|
||||
/* Arbitrary limit on size of each discard command,
|
||||
* keeps them around ~200 bytes
|
||||
|
||||
+21
-22
@@ -57,6 +57,7 @@
|
||||
#include "qemu/iov.h"
|
||||
#include "multifd.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "options.h"
|
||||
|
||||
#include "hw/boards.h" /* for machine_dump_guest_core() */
|
||||
|
||||
@@ -155,14 +156,14 @@ static struct {
|
||||
|
||||
static void XBZRLE_cache_lock(void)
|
||||
{
|
||||
if (migrate_use_xbzrle()) {
|
||||
if (migrate_xbzrle()) {
|
||||
qemu_mutex_lock(&XBZRLE.lock);
|
||||
}
|
||||
}
|
||||
|
||||
static void XBZRLE_cache_unlock(void)
|
||||
{
|
||||
if (migrate_use_xbzrle()) {
|
||||
if (migrate_xbzrle()) {
|
||||
qemu_mutex_unlock(&XBZRLE.lock);
|
||||
}
|
||||
}
|
||||
@@ -585,7 +586,7 @@ static void compress_threads_save_cleanup(void)
|
||||
{
|
||||
int i, thread_count;
|
||||
|
||||
if (!migrate_use_compression() || !comp_param) {
|
||||
if (!migrate_compress() || !comp_param) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -624,7 +625,7 @@ static int compress_threads_save_setup(void)
|
||||
{
|
||||
int i, thread_count;
|
||||
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
return 0;
|
||||
}
|
||||
thread_count = migrate_compress_threads();
|
||||
@@ -710,11 +711,10 @@ static size_t save_page_header(PageSearchStatus *pss, QEMUFile *f,
|
||||
static void mig_throttle_guest_down(uint64_t bytes_dirty_period,
|
||||
uint64_t bytes_dirty_threshold)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
uint64_t pct_initial = s->parameters.cpu_throttle_initial;
|
||||
uint64_t pct_increment = s->parameters.cpu_throttle_increment;
|
||||
bool pct_tailslow = s->parameters.cpu_throttle_tailslow;
|
||||
int pct_max = s->parameters.max_cpu_throttle;
|
||||
uint64_t pct_initial = migrate_cpu_throttle_initial();
|
||||
uint64_t pct_increment = migrate_cpu_throttle_increment();
|
||||
bool pct_tailslow = migrate_cpu_throttle_tailslow();
|
||||
int pct_max = migrate_max_cpu_throttle();
|
||||
|
||||
uint64_t throttle_now = cpu_throttle_get_percentage();
|
||||
uint64_t cpu_now, cpu_ideal, throttle_inc;
|
||||
@@ -1136,7 +1136,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
|
||||
return;
|
||||
}
|
||||
|
||||
if (migrate_use_xbzrle()) {
|
||||
if (migrate_xbzrle()) {
|
||||
double encoded_size, unencoded_size;
|
||||
|
||||
xbzrle_counters.cache_miss_rate = (double)(xbzrle_counters.cache_miss -
|
||||
@@ -1154,7 +1154,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
|
||||
rs->xbzrle_bytes_prev = xbzrle_counters.bytes;
|
||||
}
|
||||
|
||||
if (migrate_use_compression()) {
|
||||
if (migrate_compress()) {
|
||||
compression_counters.busy_rate = (double)(compression_counters.busy -
|
||||
rs->compress_thread_busy_prev) / page_count;
|
||||
rs->compress_thread_busy_prev = compression_counters.busy;
|
||||
@@ -1177,8 +1177,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
|
||||
|
||||
static void migration_trigger_throttle(RAMState *rs)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
uint64_t threshold = s->parameters.throttle_trigger_threshold;
|
||||
uint64_t threshold = migrate_throttle_trigger_threshold();
|
||||
uint64_t bytes_xfer_period =
|
||||
stat64_get(&ram_counters.transferred) - rs->bytes_xfer_prev;
|
||||
uint64_t bytes_dirty_period = rs->num_dirty_pages_period * TARGET_PAGE_SIZE;
|
||||
@@ -1245,7 +1244,7 @@ static void migration_bitmap_sync(RAMState *rs)
|
||||
rs->num_dirty_pages_period = 0;
|
||||
rs->bytes_xfer_prev = stat64_get(&ram_counters.transferred);
|
||||
}
|
||||
if (migrate_use_events()) {
|
||||
if (migrate_events()) {
|
||||
uint64_t generation = stat64_get(&ram_counters.dirty_sync_count);
|
||||
qapi_event_send_migration_pass(generation);
|
||||
}
|
||||
@@ -1625,7 +1624,7 @@ static int find_dirty_block(RAMState *rs, PageSearchStatus *pss)
|
||||
/* Flag that we've looped */
|
||||
pss->complete_round = true;
|
||||
/* After the first round, enable XBZRLE. */
|
||||
if (migrate_use_xbzrle()) {
|
||||
if (migrate_xbzrle()) {
|
||||
rs->xbzrle_enabled = true;
|
||||
}
|
||||
}
|
||||
@@ -2269,7 +2268,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len)
|
||||
|
||||
static bool save_page_use_compression(RAMState *rs)
|
||||
{
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2361,7 +2360,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss)
|
||||
* if host page size == guest page size the dest guest during run may
|
||||
* still see partially copied pages which is data corruption.
|
||||
*/
|
||||
if (migrate_use_multifd() && !migration_in_postcopy()) {
|
||||
if (migrate_multifd() && !migration_in_postcopy()) {
|
||||
return ram_save_multifd_page(pss->pss_channel, block, offset);
|
||||
}
|
||||
|
||||
@@ -2978,7 +2977,7 @@ static int xbzrle_init(void)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!migrate_use_xbzrle()) {
|
||||
if (!migrate_xbzrle()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3733,7 +3732,7 @@ static int wait_for_decompress_done(void)
|
||||
{
|
||||
int idx, thread_count;
|
||||
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3752,7 +3751,7 @@ static void compress_threads_load_cleanup(void)
|
||||
{
|
||||
int i, thread_count;
|
||||
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
return;
|
||||
}
|
||||
thread_count = migrate_decompress_threads();
|
||||
@@ -3793,7 +3792,7 @@ static int compress_threads_load_setup(QEMUFile *f)
|
||||
{
|
||||
int i, thread_count;
|
||||
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4259,7 +4258,7 @@ static int ram_load_precopy(QEMUFile *f)
|
||||
int flags = 0, ret = 0, invalid_flags = 0, len = 0, i = 0;
|
||||
/* ADVISE is earlier, it shows the source has the postcopy capability on */
|
||||
bool postcopy_advised = migration_incoming_postcopy_advised();
|
||||
if (!migrate_use_compression()) {
|
||||
if (!migrate_compress()) {
|
||||
invalid_flags |= RAM_SAVE_FLAG_COMPRESS_PAGE;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -35,6 +35,7 @@
|
||||
#include <rdma/rdma_cma.h>
|
||||
#include "trace.h"
|
||||
#include "qom/object.h"
|
||||
#include "options.h"
|
||||
#include <poll.h>
|
||||
|
||||
/*
|
||||
@@ -3373,7 +3374,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
|
||||
* initialize the RDMAContext for return path for postcopy after first
|
||||
* connection request reached.
|
||||
*/
|
||||
if ((migrate_postcopy() || migrate_use_return_path())
|
||||
if ((migrate_postcopy() || migrate_return_path())
|
||||
&& !rdma->is_return_path) {
|
||||
rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL);
|
||||
if (rdma_return_path == NULL) {
|
||||
@@ -3456,7 +3457,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
|
||||
}
|
||||
|
||||
/* Accept the second connection request for return path */
|
||||
if ((migrate_postcopy() || migrate_use_return_path())
|
||||
if ((migrate_postcopy() || migrate_return_path())
|
||||
&& !rdma->is_return_path) {
|
||||
qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
|
||||
NULL,
|
||||
@@ -4178,8 +4179,7 @@ void rdma_start_outgoing_migration(void *opaque,
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = qemu_rdma_source_init(rdma,
|
||||
s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp);
|
||||
ret = qemu_rdma_source_init(rdma, migrate_rdma_pin_all(), errp);
|
||||
|
||||
if (ret) {
|
||||
goto err;
|
||||
@@ -4193,7 +4193,7 @@ void rdma_start_outgoing_migration(void *opaque,
|
||||
}
|
||||
|
||||
/* RDMA postcopy need a separate queue pair for return path */
|
||||
if (migrate_postcopy() || migrate_use_return_path()) {
|
||||
if (migrate_postcopy() || migrate_return_path()) {
|
||||
rdma_return_path = qemu_rdma_data_init(host_port, errp);
|
||||
|
||||
if (rdma_return_path == NULL) {
|
||||
@@ -4201,7 +4201,7 @@ void rdma_start_outgoing_migration(void *opaque,
|
||||
}
|
||||
|
||||
ret = qemu_rdma_source_init(rdma_return_path,
|
||||
s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp);
|
||||
migrate_rdma_pin_all(), errp);
|
||||
|
||||
if (ret) {
|
||||
goto return_path_err;
|
||||
|
||||
+2
-1
@@ -67,6 +67,7 @@
|
||||
#include "qemu/yank.h"
|
||||
#include "yank_functions.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "options.h"
|
||||
|
||||
const unsigned int postcopy_ram_discard_version;
|
||||
|
||||
@@ -1611,7 +1612,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (migrate_use_block()) {
|
||||
if (migrate_block()) {
|
||||
error_setg(errp, "Block migration and snapshots are incompatible");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+3
-2
@@ -27,6 +27,7 @@
|
||||
#include "io/net-listener.h"
|
||||
#include "trace.h"
|
||||
#include "postcopy-ram.h"
|
||||
#include "options.h"
|
||||
|
||||
struct SocketOutgoingArgs {
|
||||
SocketAddress *saddr;
|
||||
@@ -97,7 +98,7 @@ static void socket_outgoing_migration(QIOTask *task,
|
||||
|
||||
trace_migration_socket_outgoing_connected(data->hostname);
|
||||
|
||||
if (migrate_use_zero_copy_send() &&
|
||||
if (migrate_zero_copy_send() &&
|
||||
!qio_channel_has_feature(sioc, QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY)) {
|
||||
error_setg(&err, "Zero copy send feature not detected in host kernel");
|
||||
}
|
||||
@@ -182,7 +183,7 @@ socket_start_incoming_migration_internal(SocketAddress *saddr,
|
||||
|
||||
qio_net_listener_set_name(listener, "migration-socket-listener");
|
||||
|
||||
if (migrate_use_multifd()) {
|
||||
if (migrate_multifd()) {
|
||||
num = migrate_multifd_channels();
|
||||
} else if (migrate_postcopy_preempt()) {
|
||||
num = RAM_CHANNEL_MAX;
|
||||
|
||||
@@ -1203,34 +1203,6 @@
|
||||
{ 'command': 'query-migrate-parameters',
|
||||
'returns': 'MigrationParameters' }
|
||||
|
||||
##
|
||||
# @client_migrate_info:
|
||||
#
|
||||
# Set migration information for remote display. This makes the server
|
||||
# ask the client to automatically reconnect using the new parameters
|
||||
# once migration finished successfully. Only implemented for SPICE.
|
||||
#
|
||||
# @protocol: must be "spice"
|
||||
# @hostname: migration target hostname
|
||||
# @port: spice tcp port for plaintext channels
|
||||
# @tls-port: spice tcp port for tls-secured channels
|
||||
# @cert-subject: server certificate subject
|
||||
#
|
||||
# Since: 0.14
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# -> { "execute": "client_migrate_info",
|
||||
# "arguments": { "protocol": "spice",
|
||||
# "hostname": "virt42.lab.kraxel.org",
|
||||
# "port": 1234 } }
|
||||
# <- { "return": {} }
|
||||
#
|
||||
##
|
||||
{ 'command': 'client_migrate_info',
|
||||
'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
|
||||
'*tls-port': 'int', '*cert-subject': 'str' } }
|
||||
|
||||
##
|
||||
# @migrate-start-postcopy:
|
||||
#
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user