From nobody Thu May 9 00:24:16 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548752223787261.9165160981821; Tue, 29 Jan 2019 00:57:03 -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 5BFD92CD7F4; Tue, 29 Jan 2019 08:57:00 +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 E43597CE54; Tue, 29 Jan 2019 08:56:58 +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 0D5BB18033A3; Tue, 29 Jan 2019 08:56:54 +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 x0T8uqMr004347 for ; Tue, 29 Jan 2019 03:56:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id BBEDD5C25D; Tue, 29 Jan 2019 08:56:52 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FC4C5C57C for ; Tue, 29 Jan 2019 08:56:48 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 29 Jan 2019 09:56:46 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] qemu: Assume migration with a network disk migration is safe 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 29 Jan 2019 08:57:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" If a domain has a disk that is type=3D'network' we require specific cache mode to allow migration with it (either 'directsync' or 'none'). This doesn't make much sense since network disks are supposed to be safe to migrate by default. At the same time, we should be checking for the actual source type, not apparent type set in the domain XML. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- v2 of: https://www.redhat.com/archives/libvir-list/2019-January/msg01070.html diff to v1: - Allow just every network disk - Check for actual disk type not the apparent one src/qemu/qemu_migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 52aa665640..1433b2c2f3 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1236,7 +1236,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, continue; =20 /* However, disks on local FS (e.g. ext4) are not safe. */ - if (virDomainDiskGetType(disk) =3D=3D VIR_STORAGE_TYPE_FILE) { + if (virStorageSourceGetActualType(disk->src) =3D=3D VIR_STORAGE_TY= PE_FILE) { if ((rc =3D virFileIsSharedFS(src)) < 0) { return false; } else if (rc =3D=3D 0) { @@ -1248,8 +1248,8 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, return false; else if (rc =3D=3D 1) continue; - } else if (disk->src->type =3D=3D VIR_STORAGE_TYPE_NETWORK && - disk->src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD= ) { + } else if (virStorageSourceGetActualType(disk->src) =3D=3D VIR_STO= RAGE_TYPE_NETWORK) { + /* But network disks are safe again. */ continue; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list