From nobody Thu May 2 04:03:26 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; dkim=fail; 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 1516890106480786.5262173020399; Thu, 25 Jan 2018 06:21:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1281812E4F5; Thu, 25 Jan 2018 14:21:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0209609AA; Thu, 25 Jan 2018 14:21:44 +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 3706A18033DA; Thu, 25 Jan 2018 14:21:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0PELhId029103 for ; Thu, 25 Jan 2018 09:21:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8592D18205; Thu, 25 Jan 2018 14:21:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FD3418210; Thu, 25 Jan 2018 14:21:36 +0000 (UTC) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C494DAB084; Thu, 25 Jan 2018 14:21:34 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id q67so5136792pga.9; Thu, 25 Jan 2018 06:21:34 -0800 (PST) Received: from localhost.localdomain ([205.209.132.2]) by smtp.gmail.com with ESMTPSA id o1sm16185470pfa.101.2018.01.25.06.21.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 06:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gcObgVLrrR/ZhejeiuS4cuIUUtLof/xCiOqgXFVdH6M=; b=COz/0MlLGkUB851SU28aMwqsn4YHi/thfpidE/zov/7h0WzmpDTbuGuPUpWDvmqozZ s5BZKBsmcDqlke2vVI/8tVSrs05An4f0EiAc80UAZZSRvyuMy3eZpt2XBf9Cfg8Z6hDJ WRq9zAekyGL2Kq3tfY6lkIGqgliip8nC5gB14ITS+Imni25lnwBxmvoEOvZRnlTg6UI6 s58Ig0ZGDJKGMELdacL+qTmzGFWw7EGYgrDFqxm3rRQntjoBsfilRcUR8tIiXmL78K/f Hkpjl/qRswcfOyzz9ky2+S69SQb45ghVGOqTcD1elTuSKfHDVaxFKESmGJoo2NOYgzH9 yaMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gcObgVLrrR/ZhejeiuS4cuIUUtLof/xCiOqgXFVdH6M=; b=jw3siCT4jIfQIrcwQOAvzh6mHvNd3MT8Vmn0UkJ+0gu8aqbhKIhh+oHFQaL7C3B7iY WJf/oHL/4dR4Fo+fT9qTRo+q9tHTRhX/lL4u+HxpGz7Qq/5hvo3UZhwdpbFQoPZFgD+r cPu3v9ViB0wf4ufewi0QehEpOl1ucHoShkMx3ucatHB3umUH0HKF2yvZpiMoRi3cWxrV tJALbMcl6wYa7MVWoM6hH+P1Px9nHxn94emhIO132wJuNNKmDHE1NelwjTDM0upJsJJm 8oeaP49pkwQgHXDPFgwLI3jbrQtARqeZh1TH/vDyjSphc9Bypbs6XQOE9U0iuheHh1Eq gozQ== X-Gm-Message-State: AKwxyte/rkglLGATneLYRt0Y3oQJ9j+KfcaR7cBp2h9v9hVCAgt8Ga4o CBb4uff0gTE20J2HKbC8v+HG0g== X-Google-Smtp-Source: AH8x226UfRZdg0msZfv9l4fodVvS8wA96fSr2F+JQdZtttNzsx7Gkn1e0iioqKlsZD46LCCJ7NsnsA== X-Received: by 10.98.57.142 with SMTP id u14mr16237601pfj.237.1516890093995; Thu, 25 Jan 2018 06:21:33 -0800 (PST) From: Prerna Saxena To: libvir-list@redhat.com Date: Thu, 25 Jan 2018 19:51:23 +0530 Message-Id: <1516890083-153428-1-git-send-email-saxenap.ltc@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 25 Jan 2018 14:21:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 25 Jan 2018 14:21:34 +0000 (UTC) for IP:'74.125.83.66' DOMAIN:'mail-pg0-f66.google.com' HELO:'mail-pg0-f66.google.com' FROM:'saxenap.ltc@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.13 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.83.66 mail-pg0-f66.google.com 74.125.83.66 mail-pg0-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com Subject: [libvirt] [PATCH] Migration: Preserve the failed job in case migration job is terminated beyond the perform phase. 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 25 Jan 2018 14:21:45 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In case of non-p2p migration, in case libvirt client gets disconnected from= source libvirt after PERFORM phase is over, the daemon just resets the current migration j= ob. However, the VM could be left paused on both source and destination in such= case. In case the client reconnects and queries migration status, the job has been blanke= d out from source libvirt, and this reconnected client has no clear way of figuring out if an unclean = migration had previously been aborted. This patch calls out a "potentially" incomplete migration as a failed job, = so that a client may be able to watch previously failed jobs for this VM and take corrective act= ions as needed. Signed-off-by: Prerna Saxena --- src/qemu/qemu_domain.c | 16 ++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ src/qemu/qemu_migration.c | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e8e0313..7c60d17 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4564,6 +4564,22 @@ qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver= , virDomainObjPtr obj) qemuDomainObjSaveJob(driver, obj); } =20 + +void +qemuDomainObjFailAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj) +{ + qemuDomainObjPrivatePtr priv =3D obj->privateData; + VIR_FREE(priv->job.completed); + if (VIR_ALLOC(priv->job.completed) =3D=3D 0) { + priv->job.current->type =3D VIR_DOMAIN_JOB_FAILED; + priv->job.completed =3D priv->job.current; + } else { + VIR_WARN("Unable to allocate job.completed for VM %s", obj->def->n= ame); + } + qemuDomainObjResetAsyncJob(priv); + qemuDomainObjEndJob(driver, obj); +} + void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index c33af36..6465603 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -497,6 +497,8 @@ void qemuDomainObjRestoreJob(virDomainObjPtr obj, struct qemuDomainJobObj *job); void qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj); +void qemuDomainObjFailAsyncJob(virQEMUDriverPtr driver, + virDomainObjPtr obj); void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj); =20 qemuMonitorPtr qemuDomainGetMonitor(virDomainObjPtr vm) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 69eb231..fd8950e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1911,8 +1911,8 @@ qemuMigrationCleanup(virDomainObjPtr vm, VIR_WARN("Migration of domain %s finished but we don't know if the" " domain was successfully started on destination or not", vm->def->name); - /* clear the job and let higher levels decide what to do */ - qemuDomainObjDiscardAsyncJob(driver, vm); + /* clearly "fail" the job and let higher levels decide what to do = */ + qemuDomainObjFailAsyncJob(driver, vm); break; =20 case QEMU_MIGRATION_PHASE_PERFORM3: --=20 1.7.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list