From nobody Sun Apr 28 14:45:01 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516830558322772.892389678565; Wed, 24 Jan 2018 13:49:18 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FBCC1F583; Wed, 24 Jan 2018 21:49:17 +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 EB89F605DC; Wed, 24 Jan 2018 21:49:15 +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 3DE354ED37; Wed, 24 Jan 2018 21:49:14 +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 w0OLiNEi027881 for ; Wed, 24 Jan 2018 16:44:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 077A75D728; Wed, 24 Jan 2018 21:44:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01E1B413B for ; Wed, 24 Jan 2018 21:44:19 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6217A4B6E for ; Wed, 24 Jan 2018 21:44:18 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Wed, 24 Jan 2018 14:44:13 -0700 From: Jim Fehlig To: libvir-list@redhat.com Date: Wed, 24 Jan 2018 14:43:46 -0700 Message-Id: <20180124214346.9303-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 24 Jan 2018 21:44:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 24 Jan 2018 21:44:18 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] libxl: resume lock process 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 24 Jan 2018 21:49:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" During migration, the lock process is paused in the perform phase but not resumed if there is a subsequent failure, leaving the locked resource unprotected. The perform phase itself can fail, in which case the lock process should be resumed before returning from perform. The finish phase could also fail on the destination host, in which case the migration is canceled in the confirm phase and the VM is resumed. The lock process needs to be resumed there as well. Signed-off-by: Jim Fehlig --- src/libxl/libxl_migration.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index 228c8508c..a7a578c72 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -1238,6 +1238,12 @@ libxlDomainMigrationPerform(libxlDriverPrivatePtr dr= iver, ret =3D libxlDoMigrateSend(driver, vm, flags, sockfd); virObjectLock(vm); =20 + if (ret < 0) + virDomainLockProcessResume(driver->lockManager, + "xen:///system", + vm, + priv->lockState); + cleanup: VIR_FORCE_CLOSE(sockfd); virURIFree(uri); @@ -1349,10 +1355,16 @@ libxlDomainMigrationConfirm(libxlDriverPrivatePtr d= river, int cancelled) { libxlDriverConfigPtr cfg =3D libxlDriverConfigGet(driver); + libxlDomainObjPrivatePtr priv =3D vm->privateData; virObjectEventPtr event =3D NULL; int ret =3D -1; =20 if (cancelled) { + /* Resume lock process that was paused in MigrationPerform */ + virDomainLockProcessResume(driver->lockManager, + "xen:///system", + vm, + priv->lockState); if (libxl_domain_resume(cfg->ctx, vm->def->id, 1, 0) =3D=3D 0) { ret =3D 0; } else { --=20 2.16.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list