2018-02-21 13:18:03 +00:00
|
|
|
/*
|
|
|
|
* qemu_migration_params.h: QEMU migration parameters handling
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2018 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#pragma once
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "internal.h"
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "virbuffer.h"
|
|
|
|
#include "qemu_conf.h"
|
|
|
|
#include "virenum.h"
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2018-04-05 20:17:26 +00:00
|
|
|
typedef enum {
|
|
|
|
QEMU_MIGRATION_CAP_XBZRLE,
|
|
|
|
QEMU_MIGRATION_CAP_AUTO_CONVERGE,
|
|
|
|
QEMU_MIGRATION_CAP_RDMA_PIN_ALL,
|
|
|
|
QEMU_MIGRATION_CAP_EVENTS,
|
|
|
|
QEMU_MIGRATION_CAP_POSTCOPY,
|
|
|
|
QEMU_MIGRATION_CAP_COMPRESS,
|
|
|
|
QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER,
|
2018-04-17 12:46:29 +00:00
|
|
|
QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE,
|
2019-02-06 10:53:19 +00:00
|
|
|
QEMU_MIGRATION_CAP_MULTIFD,
|
2021-02-08 09:42:28 +00:00
|
|
|
QEMU_MIGRATION_CAP_BLOCK_DIRTY_BITMAPS,
|
2021-12-08 15:19:26 +00:00
|
|
|
QEMU_MIGRATION_CAP_RETURN_PATH,
|
2022-06-22 14:37:31 +00:00
|
|
|
QEMU_MIGRATION_CAP_ZERO_COPY_SEND,
|
2018-04-05 20:17:26 +00:00
|
|
|
|
|
|
|
QEMU_MIGRATION_CAP_LAST
|
|
|
|
} qemuMigrationCapability;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(qemuMigrationCapability);
|
2018-04-05 20:17:26 +00:00
|
|
|
|
2018-03-28 16:25:58 +00:00
|
|
|
typedef enum {
|
|
|
|
QEMU_MIGRATION_PARAM_COMPRESS_LEVEL,
|
|
|
|
QEMU_MIGRATION_PARAM_COMPRESS_THREADS,
|
|
|
|
QEMU_MIGRATION_PARAM_DECOMPRESS_THREADS,
|
|
|
|
QEMU_MIGRATION_PARAM_THROTTLE_INITIAL,
|
|
|
|
QEMU_MIGRATION_PARAM_THROTTLE_INCREMENT,
|
|
|
|
QEMU_MIGRATION_PARAM_TLS_CREDS,
|
|
|
|
QEMU_MIGRATION_PARAM_TLS_HOSTNAME,
|
|
|
|
QEMU_MIGRATION_PARAM_MAX_BANDWIDTH,
|
|
|
|
QEMU_MIGRATION_PARAM_DOWNTIME_LIMIT,
|
|
|
|
QEMU_MIGRATION_PARAM_BLOCK_INCREMENTAL,
|
|
|
|
QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
|
2019-01-31 09:25:11 +00:00
|
|
|
QEMU_MIGRATION_PARAM_MAX_POSTCOPY_BANDWIDTH,
|
2019-02-06 10:53:19 +00:00
|
|
|
QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS,
|
2018-03-28 16:25:58 +00:00
|
|
|
|
|
|
|
QEMU_MIGRATION_PARAM_LAST
|
|
|
|
} qemuMigrationParam;
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2018-02-21 16:22:29 +00:00
|
|
|
typedef struct _qemuMigrationParams qemuMigrationParams;
|
|
|
|
|
2018-03-09 10:23:49 +00:00
|
|
|
typedef enum {
|
|
|
|
QEMU_MIGRATION_SOURCE = (1 << 0),
|
|
|
|
QEMU_MIGRATION_DESTINATION = (1 << 1),
|
|
|
|
} qemuMigrationParty;
|
|
|
|
|
2018-02-21 16:22:29 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virBitmap *
|
2018-04-06 08:18:52 +00:00
|
|
|
qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *
|
2018-02-21 13:18:03 +00:00
|
|
|
qemuMigrationParamsFromFlags(virTypedParameterPtr params,
|
|
|
|
int nparams,
|
2018-03-09 10:23:49 +00:00
|
|
|
unsigned long flags,
|
2018-03-09 16:30:16 +00:00
|
|
|
qemuMigrationParty party);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2018-03-12 13:19:56 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsDump(qemuMigrationParams *migParams,
|
2018-03-12 14:50:06 +00:00
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
unsigned long *flags);
|
2018-03-12 13:19:56 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *
|
2019-02-04 16:11:42 +00:00
|
|
|
qemuMigrationParamsNew(void);
|
|
|
|
|
2018-02-21 13:18:03 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsFree(qemuMigrationParams *migParams);
|
2019-10-15 12:47:50 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationParams, qemuMigrationParamsFree);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsApply(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2018-02-28 13:44:12 +00:00
|
|
|
int asyncJob,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsEnableTLS(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2018-02-28 09:45:07 +00:00
|
|
|
bool tlsListen,
|
|
|
|
int asyncJob,
|
|
|
|
char **tlsAlias,
|
2018-02-28 11:57:19 +00:00
|
|
|
const char *hostname,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsDisableTLS(virDomainObj *vm,
|
|
|
|
qemuMigrationParams *migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2020-09-02 10:06:12 +00:00
|
|
|
bool
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParams *migParams);
|
2020-09-02 10:06:12 +00:00
|
|
|
|
2018-03-15 10:27:07 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsFetch(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2018-03-15 10:27:07 +00:00
|
|
|
int asyncJob,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams **migParams);
|
2018-03-15 10:27:07 +00:00
|
|
|
|
2019-02-04 16:11:42 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsSetULL(qemuMigrationParams *migParams,
|
2019-02-04 16:11:42 +00:00
|
|
|
qemuMigrationParam param,
|
|
|
|
unsigned long long value);
|
|
|
|
|
2018-03-15 10:39:50 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
|
2018-03-16 10:56:21 +00:00
|
|
|
qemuMigrationParam param,
|
|
|
|
unsigned long long *value);
|
2018-03-15 10:39:50 +00:00
|
|
|
|
2021-02-08 09:42:28 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParams *migParams,
|
|
|
|
virJSONValue **params);
|
2021-02-08 09:42:28 +00:00
|
|
|
|
2018-02-27 14:45:52 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsCheck(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2018-03-07 09:45:18 +00:00
|
|
|
int asyncJob,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *migParams,
|
|
|
|
virBitmap *remoteCaps);
|
2018-02-27 14:45:52 +00:00
|
|
|
|
2018-02-21 13:18:03 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsReset(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2018-02-27 16:09:17 +00:00
|
|
|
int asyncJob,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *origParams,
|
2018-03-21 13:57:44 +00:00
|
|
|
unsigned long apiFlags);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2018-03-13 15:08:49 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParamsFormat(virBuffer *buf,
|
|
|
|
qemuMigrationParams *migParams);
|
2018-03-13 15:08:49 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams **migParams);
|
2018-03-13 15:08:49 +00:00
|
|
|
|
2018-02-20 15:40:21 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationCapsCheck(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2022-05-11 13:32:58 +00:00
|
|
|
int asyncJob,
|
|
|
|
bool reconnect);
|
2018-02-20 15:40:21 +00:00
|
|
|
|
2018-04-06 13:22:51 +00:00
|
|
|
bool
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationCapsGet(virDomainObj *vm,
|
2018-04-05 20:17:26 +00:00
|
|
|
qemuMigrationCapability cap);
|
2022-03-10 11:59:30 +00:00
|
|
|
|
|
|
|
const char *
|
|
|
|
qemuMigrationParamsGetTLSHostname(qemuMigrationParams *migParams);
|