From nobody Sat Jul 12 05:35:37 2025 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 1511526105124831.6271260118809; Fri, 24 Nov 2017 04:21:45 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DDF34902F; Fri, 24 Nov 2017 12:21:44 +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 EEF555C8A3; Fri, 24 Nov 2017 12:21:43 +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 B8AD33FCFD; Fri, 24 Nov 2017 12:21:43 +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 vAOCLW8K007320 for ; Fri, 24 Nov 2017 07:21:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id D21415C8A3; Fri, 24 Nov 2017 12:21:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E3565C88A; Fri, 24 Nov 2017 12:21:30 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 24 Nov 2017 13:21:02 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/3] qemu: process: Move handling of non-backing files into qemuDomainDetermineDiskChain 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Nov 2017 12:21:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Until now we would skip loading of the backing chain for files which don't support backing chains only when starting up the VM. Move the check from qemuProcessPrepareHostStorage with some adaptations so that's always applied. Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 17 +++++++++++++++++ src/qemu/qemu_process.c | 10 ---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0e6ebdc0a8..0cdcb11c37 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6154,6 +6154,23 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, if (force_probe) virStorageSourceBackingStoreClear(src); + /* There is no need to check the backing chain for disks without backi= ng + * support */ + if (virStorageSourceIsLocalStorage(src) && + src->format > VIR_STORAGE_FILE_NONE && + src->format < VIR_STORAGE_FILE_BACKING) { + + if (!virFileExists(src->path)) { + if (report_broken) + virStorageFileReportBrokenChain(errno, src, disk->src); + + goto cleanup; + } + + ret =3D 0; + goto cleanup; + } + /* skip to the end of the chain if there is any */ while (virStorageSourceHasBacking(src)) { if (report_broken && diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8574f2b413..ea70885dd9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5555,20 +5555,10 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driv= er, for (i =3D vm->def->ndisks; i > 0; i--) { size_t idx =3D i - 1; virDomainDiskDefPtr disk =3D vm->def->disks[idx]; - virStorageFileFormat format =3D virDomainDiskGetFormat(disk); if (virStorageSourceIsEmpty(disk->src)) continue; - /* There is no need to check the backing chain for disks - * without backing support, the fact that the file exists is - * more than enough */ - if (virStorageSourceIsLocalStorage(disk->src) && - format > VIR_STORAGE_FILE_NONE && - format < VIR_STORAGE_FILE_BACKING && - virFileExists(virDomainDiskGetSource(disk))) - continue; - if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) >= =3D 0) continue; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list