From nobody Mon Feb 9 12:11:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1582293149; cv=none; d=zohomail.com; s=zohoarc; b=F/0Eu+e9k2XyeRgmwu9yBgBwXrbtv6dR8pwPzCGwARH9OicCUJ37VLwgbpKWqFRotp3QoAhK4KwLAU2Thz8HkqGBudhllNkvDKpbSJ5gcMciTR3gQisphPVInsuqY3vxWw1u/ApX0qLTbvnI1vHsEu7g6szo9QQr+eG5nZVL2Dk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582293149; 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=OYl8TDHBKkKH2BARbHwoSkIkhpnQPUmKCVBCJRBktZw=; b=Hxr4aXKqsRaxnLlXUp3kzb8VtcDauvUYnpN3dtoiaybtUGi+ZheI/4gnE+Jh0A3qiaRH8NDNfCW14BumwkHanZQKuvvHIh984jD2xe84GVzvH7UQhcz5lHExS9rzCussPw5asFkG916I5XBdzghUu7q/WrLbzyfJ1cptji0gjWg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582293149278918.0541240239448; Fri, 21 Feb 2020 05:52:29 -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-481-G34tyQYfM02vBL7VJijhkw-1; Fri, 21 Feb 2020 08:52:25 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1807E802B67; Fri, 21 Feb 2020 13:52:20 +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 DB59360C99; Fri, 21 Feb 2020 13:52:19 +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 8D82E35B1F; Fri, 21 Feb 2020 13:52:19 +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 01LDpx1b032530 for ; Fri, 21 Feb 2020 08:51:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2E2335D9C5; Fri, 21 Feb 2020 13:51:59 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A715C5DA76 for ; Fri, 21 Feb 2020 13:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582293148; 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=OYl8TDHBKkKH2BARbHwoSkIkhpnQPUmKCVBCJRBktZw=; b=P1FQig1cSkNBov5ncstniLmCk3DwCkyohIC7sSnZYWvE0+KIEuCyXkfZIeD3cXBBr5bIvc thoOeJfFPP5m11qXddjfLzSH1UY3UHeK0JpLo4E3sMAFdfmeh2Q7Ck6B7EYTmx9zW/D/09 8og+7ohanAeoG35NVFkr5tylceZLp1o= X-MC-Unique: G34tyQYfM02vBL7VJijhkw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/7] virStorageFileGetMetadataFromBuf: Remove 'backingFormat' argument Date: Fri, 21 Feb 2020 14:51:44 +0100 Message-Id: <740656e71a44365f516c72b1538824007766d37c.1582293053.git.pkrempa@redhat.com> 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.12 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" None of the callers actually use it. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_backend_gluster.c | 3 +-- src/util/virstoragefile.c | 16 ++++++---------- src/util/virstoragefile.h | 3 +-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index e92e9612bd..db3df82aad 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -275,8 +275,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, goto cleanup; if (!(meta =3D virStorageFileGetMetadataFromBuf(name, header, len, - VIR_STORAGE_FILE_AUTO, - NULL))) + VIR_STORAGE_FILE_AUTO))) goto cleanup; if (meta->backingStoreRaw) { diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 6fddc0610e..94805e8741 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1109,7 +1109,6 @@ virStorageFileMetadataNew(const char *path, * @buf: header bytes from @path * @len: length of @buf * @format: format of the storage file - * @backingFormat: format of @backing * * Extract metadata about the storage volume with the specified image form= at. * If image format is VIR_STORAGE_FILE_AUTO, it will probe to automatically @@ -1119,9 +1118,10 @@ virStorageFileMetadataNew(const char *path, * that might be raw if that file will then be passed to a guest, since a * malicious guest can turn a raw file into any other non-raw format at wi= ll. * - * If the returned @backingFormat is VIR_STORAGE_FILE_AUTO it indicates the - * image didn't specify an explicit format for its backing store. Callers = are - * advised against probing for the backing store format in this case. + * If the 'backingStoreRawFormat' field of the returned structure is + * VIR_STORAGE_FILE_AUTO it indicates the image didn't specify an explicit + * format for its backing store. Callers are advised against probing for t= he + * backing store format in this case. * * Caller MUST free the result after use via virObjectUnref. */ @@ -1129,8 +1129,7 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path, char *buf, size_t len, - int format, - int *backingFormat) + int format) { virStorageSourcePtr ret =3D NULL; @@ -1142,9 +1141,6 @@ virStorageFileGetMetadataFromBuf(const char *path, return NULL; } - if (backingFormat) - *backingFormat =3D ret->backingStoreRawFormat; - return ret; } @@ -3991,7 +3987,7 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr sr= c, if (format =3D=3D VIR_STORAGE_FILE_RAW && !src->encryption) { src->capacity =3D src->physical; } else if ((meta =3D virStorageFileGetMetadataFromBuf(src->path, buf, - len, format, NULL)= )) { + len, format))) { src->capacity =3D meta->capacity ? meta->capacity : src->physical; if (src->encryption && meta->encryption) src->encryption->payload_offset =3D meta->encryption->payload_= offset; diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index ecba418bb3..32f2c82147 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -386,8 +386,7 @@ virStorageSourcePtr virStorageFileGetMetadataFromFD(con= st char *path, virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path, char *buf, size_t len, - int format, - int *backingFormat) + int format) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virStorageFileChainGetBroken(virStorageSourcePtr chain, char **broken_file); --=20 2.24.1