From nobody Thu Dec 26 18:06:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731938425730784.0328732077423; Mon, 18 Nov 2024 06:00:25 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 791C31B4B; Mon, 18 Nov 2024 09:00:24 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 51BD71B70; Mon, 18 Nov 2024 08:59:41 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id EAA4D1A0E; Mon, 18 Nov 2024 08:59:36 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5199919FF for ; Mon, 18 Nov 2024 08:59:36 -0500 (EST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-91-ziBb8Gt0OPG-DfBAk91TYg-1; Mon, 18 Nov 2024 08:59:34 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D176219540F2 for ; Mon, 18 Nov 2024 13:59:33 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.6]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 075C11956056 for ; Mon, 18 Nov 2024 13:59:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731938376; h=from:from: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; bh=TPnzwxOqOc1BrE3vrLCuQqyX9QFFAeCBWYRssDsLhYA=; b=eiqvb0mnjWxMlgUtnj8MQC4qgBroOh3ntGCbicf26J/MEv7bs/UJu8p1AWOqbQkOL3xt4I ywmqZ1ka4NnNJnwOTL6zWjEjuyChTdLWAqj1EwjSXEWJCsRbIB7SAaurXzH20c7+nKwrBZ mGXHgMWgfakzOOgGEkgi7TpdVvkzpDo= X-MC-Unique: ziBb8Gt0OPG-DfBAk91TYg-1 X-Mimecast-MFC-AGG-ID: ziBb8Gt0OPG-DfBAk91TYg From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 1/3] Revert "qemu: migration: Improve handling of VIR_MIGRATE_PARAM_DEST_XML with VIR_MIGRATE_PERSIST_DEST" Date: Mon, 18 Nov 2024 14:59:27 +0100 Message-ID: <919db1fe942d774109e69340b0ff53e6f8f45d33.1731938316.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: s2Y1rjytxNxjDil78Typy8gy5x8xeBvcIO8H8969wWY_1731938374 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HNYLX6B2EJFXKT4TLQRJMHVBEIQGSGB7 X-Message-ID-Hash: HNYLX6B2EJFXKT4TLQRJMHVBEIQGSGB7 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731938427631116600 Content-Type: text/plain; charset="utf-8" The original intention was to improve the behaviour of the VIR_MIGRATE_PERSIST_DEST flag which makes the VM persistent after migration on the destination when used with VIR_MIGRATE_PARAM_DEST_XML. While it worked as intended with p2p migration where the migration is driven from the virtqemud instance on the source of the migration, which can distinguish between the user-provided input XML and the one fetched from the source of the migration, it's not easily possible to achieve the same behaviour with normal migration driven from the client library. The approach also still had corner cases (originally deemed worth changing) such as if the persistent definition was modified it would be overwritten. As there is no clear fix which would improve both styles of migrations with no corner cases revert the change. Upcoming commits will modify the documentation to add warning about the use of VIR_MIGRATE_PERSIST_DEST with VIR_MIGRATE_PARAM_DEST_XML/xmlin without using VIR_MIGRATE_PARAM_PERSIST_XML instead of a code fix. This reverts commit 6a385590926d01ab2f2137d1d0833ae797cd2839. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 832b2946e0..26a92d8ee2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4829,7 +4829,6 @@ qemuMigrationSrcCancel(virDomainObj *vm, static int qemuMigrationSrcRun(virQEMUDriver *driver, virDomainObj *vm, - const char *xmlin, const char *persist_xml, const char *cookiein, int cookieinlen, @@ -4902,15 +4901,6 @@ qemuMigrationSrcRun(virQEMUDriver *driver, persist_xml, NULL, NULL))) goto error; - } else if (xmlin) { - /* if input XML is provided, use that one as template for the - * persistent XML. Otherwise user's changes will be thrown awa= y. - */ - if (!(persistDef =3D qemuMigrationAnyPrepareDef(driver, - priv->qemuCaps, - xmlin, - NULL, NULL))) - goto error; } else { virDomainDef *def =3D vm->newDef ? vm->newDef : vm->def; if (!(persistDef =3D qemuDomainDefCopy(driver, priv->qemuCaps,= def, @@ -5267,7 +5257,6 @@ qemuMigrationSrcResume(virDomainObj *vm, static int qemuMigrationSrcPerformNative(virQEMUDriver *driver, virDomainObj *vm, - const char *xmlin, const char *persist_xml, const char *uri, const char *cookiein, @@ -5356,7 +5345,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver, ret =3D qemuMigrationSrcResume(vm, migParams, cookiein, cookieinle= n, cookieout, cookieoutlen, &spec, dconn= , flags); } else { - ret =3D qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookie= in, cookieinlen, + ret =3D qemuMigrationSrcRun(driver, vm, persist_xml, cookiein, coo= kieinlen, cookieout, cookieoutlen, flags, resource, &spec, dconn, graphicsuri, migrate_disks, migrate_disks_detect_zero= es, @@ -5374,7 +5363,6 @@ static int qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, virDomainObj *vm, virStreamPtr st, - const char *xmlin, const char *persist_xml, const char *cookiein, int cookieinlen, @@ -5422,7 +5410,7 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, /* Migration with NBD is not supported with _TUNNELLED, thus * 'migrate_disks_detect_zeroes' is NULL here */ - ret =3D qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, = cookieinlen, + ret =3D qemuMigrationSrcRun(driver, vm, persist_xml, cookiein, cookiei= nlen, cookieout, cookieoutlen, flags, resource, &s= pec, dconn, graphicsuri, migrate_disks, NULL, migParams, NULL); @@ -5461,7 +5449,7 @@ qemuMigrationSrcPerformResume(virQEMUDriver *driver, virCloseCallbacksDomainRemove(vm, NULL, qemuMigrationAnyConnectionClos= ed); qemuDomainCleanupRemove(vm, qemuProcessCleanupMigrationJob); - ret =3D qemuMigrationSrcPerformNative(driver, vm, NULL, NULL, uri, + ret =3D qemuMigrationSrcPerformNative(driver, vm, NULL, uri, cookiein, cookieinlen, cookieout, cookieoutlen, flags, 0, NULL, NULL, NULL, NULL, migPara= ms, NULL); @@ -5563,12 +5551,12 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *dr= iver, VIR_DEBUG("Perform %p", sconn); ignore_value(qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFO= RM2)); if (flags & VIR_MIGRATE_TUNNELLED) - ret =3D qemuMigrationSrcPerformTunnel(driver, vm, st, NULL, NULL, + ret =3D qemuMigrationSrcPerformTunnel(driver, vm, st, NULL, NULL, 0, NULL, NULL, flags, resource, dconn, NULL, NULL, migParams); else - ret =3D qemuMigrationSrcPerformNative(driver, vm, NULL, NULL, uri_= out, + ret =3D qemuMigrationSrcPerformNative(driver, vm, NULL, uri_out, cookie, cookielen, NULL, NULL, /* No out cookie w= ith v2 migration */ flags, resource, dconn, NULL, = NULL, @@ -5838,14 +5826,14 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *dr= iver, } else { ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PER= FORM3)); if (flags & VIR_MIGRATE_TUNNELLED) { - ret =3D qemuMigrationSrcPerformTunnel(driver, vm, st, xmlin, p= ersist_xml, + ret =3D qemuMigrationSrcPerformTunnel(driver, vm, st, persist_= xml, cookiein, cookieinlen, &cookieout, &cookieoutlen, flags, bandwidth, dconn, g= raphicsuri, migrate_disks, migParams); } else { - ret =3D qemuMigrationSrcPerformNative(driver, vm, xmlin, persi= st_xml, uri, + ret =3D qemuMigrationSrcPerformNative(driver, vm, persist_xml,= uri, cookiein, cookieinlen, &cookieout, &cookieoutlen, flags, bandwidth, dconn, g= raphicsuri, @@ -6243,7 +6231,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver, if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2) = < 0) goto endjob; - ret =3D qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_x= ml, uri, cookiein, cookieinlen, + ret =3D qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri= , cookiein, cookieinlen, cookieout, cookieoutlen, flags, resource, NULL, NULL, N= ULL, NULL, migParams, nbdURI); @@ -6308,7 +6296,6 @@ static int qemuMigrationSrcPerformPhase(virQEMUDriver *driver, virConnectPtr conn, virDomainObj *vm, - const char *xmlin, const char *persist_xml, const char *uri, const char *graphicsuri, @@ -6346,7 +6333,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver, virCloseCallbacksDomainRemove(vm, NULL, qemuMigrationAnyConnectionClos= ed); - if (qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri,= cookiein, cookieinlen, + if (qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookie= in, cookieinlen, cookieout, cookieoutlen, flags, resource, NULL, graphicsuri, migrate_disks, migrate_disks_detect_= zeroes, @@ -6450,7 +6437,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, } if (v3proto) { - return qemuMigrationSrcPerformPhase(driver, conn, vm, xmlin, persi= st_xml, uri, + return qemuMigrationSrcPerformPhase(driver, conn, vm, persist_xml,= uri, graphicsuri, migrate_disks, migrate_disks_d= etect_zeroes, migParams, --=20 2.47.0 From nobody Thu Dec 26 18:06:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731938444722719.4116276826962; Mon, 18 Nov 2024 06:00:44 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9D6471B27; Mon, 18 Nov 2024 09:00:43 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 181881B87; Mon, 18 Nov 2024 08:59:43 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1544619FF; Mon, 18 Nov 2024 08:59:38 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 874441A09 for ; Mon, 18 Nov 2024 08:59:37 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-PGbSmk9vPvyKqG6Urpbtbg-1; Mon, 18 Nov 2024 08:59:36 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37A851956048 for ; Mon, 18 Nov 2024 13:59:35 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.6]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5F8D91956056 for ; Mon, 18 Nov 2024 13:59:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731938377; h=from:from: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; bh=QyaMLfkC65FI8EOLMJNx0WkEtiINyAwNuWSl6s5yTtc=; b=TIKKcpzOx4P1EV8eZZF3+iiEsNCD3UVQPBwBDSyhI9sdtCzEWHDu7ywPnFTHAoT3miKrIj 4JozOoAjw1GhMsRE9zAl1PPv2l/qZCxaWqM40SGLR58mH+jit2xS1pmhwxlKzjdH9jseqL s4aIWnJ1U0lvqgP+mF/RiKyOqSNbQ/U= X-MC-Unique: PGbSmk9vPvyKqG6Urpbtbg-1 X-Mimecast-MFC-AGG-ID: PGbSmk9vPvyKqG6Urpbtbg From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 2/3] API: migration: Warn about use of VIR_MIGRATE_PERSIST_DEST with VIR_MIGRATE_PARAM_DEST_XML Date: Mon, 18 Nov 2024 14:59:28 +0100 Message-ID: <6e2922dcbd72a1493dd8b87a60eddc297dca69ed.1731938316.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: eGrEBoTdHpwRTQ4oX8EqmDgdROBtjcvzgOSq6--iBMk_1731938375 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CKLIJERF6X3AWBMD2JSWISFZDWKPPZMN X-Message-ID-Hash: CKLIJERF6X3AWBMD2JSWISFZDWKPPZMN X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731938445783116600 Content-Type: text/plain; charset="utf-8" When a VM is being migrated to a destination host it can be made persistent on the destination by using VIR_MIGRATE_PERSIST_DEST. That may not work as intended if VIR_MIGRATE_PARAM_DEST_XML or the 'xmlin' parameter is used as that allows overriding certain aspects of the VM xml, but does not involve the persistent definition. In most cases users will need to supply also VIR_MIGRATE_PARAM_PERSIST_XML with the same set of modification. Modify the man page to clarify the above so that users don't end up with broken VM after migrating and restarting it. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- include/libvirt/libvirt-domain.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 9232ce2e6b..d4f1573954 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -929,6 +929,19 @@ typedef enum { * VIR_MIGRATE_UNDEFINE_SOURCE is not used, it will end up persistent = on * both hosts. * + * Note: If VIR_MIGRATE_PERSIST_DEST flag is used together with the + * VIR_MIGRATE_PARAM_DEST_XML migration parameter which supplies= an + * updated definition for the destination host it's required to + * supply also VIR_MIGRATE_PARAM_PERSIST_XML updated the same wa= y. + * Otherwise the persistent definition on the destination will n= ot + * contain the updates. + * + * The VIR_MIGRATE_PERSIST_DEST flag should not be used with the + * "xmlin" parameter of older APIs as that way an updated persis= tent + * XML can't be supplied and thus the persistent definition will + * likely be incorrect as it will be based on the persistent def= inition + * on the source of the migration. + * * Since: 0.7.3 */ VIR_MIGRATE_PERSIST_DEST =3D (1 << 3), --=20 2.47.0 From nobody Thu Dec 26 18:06:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731938473323649.8078315707336; Mon, 18 Nov 2024 06:01:13 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 425621B1B; Mon, 18 Nov 2024 09:01:12 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 726E51A82; Mon, 18 Nov 2024 08:59:48 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2D7A81B92; Mon, 18 Nov 2024 08:59:44 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D92531B0F for ; Mon, 18 Nov 2024 08:59:38 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492-b2MeeYL6PJq37hzVg2-PJQ-1; Mon, 18 Nov 2024 08:59:37 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A1CF21955E84 for ; Mon, 18 Nov 2024 13:59:36 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.6]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B1D501956056 for ; Mon, 18 Nov 2024 13:59:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731938378; h=from:from: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; bh=qoJkCzeGdlhwe9i+MohkHIblg5hDvyhvrJl7H+h4zuE=; b=TLqlkMr9iUOnczfV/PMouSniQKdTCL7XOXM2xR5gujiw1Xiu1IUawBypmuHvhHmU5m1DJc FL6f/QsOykKoohCGJzeH8hcTsI6eEcuICURN2lGYW8anQ+fOavDoxgLQXXXQXDLbG1hc0T HW6IofvY+oZK4xToNwJBEzS89/Jib6g= X-MC-Unique: b2MeeYL6PJq37hzVg2-PJQ-1 X-Mimecast-MFC-AGG-ID: b2MeeYL6PJq37hzVg2-PJQ From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 3/3] manpage: virsh: Add warning about 'migrate' with '--persistent' together with '--xml' Date: Mon, 18 Nov 2024 14:59:29 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VIODHHuGCsuIfzF3VmoXbwbKVbuQVQe5hOy8_wQ2KdE_1731938376 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BAMJNBCATUS4V4V775WQLTQMETNIOVVP X-Message-ID-Hash: BAMJNBCATUS4V4V775WQLTQMETNIOVVP X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731938473773116600 Content-Type: text/plain; charset="utf-8" When a VM is being migrated to a destination host it can be made persistent on the destination by using '--persistent'. That may not work as intended if '--xml' is used as well as that allows overriding certain aspects of the VM xml, but does not involve the persistent definition. In most cases users will need to supply also '--persistent-xml' with the same set of modification. Modify the man page to clarify the above so that users don't end up with broken VM after migrating and restarting it. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- docs/manpages/virsh.rst | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 6776ea53d0..2e525d3fac 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3409,7 +3409,8 @@ starting the domain on destination and without stoppi= ng it on source host. Offline migration may be used with inactive domains and it must be used wi= th *--persistent* option. -*--persistent* leaves the domain persistent on destination host, +*--persistent* leaves the domain persistent on destination host (See below +for quirks when used together with *--xml*), *--undefinesource* undefines the domain on the source host, and *--suspend* leaves the domain paused on the destination host. @@ -3489,13 +3490,18 @@ such as GFS2 or GPFS. If you are sure the migration= is safe or you just do not care, use *--unsafe* to force the migration. *dname* is used for renaming the domain to new name during migration, which -also usually can be omitted. Likewise, *--xml* ``file`` is usually -omitted, but can be used to supply an alternative XML file for use on -the destination to supply a larger set of changes to any host-specific -portions of the domain XML, such as accounting for naming differences -between source and destination in accessing underlying storage. -If *--persistent* is enabled, *--persistent-xml* ``file`` can be used to -supply an alternative XML file which will be used as the persistent guest +also usually can be omitted. + +*--xml* ``file``, while usually not required, can be used to supply an +alternative XML file for use on the destination to supply a larger set of +changes to any host-specific portions of the domain XML, such as accountin= g for +naming differences between source and destination in accessing underlying +storage. If *--xml* is used together with *--persistent* it's usually requ= ired +to provide a persistent XML definition via *--persistent-xml* (see below) = which +is fixed the same way as the XML passed to *--file* was. + +If *--persistent* is enabled, *--persistent-xml* ``file`` can be used +to supply an alternative XML file which will be used as the persistent gue= st definition on the destination host. *--timeout* ``seconds`` tells virsh to run a specified action when live --=20 2.47.0