#migrate_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# By default TLS is requested using the VIR_MIGRATE_TLS flag, thus not requested
+# automatically. Setting 'migate_tls_force' to "1" will prevent any migration
+# which is not using VIR_MIGRATE_TLS to ensure higher level of security in
+# deployments with TLS.
+#
+#migrate_tls_force = 0
+
+
# In order to override the default TLS certificate location for backup NBD
# server certificates, supply a valid path to the certificate directory. If the
# provided path does not exist, libvirtd will fail to start. If the path is
unsigned long flags)
{
virQEMUDriverPtr driver = conn->privateData;
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
char *xml = NULL;
qemuDomainAsyncJob asyncJob;
+ if (cfg->migrateTLSForce &&
+ !(flags & VIR_MIGRATE_TUNNELLED) &&
+ !(flags & VIR_MIGRATE_TLS)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("this libvirtd instance allows migration only with VIR_MIGRATE_TLS flag"));
+ goto cleanup;
+ }
+
if ((flags & VIR_MIGRATE_CHANGE_PROTECTION)) {
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
flags) < 0)
qemuMigrationParamsPtr migParams,
unsigned long flags)
{
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virDomainObjPtr vm = NULL;
virObjectEventPtr event = NULL;
virErrorPtr origErr;
goto cleanup;
}
+ if (cfg->migrateTLSForce &&
+ !(flags & VIR_MIGRATE_TUNNELLED) &&
+ !(flags & VIR_MIGRATE_TLS)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("this libvirtd instance allows migration only with VIR_MIGRATE_TLS flag"));
+ goto cleanup;
+ }
+
if (!qemuMigrationSrcIsAllowedHostdev(*def))
goto cleanup;
unsigned long resource,
bool v3proto)
{
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+
VIR_DEBUG("driver=%p, conn=%p, vm=%p, xmlin=%s, dconnuri=%s, "
"uri=%s, graphicsuri=%s, listenAddress=%s, "
"nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, "
NULLSTR(cookiein), cookieinlen, cookieout, cookieoutlen,
flags, NULLSTR(dname), resource, v3proto);
+ if (cfg->migrateTLSForce &&
+ !(flags & VIR_MIGRATE_TUNNELLED) &&
+ !(flags & VIR_MIGRATE_TLS)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("this libvirtd instance allows migration only with VIR_MIGRATE_TLS flag"));
+ return -1;
+ }
+
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (cookieinlen) {
virReportError(VIR_ERR_OPERATION_INVALID,