From nobody Mon Apr 29 13:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575387271; cv=none; d=zohomail.com; s=zohoarc; b=Vd7D3btKxmJA/HT9l3za35C3lkAUEHQkeESlK/Xzay2cYvb14r43W0gsOmW1e3Pp6jzEXwj/e4SWyLVQhEg0bINu+R9Ewu3hjSNifUSXWDSjT2uiyg6n4pyIbTztxaoffxT/2bLgI0+kLYsQYOYVC3jBLX29rTueW9gCmgyvkdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575387271; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o5i8UQpqrYoEdcWKZoliYzCI2KYYd8fTFgwh0Ev+l5M=; b=YfaiOpatZgT0pCiuiL/Gk2EsTb17JCJqqJL/1mo+ABW/rWVaDh2XLubaY3aC1Sg96epfgv+/Xnzvyjcojf3Nc7pumnOuvICyIVdmkc+9v/VyCi5zMWv9eW7kDDVzv1ZGWCQBrVpaWwKXdHKfAW8L56yJSRVBIOeRlE9wfrmDM3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1575387271145774.4830388592347; Tue, 3 Dec 2019 07:34:31 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-4NtNCTGJN-2r-i04w4uYrw-1; Tue, 03 Dec 2019 10:34:28 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C84B91005513; Tue, 3 Dec 2019 15:34:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A275B5D6AE; Tue, 3 Dec 2019 15:34:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6337E5BC01; Tue, 3 Dec 2019 15:34:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB3FY6Nc026331 for ; Tue, 3 Dec 2019 10:34:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0DBE95DA32; Tue, 3 Dec 2019 15:34:06 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D64415E240 for ; Tue, 3 Dec 2019 15:34:03 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C09211003C9; Tue, 3 Dec 2019 16:34:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575387270; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=o5i8UQpqrYoEdcWKZoliYzCI2KYYd8fTFgwh0Ev+l5M=; b=h/4LGvnfGQXy+swRP+go2oAPVqG1yLV4Q9+rbxLqLpfFjgzuLgOg6i7HR3I03pZNxssqsP naCfAdIQFCGR1ugtWFwFE3UlU09evX4ueX1LgbB9d+rwnTo6RkrRPnlZrasQPeulYw1rOG +RiUuNw4/yBuUfwOZvXiE1zMowE0048= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 3 Dec 2019 16:33:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemu: Add support for setting string migration params X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: 4NtNCTGJN-2r-i04w4uYrw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The functions for converting migration typed parameters to QEMU migration parameters and back were only implemented for integer types. This patch adds support for string parameters. Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- src/qemu/qemu_migration_params.c | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index c28814bc5b..88c08528bc 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -412,6 +412,51 @@ qemuMigrationParamsSetTPULL(qemuMigrationParamsPtr mig= Params, } =20 =20 +static int +qemuMigrationParamsGetTPString(qemuMigrationParamsPtr migParams, + qemuMigrationParam param, + virTypedParameterPtr params, + int nparams, + const char *name) +{ + const char *value =3D NULL; + int rc; + + if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_STRI= NG) < 0) + return -1; + + if (!params) + return 0; + + if ((rc =3D virTypedParamsGetString(params, nparams, name, &value)) < = 0) + return -1; + + migParams->params[param].value.s =3D g_strdup(value); + migParams->params[param].set =3D !!rc; + return 0; +} + + +static int +qemuMigrationParamsSetTPString(qemuMigrationParamsPtr migParams, + qemuMigrationParam param, + virTypedParameterPtr *params, + int *nparams, + int *maxparams, + const char *name) +{ + if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_STRI= NG) < 0) + return -1; + + if (!migParams->params[param].set) + return 0; + + return virTypedParamsAddString(params, nparams, maxparams, name, + migParams->params[param].value.s); +} + + + static int qemuMigrationParamsSetCompression(virTypedParameterPtr params, int nparams, @@ -536,7 +581,12 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, break; =20 case QEMU_MIGRATION_PARAM_TYPE_BOOL: + break; + case QEMU_MIGRATION_PARAM_TYPE_STRING: + if (qemuMigrationParamsGetTPString(migParams, item->param, par= ams, + nparams, item->typedParam) = < 0) + goto error; break; } } @@ -612,7 +662,13 @@ qemuMigrationParamsDump(qemuMigrationParamsPtr migPara= ms, break; =20 case QEMU_MIGRATION_PARAM_TYPE_BOOL: + break; + case QEMU_MIGRATION_PARAM_TYPE_STRING: + if (qemuMigrationParamsSetTPString(migParams, item->param, + params, nparams, maxparams, + item->typedParam) < 0) + return -1; break; } } --=20 2.24.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 13:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575387256; cv=none; d=zohomail.com; s=zohoarc; b=VZu120Ks9yqHx7E1ukb5rV4t1mR6s1fSk2CmAzNu8EbSIZIqjqjn71Y+nqeP0NlkQONfAtrKOHd9NQh6QKnt7qcmtVJZkOs1jQP2RQpl+u/ZgYMW4zwW4x/c6STnAfAXlAxdnoozrYbpI2YKZdVo9gmD0pU/xglLfO558PyfRDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575387256; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mPVEX7596aT64BtoNphST145/MTbkk9/LxihOgu+qqk=; b=G5oD/7mWHSuYvTIRSPVW0RQHxb17ALBpyhEMvHPPLaCt45717zi0i+XxlKafEsw+iVAQL6GwDj8zRL1TkDH5XO1AxfoVl2t5wojUZLc6RI0rJ++0UDrzf0ddqwR50ky5rGsJiMQC4XcG1OWCoSX0BtQ+NXOvPjIU6wlTDrH2LH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157538725662227.637271784704694; Tue, 3 Dec 2019 07:34:16 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-M57ab7g3OL6r5YGq4zylXw-1; Tue, 03 Dec 2019 10:34:14 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 938348024EA; Tue, 3 Dec 2019 15:34:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B76467E5F; Tue, 3 Dec 2019 15:34:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4979E5BBFF; Tue, 3 Dec 2019 15:34:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB3FY6lt026333 for ; Tue, 3 Dec 2019 10:34:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0E7BF5DA60; Tue, 3 Dec 2019 15:34:06 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D64C55E241 for ; Tue, 3 Dec 2019 15:34:03 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C7903100849; Tue, 3 Dec 2019 16:34:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575387255; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mPVEX7596aT64BtoNphST145/MTbkk9/LxihOgu+qqk=; b=Yfmna5vMFY9V6n52iwU8VlEInx0hAK7ILybC32fl99zzywufWxhCxlM/iOi/KV4Fxdh3O/ 3HgsKJrep/2OGqVKWkCuFEKPXgDqLfD4x15gdzi2iSmt3DXb0+dyCUFQyNEkz3mWj64GS5 hWhHJf/ZHdUqP1yp/ZTRuG2WrO8SkD8= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 3 Dec 2019 16:33:56 +0100 Message-Id: <91da3e7d00fd9454e63e21763573de7a02476e59.1575387200.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] Introduce VIR_MIGRATE_PARAM_TLS_DESTINATION migration param X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: M57ab7g3OL6r5YGq4zylXw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Normally the TLS certificate from the destination host must match the host's name for TLS verification to succeed. When the certificate does not match the destination hostname and the expected cetificate's hostname is known, this parameter can be used to pass this expected hostname when starting the migration. Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- include/libvirt/libvirt-domain.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 40c71091ec..a099b3d891 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1051,6 +1051,20 @@ typedef enum { */ # define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS "parallel.connections" =20 +/** + * VIR_MIGRATE_PARAM_TLS_DESTINATION: + * + * virDomainMigrate* params field: override the destination host name used= for + * TLS verification. As VIR_TYPED_PARAM_STRING. + * + * Normally the TLS certificate from the destination host must match the h= ost's + * name for TLS verification to succeed. When the certificate does not mat= ch + * the destination hostname and the expected cetificate's hostname is know= n, + * this parameter can be used to pass this expected hostname when starting + * the migration. + */ +# define VIR_MIGRATE_PARAM_TLS_DESTINATION "tls.destination" + /* Domain migration. */ virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, unsigned long flags, const char *dname, --=20 2.24.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 13:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575387304; cv=none; d=zohomail.com; s=zohoarc; b=PFcB/QBofIIw6zFGnTaUO5Ya4B62I1Nw9DoZY6sZOo0++iNnzN0eqEqYLRuaUhNsnIhB5W/qjTVkZYVqp7gn/mVMaI5zBn/GgFMbzJvldFdo2aBDUjiATrmYo0xlj4chPF3lIyvAGMg3+GXegnXFw9rMDcOFMUQV8WnkSGuv1v4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575387304; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S8DguF7oaLZUvvrEOuIrAHOlwLE2nvtl8uCXGqoEaD8=; b=CPJY/jS1Ew1JLxFnn7dOYRhhWrSM+hc85W4MeORyTBovk5PrwpFXNn/SoT5ZOHaMbYO0mzdaXFoJUackamq3oOIrCZDLX4ewwylIYp/1Bf9HlKfY8RLTJRRK1U9kUvimc+bpOt9cXvCMr81o7w/BOZUTHM4vP7yAdfPxOGaVngc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1575387304733865.9584582819715; Tue, 3 Dec 2019 07:35:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-VQKfsVeRM9muobM_aPuVXw-1; Tue, 03 Dec 2019 10:34:33 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E37F8017DF; Tue, 3 Dec 2019 15:34:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78EED10016DA; Tue, 3 Dec 2019 15:34:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 33A945BC04; Tue, 3 Dec 2019 15:34:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB3FY6wf026351 for ; Tue, 3 Dec 2019 10:34:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id F008A60C18; Tue, 3 Dec 2019 15:34:06 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2B0F60C80 for ; Tue, 3 Dec 2019 15:34:03 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id CBCCF100865; Tue, 3 Dec 2019 16:34:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575387303; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=S8DguF7oaLZUvvrEOuIrAHOlwLE2nvtl8uCXGqoEaD8=; b=Z/+NE+nS2kT+LWA81xB+QZ2JQKAQmmufm1dhuro1igv4NRBVh2sCQ1l6MmMj9xlD26VPt1 IkPNk1Qws0M5GAWwG+TUVUjexezeu1YvoqyLcIqYilsBFm/U0fr7EG/nnIpYhpwrBr2bHF UgyV9aQXrL8jAMlAJbJdqoULMd+oV78= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 3 Dec 2019 16:33:57 +0100 Message-Id: <19f92135c3a3c9e0de9f2abad63444013fbdf32d.1575387200.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] qemu: Implement VIR_MIGRATE_PARAM_TLS_DESTINATION X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: VQKfsVeRM9muobM_aPuVXw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- src/qemu/qemu_migration.h | 1 + src/qemu/qemu_migration_params.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index d98fe9f80a..b6f88d3fd9 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -83,6 +83,7 @@ VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT, VIR_TYPED_PARAM_INT, \ VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, VIR_TYPED_PARAM_ULLONG, \ VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, VIR_TYPED_PARAM_INT, \ + VIR_MIGRATE_PARAM_TLS_DESTINATION, VIR_TYPED_PARAM_STRING, \ NULL =20 =20 diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 88c08528bc..e6cf6b4b0b 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -197,6 +197,10 @@ static const qemuMigrationParamsTPMapItem qemuMigratio= nParamsTPMap[] =3D { {.typedParam =3D VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, .param =3D QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS, .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, + + {.typedParam =3D VIR_MIGRATE_PARAM_TLS_DESTINATION, + .param =3D QEMU_MIGRATION_PARAM_TLS_HOSTNAME, + .party =3D QEMU_MIGRATION_SOURCE}, }; =20 static const qemuMigrationParamType qemuMigrationParamTypes[] =3D { @@ -1007,7 +1011,10 @@ qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver, =20 if (qemuMigrationParamsSetString(migParams, QEMU_MIGRATION_PARAM_TLS_CREDS, - *tlsAlias) < 0 || + *tlsAlias) < 0) + goto error; + + if (!migParams->params[QEMU_MIGRATION_PARAM_TLS_HOSTNAME].set && qemuMigrationParamsSetString(migParams, QEMU_MIGRATION_PARAM_TLS_HOSTNAME, NULLSTR_EMPTY(hostname)) < 0) --=20 2.24.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 13:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575387257; cv=none; d=zohomail.com; s=zohoarc; b=IkDC9Tj42B/pZX1PqFYQs9mh1Ym/36aBKy2kP8hK0a2NrUTCqKwfssSpM5sBiYVtQL4Xhcc3p0eTI03MTyfjyjEjjnP09cwfawv2n+4/uSQgZ47C2fiRCsyAal3omyPjJTiavdCZx8umoCQCzMsOX/94/PgqXyLVo+Hsp22xrFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575387257; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BHthMd6kvRNgVq47Rj884PW30rP/Na0JUHCjH6tpTPg=; b=kd0EH9+vKyZdxJbE+bSxeELVSBQ5AP09h+vMLcdZvV+l5ImAR0Ify30r6MaMqP/NuDsmOUspkKKKV+S4Dkl4CyPLapvR+1ojIb1GkkzMF0YxM/ZXd9XWy2R4R8Y1AVDgIBKwCkV/c5lTxN7xTZ9Nvd9j2YX+pPcSjsQTOD9Y2Ho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1575387257017567.6516224640333; Tue, 3 Dec 2019 07:34:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-lPEZ33D_OtOb1dVfSQSWOQ-1; Tue, 03 Dec 2019 10:34:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 521B8800C79; Tue, 3 Dec 2019 15:34:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C45A1001B03; Tue, 3 Dec 2019 15:34:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B06E85BC00; Tue, 3 Dec 2019 15:34:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB3FY6RU026334 for ; Tue, 3 Dec 2019 10:34:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0FCA95D6C3; Tue, 3 Dec 2019 15:34:06 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D92205D6BB for ; Tue, 3 Dec 2019 15:34:03 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id CF341100866; Tue, 3 Dec 2019 16:34:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575387255; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BHthMd6kvRNgVq47Rj884PW30rP/Na0JUHCjH6tpTPg=; b=YsB1tlQigNo8Zzme0vVsVQV9omRZcqlH8w059XltxFVJRhMBTWXiEUovFPXyIuX2z9pfeQ RNPO4JKKxycqjDK2lFe9pdBmRKiKaiyTIBZ8V+/4cmrg4VAU2GI7Fq66xIpeINg5siQ9ZW SPb4ps23VvOElyCXSTXrdTASLxNJ77M= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 3 Dec 2019 16:33:58 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] virsh: Add --tls-destination option for migrate command X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: lPEZ33D_OtOb1dVfSQSWOQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This option can be used to override the destination host name used for TLS verification. Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- tools/virsh-domain.c | 11 +++++++++++ tools/virsh.pod | 8 ++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 21ea1a69ea..c2cfcf409d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10566,6 +10566,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_INT, .help =3D N_("migration bandwidth limit in MiB/s") }, + {.name =3D "tls-destination", + .type =3D VSH_OT_STRING, + .help =3D N_("override the destination host name used for TLS verific= ation") + }, {.name =3D NULL} }; =20 @@ -10789,6 +10793,13 @@ doMigrate(void *opaque) goto save_error; } =20 + if (vshCommandOptStringReq(ctl, cmd, "tls-destination", &opt) < 0) + goto out; + if (opt && + virTypedParamsAddString(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_TLS_DESTINATION, opt) < = 0) + goto save_error; + if (vshCommandOptBool(cmd, "live")) flags |=3D VIR_MIGRATE_LIVE; if (vshCommandOptBool(cmd, "p2p")) diff --git a/tools/virsh.pod b/tools/virsh.pod index a8331154e1..aaf1eba825 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2174,7 +2174,7 @@ I I [I] [I]= [I] [I] [I<--persistent-xml> B] [I<--tls>] [I<--postcopy-bandwidth> B] [I<--parallel> [I<--parallel-connections> B]] -[I<--bandwidth> B] +[I<--bandwidth> B] [I<--tls-destination> B] =20 Migrate domain to another host. Add I<--live> for live migration; <--p2p> for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnel= led> @@ -2267,7 +2267,11 @@ respectively. I<--comp-xbzrle-cache> sets size of pa= ge cache in bytes. Providing I<--tls> causes the migration to use the host configured TLS set= up (see migrate_tls_x509_cert_dir in /etc/libvirt/qemu.conf) in order to perf= orm the migration of the domain. Usage requires proper TLS setup for both sour= ce -and target. +and target. Normally the TLS certificate from the destination host must ma= tch +the host's name for TLS verification to succeed. When the certificate does= not +match the destination hostname and the expected cetificate's hostname is +known, I<--tls-destination> can be used to pass the expected B w= hen +starting the migration. =20 I<--parallel> option will cause migration data to be sent over multiple parallel connections. The number of such connections can be set using --=20 2.24.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list