From nobody Sun Apr 28 07:20:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528124888812394.8759183582911; Mon, 4 Jun 2018 08:08:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D99C9388820; Mon, 4 Jun 2018 15:08:06 +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 31BA627081; Mon, 4 Jun 2018 15:08:06 +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 5B6CD4CA83; Mon, 4 Jun 2018 15:08:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w54EpPJK011478 for ; Mon, 4 Jun 2018 10:51:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 848A3210C6D2; Mon, 4 Jun 2018 14:51:25 +0000 (UTC) Received: from mamuti.net (ovpn-204-240.brq.redhat.com [10.40.204.240]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 532C8200BCBB for ; Mon, 4 Jun 2018 14:51:25 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id A376A101FEF; Mon, 4 Jun 2018 16:51:23 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 16:51:18 +0200 Message-Id: <7fa30b5422e239f05ed9c9cd4c081e15814da58d.1528123878.git.jdenemar@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Fix domain resume after failed migration 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 04 Jun 2018 15:08:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Libvirt relies on being able to kill the destination domain and resume the source one during migration until we called "cont" on the destination. Unfortunately, QEMU automatically activates block devices at the end of migration even when it's called with -S. This wasn't a big issue in the past since the guest is not running and thus no data are written to the block devices. However, when QEMU introduced its internal block device locks, we can no longer resume the source domain once the destination domain already activated the block devices (and thus acquired all locks) unless the destination domain is killed first. Since it's impossible to synchronize the destination and the source libvirt daemons after a failed migration, QEMU introduced a new migration capability called "late-block-activat" which ensures QEMU won't activate block devices until it gets "cont". The only thing we need to do is to enable this capability whenever QEMU supports it. https://bugzilla.redhat.com/show_bug.cgi?id=3D1568407 QEMU commit implementing the capability: v2.12.0-952-g0f073f44df Signed-off-by: Jiri Denemark Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_migration_params.c | 4 ++++ src/qemu/qemu_migration_params.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 2083563d32..63d20ff5dc 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -84,6 +84,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, QEMU_MIGRATION_CAP= _LAST, "postcopy-ram", "compress", "pause-before-switchover", + "late-block-activate", ); =20 =20 @@ -129,6 +130,9 @@ struct _qemuMigrationParamsTPMapItem { static const qemuMigrationParamsAlwaysOnItem qemuMigrationParamsAlwaysOn[]= =3D { {QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER, QEMU_MIGRATION_SOURCE}, + + {QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE, + QEMU_MIGRATION_DESTINATION}, }; =20 /* Translation from virDomainMigrateFlags to qemuMigrationCapability. */ diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 9a865b19f3..bee503d0f4 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -37,6 +37,7 @@ typedef enum { QEMU_MIGRATION_CAP_POSTCOPY, QEMU_MIGRATION_CAP_COMPRESS, QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER, + QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE, =20 QEMU_MIGRATION_CAP_LAST } qemuMigrationCapability; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list