From nobody Wed Feb 11 09:01:51 2026 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.zoho.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 1491398130068615.8599463734423; Wed, 5 Apr 2017 06:15:30 -0700 (PDT) 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 73D80624D7; Wed, 5 Apr 2017 13:15:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 128AE19173; Wed, 5 Apr 2017 13:15:28 +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 8D8625ED65; Wed, 5 Apr 2017 13:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v35DA75M028771 for ; Wed, 5 Apr 2017 09:10:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id C8188A4067; Wed, 5 Apr 2017 13:10:07 +0000 (UTC) Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B9DBA4073 for ; Wed, 5 Apr 2017 13:10:05 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 99742101C9B; Wed, 5 Apr 2017 15:10:04 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 73D80624D7 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 73D80624D7 From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 5 Apr 2017 15:09:57 +0200 Message-Id: <01fee1964b8c03c4ef40fad432d2de25b416417f.1491397357.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] qemu: Drop resume label in qemuProcessRecoverMigrationOut 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.39]); Wed, 05 Apr 2017 13:15:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Let's use a bool variable to create a single shared path returning 0. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a37496107..f2a80ad22 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2998,6 +2998,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr drive= r, bool postcopy =3D state =3D=3D VIR_DOMAIN_PAUSED && (reason =3D=3D VIR_DOMAIN_PAUSED_POSTCOPY || reason =3D=3D VIR_DOMAIN_PAUSED_POSTCOPY_FAILED); + bool resume =3D false; =20 switch (phase) { case QEMU_MIGRATION_PHASE_NONE: @@ -3028,7 +3029,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr drive= r, VIR_WARN("Could not cancel ongoing migration of domain %s", vm->def->name); } - goto resume; + resume =3D true; } break; =20 @@ -3051,7 +3052,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr drive= r, } else { VIR_DEBUG("Resuming domain %s after failed migration", vm->def->name); - goto resume; + resume =3D true; } break; =20 @@ -3061,21 +3062,21 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr dri= ver, return -1; } =20 - return 0; - - resume: - /* resume the domain but only if it was paused as a result of - * migration - */ - if (state =3D=3D VIR_DOMAIN_PAUSED && - (reason =3D=3D VIR_DOMAIN_PAUSED_MIGRATION || - reason =3D=3D VIR_DOMAIN_PAUSED_UNKNOWN)) { - if (qemuProcessStartCPUs(driver, vm, conn, - VIR_DOMAIN_RUNNING_UNPAUSED, - QEMU_ASYNC_JOB_NONE) < 0) { - VIR_WARN("Could not resume domain %s", vm->def->name); + if (resume) { + /* resume the domain but only if it was paused as a result of + * migration + */ + if (state =3D=3D VIR_DOMAIN_PAUSED && + (reason =3D=3D VIR_DOMAIN_PAUSED_MIGRATION || + reason =3D=3D VIR_DOMAIN_PAUSED_UNKNOWN)) { + if (qemuProcessStartCPUs(driver, vm, conn, + VIR_DOMAIN_RUNNING_UNPAUSED, + QEMU_ASYNC_JOB_NONE) < 0) { + VIR_WARN("Could not resume domain %s", vm->def->name); + } } } + return 0; } =20 --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list