From nobody Mon Feb 9 09:10:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1664978561; cv=none; d=zohomail.com; s=zohoarc; b=Rc8GUnCb+psM8xuCIxWsyESMP4KvjBfg+9Tv+b2stW83ZFrr2njsOik2wSlzfgCpQkyUDVo0aiabAyf3FsPT9KYyTpakzv1JLUkDvZVpOThaWxJSIQG2dmarn3QPRSRqfh8eLrJmz7d2UtI2GQp5wUhPoS/pt5YHdpen6UZTgqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664978561; h=Content-Type:Content-Transfer-Encoding:Cc: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=FzbkKF0zLEDCRx2mCWbHb7tu7YoUJsAe0TgHRghdMA0=; b=dzGAZRFBTe1vUzg0xGG+fFD9y34jx5s/9Qfiao2imIYUuOI6zNj08NH0uCjwcdQQ+bQ6rVLA8NPKpYvyDCD4eNw8mjPrKpzNRZVqSuFtH1PRpT961A7KLHc/JWlZ/uIH4b6pKulPsPhJK2XwdCpZhEUAL6IwReVLyPtpfyq4LGw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1664978561977730.3877497195315; Wed, 5 Oct 2022 07:02:41 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-jENU4hJGOVuAyDNgYRq8hw-1; Wed, 05 Oct 2022 10:02:36 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F9C7858282; Wed, 5 Oct 2022 14:02:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BA4C4B3FC7; Wed, 5 Oct 2022 14:02:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E8A7E1946A5A; Wed, 5 Oct 2022 14:02:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EDBF51946A4E for ; Wed, 5 Oct 2022 14:02:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D111F1121333; Wed, 5 Oct 2022 14:02:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C93491121330 for ; Wed, 5 Oct 2022 14:02:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ADEA0855423 for ; Wed, 5 Oct 2022 14:02:24 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-0Z1howdxPnysGtIcgh2Y0A-1; Wed, 05 Oct 2022 10:02:20 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 295CqJw4015966; Wed, 5 Oct 2022 14:02:18 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3k1aafjdbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 14:02:17 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 295DopHs031716; Wed, 5 Oct 2022 14:02:16 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04wdc.us.ibm.com with ESMTP id 3jxd69uwuk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 14:02:16 +0000 Received: from smtpav02.wdc07v.mail.ibm.com ([9.208.128.114]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 295E2Fgv47841626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Oct 2022 14:02:15 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0F5158061; Wed, 5 Oct 2022 14:02:14 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A69058059; Wed, 5 Oct 2022 14:02:14 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Oct 2022 14:02:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664978560; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=FzbkKF0zLEDCRx2mCWbHb7tu7YoUJsAe0TgHRghdMA0=; b=cjtY/HtpacyXG8J155Hso1kIDebKn+ek7nXNZedN6FMt+aOPmGBsXslCZ5S7RKUn/WwlYI IItsqMx7vfHsfVmfd5BVSHlwfBaqTba23fJM+GTnuOKXOr5jT+LmYa2C93H8KnqxMBPGbq Ry9kQ0N3R7uvcDTsLWY8Z1RmXvQ6zNI= X-MC-Unique: jENU4hJGOVuAyDNgYRq8hw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 0Z1howdxPnysGtIcgh2Y0A-1 From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v2 9/9] virsh: Add support for --tpm-shared-storage flag for migration Date: Wed, 5 Oct 2022 10:02:07 -0400 Message-Id: <20221005140207.3599989-10-stefanb@linux.ibm.com> In-Reply-To: <20221005140207.3599989-1-stefanb@linux.ibm.com> References: <20221005140207.3599989-1-stefanb@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QQuWCbFqW9QV5tDJDgV7izgDSkIuGn6q X-Proofpoint-ORIG-GUID: QQuWCbFqW9QV5tDJDgV7izgDSkIuGn6q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-05_03,2022-10-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210050088 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Berger Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664978563120100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add support for --tpm-shared-storage flag for migration across hosts that have shared storage set up for storing the state. Add documentation to the virsh man page. Signed-off-by: Stefan Berger --- docs/manpages/virsh.rst | 6 ++++++ tools/virsh-domain.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5d11c48803..79626f2510 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3297,6 +3297,7 @@ migrate [--parallel [--parallel-connections connections]] [--bandwidth bandwidth] [--tls-destination hostname] [--disks-uri URI] [--copy-storage-synchronous-writes] + [--tpm-shared-storage] =20 Migrate domain to another host. Add *--live* for live migration; <--p2p> for peer-2-peer migration; *--direct* for direct migration; or *--tunnelle= d* @@ -3367,6 +3368,11 @@ For QEMU/KVM this means QEMU will be temporarily all= owed to lock all guest pages in host's memory, although only those that are queued for transfer w= ill be locked at the same time. =20 +*--tpm-shared-storage* enables migration of a QEMU VM with TPM whose +persistents state is saved on shared storage set up between the source +and destination hosts. This option must be given when shared storage +is used and must not be given otherwise. + ``Note``: Individual hypervisors usually do not support all possible types= of migration. For example, QEMU does not support direct migration. =20 diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 2d22547cc6..05c4a827c3 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11041,6 +11041,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .completer =3D virshCompleteEmpty, .help =3D N_("override the destination host name used for TLS verific= ation") }, + {.name =3D "tpm-shared-storage", + .type =3D VSH_OT_BOOL, + .help =3D N_("migrate TPM between hosts that have shared storage setu= p for the TPM's state") + }, {.name =3D NULL} }; =20 @@ -11345,6 +11349,9 @@ doMigrate(void *opaque) if (vshCommandOptBool(cmd, "parallel")) flags |=3D VIR_MIGRATE_PARALLEL; =20 + if (vshCommandOptBool(cmd, "tpm-shared-storage")) + flags |=3D VIR_MIGRATE_TPM_SHARED_STORAGE; + if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct"))= { if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) = =3D=3D 0) data->ret =3D 0; --=20 2.37.3