From nobody Mon Feb 9 14:37:20 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1567611746; cv=none; d=zoho.com; s=zohoarc; b=WZxzVKco/VcYti8rvHqoSDtDlv5VA9RGa430LcZyArl0SP/bJ0wGFZeC9w5Jy2DLTmg6++sCAY+AOU/LT9gehMHDqebNBAG85s2QdYndWgfwhiGbb+gk0FnvUMdMGV+jW8W/89EmJK2QeK4krvw33z4G5ewAOswH1YbPVO1mBaw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567611746; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8rY9l5G+anwIbUUEA0S3haeDHxGIHDqTXQjeoK8lkfU=; b=gRoqQep3A56cnIwKZ22tK7f76Zjlq1pBATtlrhtHERZ0YyL8doC2m4aYnglCSTl9lsChVwM2aYIhzmoU7ddKsI+Bs0Q4J3pqEKyHowbgZqqErs6lZZo5W2nYUjK9QGV0xphcUg3Q2agtoEESTnPjum8XhfdduUq2upsP8yCoDew= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567611746429648.163418132577; Wed, 4 Sep 2019 08:42:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE7C518C4271; Wed, 4 Sep 2019 15:42:24 +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 BC2FF60606; Wed, 4 Sep 2019 15:42:24 +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 8361FE204; Wed, 4 Sep 2019 15:42:24 +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 x84FdWsA028803 for ; Wed, 4 Sep 2019 11:39:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B751260C18; Wed, 4 Sep 2019 15:39:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4030F60BFB for ; Wed, 4 Sep 2019 15:39:32 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 4 Sep 2019 17:39:25 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemu: migration: Refactor cleanup in qemuMigrationSrcNBDStorageCopyBlockdev 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Wed, 04 Sep 2019 15:42:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Remove the cleanup label as it's empty. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index e387deb497..1a557851bb 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -796,50 +796,49 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverP= tr driver, VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data =3D NULL; qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); int mon_ret =3D 0; - int ret =3D -1; VIR_AUTOUNREF(virStorageSourcePtr) copysrc =3D NULL; VIR_DEBUG("starting blockdev mirror for disk=3D%s to host=3D%s", diskA= lias, host); if (!(copysrc =3D virStorageSourceNew())) - goto cleanup; + return -1; copysrc->type =3D VIR_STORAGE_TYPE_NETWORK; copysrc->protocol =3D VIR_STORAGE_NET_PROTOCOL_NBD; copysrc->format =3D VIR_STORAGE_FILE_RAW; if (!(copysrc->backingStore =3D virStorageSourceNew())) - goto cleanup; + return -1; if (VIR_STRDUP(copysrc->path, diskAlias) < 0) - goto cleanup; + return -1; if (VIR_ALLOC_N(copysrc->hosts, 1) < 0) - goto cleanup; + return -1; copysrc->nhosts =3D 1; copysrc->hosts->transport =3D VIR_STORAGE_NET_HOST_TRANS_TCP; copysrc->hosts->port =3D port; if (VIR_STRDUP(copysrc->hosts->name, host) < 0) - goto cleanup; + return -1; if (VIR_STRDUP(copysrc->tlsAlias, tlsAlias) < 0) - goto cleanup; + return -1; if (virAsprintf(©src->nodestorage, "migration-%s-storage", disk->d= st) < 0 || virAsprintf(©src->nodeformat, "migration-%s-format", disk->dst= ) < 0) - goto cleanup; + return -1; /* Migration via blockdev-mirror was supported sooner than the auto-re= ad-only * feature was added to qemu */ if (!(data =3D qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, copysrc->back= ingStore, false))) - goto cleanup; + return -1; if (qemuDomainObjEnterMonitorAsync(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) - goto cleanup; + return -1; mon_ret =3D qemuBlockStorageSourceAttachApply(qemuDomainGetMonitor(vm)= , data); @@ -852,14 +851,11 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverP= tr driver, qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), dat= a); if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0) - goto cleanup; + return -1; VIR_STEAL_PTR(diskPriv->migrSource, copysrc); - ret =3D 0; - - cleanup: - return ret; + return 0; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list