From nobody Mon Feb 9 17:07:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1606226387; cv=none; d=zohomail.com; s=zohoarc; b=DHc7WqT2tXx04TgMU6Fxeyi0ViAtlv80T8AZTKOGkbqthkH63oOtSz43AkD0izTWefHnhbvtPr0FYfuImF1Goxzqx21ZVFhUMnyqvG61TBDmdmO+dmuCFU0QrgmdCPiJqCC67mprZSYtiNmyjnw+NMFflRJhXn3ZWY+GPp1qLQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606226387; 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; bh=6GUxKJTXOatUdwCwKlHpYj+/Q0xDI8pr4qSQ0zAc+i8=; b=MvkEf0AoB3AcTrsE2qmnhhj1GmAgPp40DGyQiw55TT0ZTVT71XLvwJB1UE1HjSsM5LZhipsWlRUU/wj4yViR1/c7kf9/td/hEAHPWRWPPYKSKB5a8LlCKZ5iN3MHhrxXFDjAYbptMdAvlYucWWrX9ogg1HBZ6wDtPJkmRFGeNJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606226386999545.3091875632342; Tue, 24 Nov 2020 05:59:46 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-cwXQ7Z73PZKWmwh8_wdq_g-1; Tue, 24 Nov 2020 08:59:40 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8926E81F02F; Tue, 24 Nov 2020 13:59:33 +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 657F4189A4; Tue, 24 Nov 2020 13:59:33 +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 2A2B31809CA0; Tue, 24 Nov 2020 13:59:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AODxCBq023054 for ; Tue, 24 Nov 2020 08:59:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2EA8C60873; Tue, 24 Nov 2020 13:59:12 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id E679B60864 for ; Tue, 24 Nov 2020 13:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606226385; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6GUxKJTXOatUdwCwKlHpYj+/Q0xDI8pr4qSQ0zAc+i8=; b=iZD0y2MhklnzqC8Gr2uTtrFLxs4B7AEWei3MVCRTL1HJhqJWS9l5hMJyT/J6RZLN+tIGFR ybvbz4C7FpRtaTRdaHK/AUvO7aVFQj/WwPTjO79aXGZzKp1WNLWUVUFe2Lt3IdmfSZkEMH 3chiNvQkfb8OooaaM4jv0aG79JZ+3Ds= X-MC-Unique: cwXQ7Z73PZKWmwh8_wdq_g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] qemu: migration: Aggregate logic depending on tunnelled migration Date: Tue, 24 Nov 2020 14:58:58 +0100 Message-Id: <301961c0ea68bb8b1ed4882e64cabad61da19980.1606226117.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Move and aggregate all the logic which is switched based on whether the migration is tunnelled or not before other checks. Further checks will be added later. While the code is being moved the error message is put on a single line per new coding style. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 85f3c4ccee..13d73638f4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2219,6 +2219,17 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, } if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC)= ) { + if (flags & VIR_MIGRATE_TUNNELLED) { + if (nmigrate_disks) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("Selecting disks to migrate is not implem= ented for tunnelled migration")); + return NULL; + } + } else { + cookieFlags |=3D QEMU_MIGRATION_COOKIE_NBD; + priv->nbdPort =3D 0; + } + if (nmigrate_disks) { size_t i, j; /* Check user requested only known disk targets. */ @@ -2235,18 +2246,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, return NULL; } } - - if (flags & VIR_MIGRATE_TUNNELLED) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("Selecting disks to migrate is not " - "implemented for tunnelled migration")); - return NULL; - } - } - - if (!(flags & VIR_MIGRATE_TUNNELLED)) { - cookieFlags |=3D QEMU_MIGRATION_COOKIE_NBD; - priv->nbdPort =3D 0; } } --=20 2.28.0