From nobody Fri May 3 01:00:30 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15180262691461003.7893707711016; Wed, 7 Feb 2018 09:57:49 -0800 (PST) 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 904AB4E4C3; Wed, 7 Feb 2018 17:57:47 +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 23B91608EE; Wed, 7 Feb 2018 17:57:47 +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 872824A46F; Wed, 7 Feb 2018 17:57:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w17HvQDx009678 for ; Wed, 7 Feb 2018 12:57:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id E9F27659E7; Wed, 7 Feb 2018 17:57:26 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E104C19024 for ; Wed, 7 Feb 2018 17:57:23 +0000 (UTC) Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CEE187627 for ; Wed, 7 Feb 2018 17:57:22 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id w17HvLUg004604 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 7 Feb 2018 09:57:21 -0800 (PST) Received: from [172.25.39.2] (172.25.39.2) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 7 Feb 2018 09:57:15 -0800 Message-ID: <5A7B3DFF.2090109@windriver.com> Date: Wed, 7 Feb 2018 11:57:19 -0600 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: X-Originating-IP: [172.25.39.2] X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 07 Feb 2018 17:57:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 07 Feb 2018 17:57:22 +0000 (UTC) for IP:'147.11.146.13' DOMAIN:'mail1.windriver.com' HELO:'mail1.windriver.com' FROM:'Chris.Friesen@windriver.com' RCPT:'' X-RedHat-Spam-Score: -2.311 (RCVD_IN_DNSWL_MED, SPF_PASS, T_RP_MATCHES_RCVD) 147.11.146.13 mail1.windriver.com 147.11.146.13 mail1.windriver.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: fix migration with local and VIR_STORAGE_TYPE_NETWORK disks 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.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 07 Feb 2018 17:57:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In the current implementation of qemuMigrateDisk() the value of the "nmigrate_disks" parameter wrongly impacts the decision whether or not to migrate a disk that is not a member of "migrate_disks": 1) If "nmigrate_disks" is zero, "disk" is migrated if it's non-shared non-readonly with source. 2) If "nmigrate_disks" is non-zero and "disk" is not a member of "migrate_disks" then "disk" is not migrated. This should instead proceed with checking conditions as per 1) and allow migration of non-shared non-readonly disks with source. Fixing 2) breaks migration of VMs with a mix of rbd and local disks because now libvirt tries to migrate the rbd root disk and it fails. This new problem is solved by updating 1) to factor in disk source type and migrate only 'local' non-shared non-readonly disks with source. The end result is that disks not in "migrate_disks" are treated uniformly regardless of the value of "nmigrate_disks". Signed-off-by: Chris Friesen --- src/qemu/qemu_migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5ee9e5c..77fafc6 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -409,12 +409,12 @@ qemuMigrateDisk(virDomainDiskDef const *disk, if (STREQ(disk->dst, migrate_disks[i])) return true; } - return false; } =20 - /* Default is to migrate only non-shared non-readonly disks + /* Default is to migrate only non-shared non-readonly local disks * with source */ return !disk->src->shared && !disk->src->readonly && + (disk->src->type !=3D VIR_STORAGE_TYPE_NETWORK) && !virStorageSourceIsEmpty(disk->src); } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list