From nobody Sun Feb 8 21:37:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1582293144; cv=none; d=zohomail.com; s=zohoarc; b=W4AijKKsQvwIzHSZwfXJJMZTFnf53HUWTyZVjXwmNKwavTGOxfoQjMdXFFVQP3Jq5Opj0hsSrPwOluivXD6IcFCff/SejxKlsdfqTa0wOT7qAkTzEf9sg5DwlGKe4/+MuhAqTmbz+zSTnDg1loueSVOjnKlwALci1UOpeSMWPbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582293144; 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=cOZyN8yYENfL28j7yRnbH6bP/WCKPLG/ZPYCF97JY7k=; b=dXUvH9RcsngYsLuZ/QJXsyB4uZGFFVQ5HdRHIB9GZFAutzMCX8vPFDD46n0tkpiy7/JLm6Ghqn+beaeMe0tX0XlpkGyxi7e/FEljzSiFqdEEvI31AIuTYng4OH7h3sTtGvRzxbP2ljG84DCC4+EjBmwu7DYtSo7jqJe7RFP2CvM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582293144574165.23613353687847; Fri, 21 Feb 2020 05:52:24 -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-14-ciI4d51UMiSfZ8OM770JPw-1; Fri, 21 Feb 2020 08:52:20 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67B4B14E3; Fri, 21 Feb 2020 13:52:15 +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 3393091833; Fri, 21 Feb 2020 13:52:15 +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 E18F61832DA3; Fri, 21 Feb 2020 13:52:14 +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 01LDpvwK032515 for ; Fri, 21 Feb 2020 08:51:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 901655E7D4; Fri, 21 Feb 2020 13:51:57 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0719B5D9C5 for ; Fri, 21 Feb 2020 13:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582293143; 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=cOZyN8yYENfL28j7yRnbH6bP/WCKPLG/ZPYCF97JY7k=; b=BMc+5RGbu3S3raquTvW/9tF8yZRAuapyRg47sPNysIb2v6s2e4aT2fA7O58EtQNz8iOq6Y 42JCH/G3dd+BKOF70pX3f9z2LdbPQaPAGUW1iNERgi30ZHZ3XQErApialWm1OhI42EcQCD lD7xrGjap+4qomR5rM/9SSwGxyy4xKg= X-MC-Unique: ciI4d51UMiSfZ8OM770JPw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/7] virStorageSourceNewFromBacking: Also transfer the format Date: Fri, 21 Feb 2020 14:51:42 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.15 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" When we create the new virStorageSource from the definitions stored in the parent we should also use the 'backingStoreRawFormat' field to populate the format. Callers which use virStorageSourceNewFromBacking are also fixed to stop setting the format manually. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_util.c | 5 +---- src/util/virstoragefile.c | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 8199c7a2af..f71abbd729 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -3329,7 +3329,6 @@ static int storageBackendProbeTarget(virStorageSourcePtr target, virStorageEncryptionPtr *encryption) { - int backingStoreFormat; int rc; struct stat sb; g_autoptr(virStorageSource) meta =3D NULL; @@ -3360,15 +3359,13 @@ storageBackendProbeTarget(virStorageSourcePtr targe= t, if (!(meta =3D virStorageFileGetMetadataFromFD(target->path, fd, VIR_STORAGE_FILE_AUTO, - &backingStoreFormat))) + NULL))) return -1; if (meta->backingStoreRaw) { if (virStorageSourceNewFromBacking(meta, &target->backingStore) < = 0) return -1; - target->backingStore->format =3D backingStoreFormat; - /* XXX: Remote storage doesn't play nicely with volumes backed by * remote storage. To avoid trouble, just fake the backing store i= s RAW * and put the string from the metadata as the path of the target.= */ diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 2d8fe59c25..6fddc0610e 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -3824,6 +3824,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr pa= rent, backing)) < 0) return rc; + (*backing)->format =3D parent->backingStoreRawFormat; (*backing)->readonly =3D true; return rc; } @@ -5028,8 +5029,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, if (rv =3D=3D 1) return 0; - backingStore->format =3D src->backingStoreRawFormat; - if (backingStore->format =3D=3D VIR_STORAGE_FILE_AUTO) { /* Assuming the backing store to be raw can lead to failures. = We do * it only when we must not report an error to prevent losing = VMs. --=20 2.24.1