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 "virxml.h"
|
|
|
|
#include "qemu_monitor.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,
|
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;
|
|
|
|
typedef qemuMigrationParams *qemuMigrationParamsPtr;
|
|
|
|
|
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
|
|
|
|
2018-04-06 08:18:52 +00:00
|
|
|
virBitmapPtr
|
|
|
|
qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party);
|
|
|
|
|
2018-02-21 16:22:29 +00:00
|
|
|
qemuMigrationParamsPtr
|
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
|
2018-03-12 14:50:06 +00:00
|
|
|
qemuMigrationParamsDump(qemuMigrationParamsPtr migParams,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
unsigned long *flags);
|
2018-03-12 13:19:56 +00:00
|
|
|
|
2019-02-04 16:11:42 +00:00
|
|
|
qemuMigrationParamsPtr
|
|
|
|
qemuMigrationParamsNew(void);
|
|
|
|
|
2018-02-21 13:18:03 +00:00
|
|
|
void
|
2018-02-21 16:22:29 +00:00
|
|
|
qemuMigrationParamsFree(qemuMigrationParamsPtr 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
|
2018-02-28 13:44:12 +00:00
|
|
|
qemuMigrationParamsApply(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
int asyncJob,
|
|
|
|
qemuMigrationParamsPtr migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
|
|
|
int
|
2018-02-28 09:45:07 +00:00
|
|
|
qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
bool tlsListen,
|
|
|
|
int asyncJob,
|
|
|
|
char **tlsAlias,
|
2018-02-28 11:57:19 +00:00
|
|
|
const char *hostname,
|
2018-02-28 09:45:07 +00:00
|
|
|
qemuMigrationParamsPtr migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
|
|
|
int
|
2018-02-28 08:35:53 +00:00
|
|
|
qemuMigrationParamsDisableTLS(virDomainObjPtr vm,
|
|
|
|
qemuMigrationParamsPtr migParams);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2020-09-02 10:06:12 +00:00
|
|
|
bool
|
|
|
|
qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParamsPtr migParams);
|
|
|
|
|
2018-03-15 10:27:07 +00:00
|
|
|
int
|
|
|
|
qemuMigrationParamsFetch(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
int asyncJob,
|
|
|
|
qemuMigrationParamsPtr *migParams);
|
|
|
|
|
2019-02-04 16:11:42 +00:00
|
|
|
int
|
|
|
|
qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams,
|
|
|
|
qemuMigrationParam param,
|
|
|
|
unsigned long long value);
|
|
|
|
|
2018-03-15 10:39:50 +00:00
|
|
|
int
|
2018-03-16 10:56:21 +00:00
|
|
|
qemuMigrationParamsGetULL(qemuMigrationParamsPtr migParams,
|
|
|
|
qemuMigrationParam param,
|
|
|
|
unsigned long long *value);
|
2018-03-15 10:39:50 +00:00
|
|
|
|
2018-02-27 14:45:52 +00:00
|
|
|
int
|
|
|
|
qemuMigrationParamsCheck(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
2018-03-07 09:45:18 +00:00
|
|
|
int asyncJob,
|
2018-04-06 12:02:04 +00:00
|
|
|
qemuMigrationParamsPtr migParams,
|
|
|
|
virBitmapPtr remoteCaps);
|
2018-02-27 14:45:52 +00:00
|
|
|
|
2018-02-21 13:18:03 +00:00
|
|
|
void
|
|
|
|
qemuMigrationParamsReset(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
2018-02-27 16:09:17 +00:00
|
|
|
int asyncJob,
|
2018-03-21 13:57:44 +00:00
|
|
|
qemuMigrationParamsPtr origParams,
|
|
|
|
unsigned long apiFlags);
|
2018-02-21 13:18:03 +00:00
|
|
|
|
2018-03-13 15:08:49 +00:00
|
|
|
void
|
|
|
|
qemuMigrationParamsFormat(virBufferPtr buf,
|
|
|
|
qemuMigrationParamsPtr migParams);
|
|
|
|
|
|
|
|
int
|
|
|
|
qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
|
|
|
|
qemuMigrationParamsPtr *migParams);
|
|
|
|
|
2018-02-20 15:40:21 +00:00
|
|
|
int
|
|
|
|
qemuMigrationCapsCheck(virQEMUDriverPtr driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
int asyncJob);
|
|
|
|
|
2018-04-06 13:22:51 +00:00
|
|
|
bool
|
|
|
|
qemuMigrationCapsGet(virDomainObjPtr vm,
|
2018-04-05 20:17:26 +00:00
|
|
|
qemuMigrationCapability cap);
|