From nobody Mon Feb 9 00:56:19 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=1598453823; cv=none; d=zohomail.com; s=zohoarc; b=D0nJqR3Cg4iopYQ5fQafTg+qikIXylVca0OqS7aT1X2ZhuyMqsf7Bx6p4uYkP1SEhQW2+dXHPa0idLE+blQ74ZQUviMmNmv0y7/mQ5nENLzUool6mjiycUfFPh+FhE8uoFzw+tLJakQWcT2vUeMc/AI14vrEVZQEgTIIZapcyNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598453823; h=Content-Type:Content-Transfer-Encoding:Cc: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=6oVQzJvW9FxfnQ/bZ/blj7VSZsiPlbVKqQC/x1AD5S0=; b=jEj08CBcTO50nuTN0zqfK8/+/uxzr03uYtTBUIStlKfjnNOkiNuOW4xHNfL4UXWPiIHrKmOUu66M6lJjwSbScWqnCgRa3As+0E+SleL1eBZhHJVFmreQ6iiPpUOBHiAd0lS7z89LHZuKhSvoXVnYe0KDIyGCfmHvROzFOcowL9U= 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 1598453823320877.2804873736503; Wed, 26 Aug 2020 07:57:03 -0700 (PDT) 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-561-7Cg2W3nQPiSL_7zZ8lL63Q-1; Wed, 26 Aug 2020 10:57:00 -0400 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 CB157425D1; Wed, 26 Aug 2020 14:56:54 +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 A645A60C13; Wed, 26 Aug 2020 14:56:54 +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 759A8668F7; Wed, 26 Aug 2020 14:56:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07QEuq8v006412 for ; Wed, 26 Aug 2020 10:56:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id C420F19746; Wed, 26 Aug 2020 14:56:52 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05E721992F; Wed, 26 Aug 2020 14:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598453822; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=6oVQzJvW9FxfnQ/bZ/blj7VSZsiPlbVKqQC/x1AD5S0=; b=GR1zxiinOVWdawXrk0NQPqRWu/33YZke82ofXWLg1M21TmcXhAI3la3tKIdhtzpJfglQ8l S0WyIxUus4JtS3FKCl7C9/kpQbgXVYefA2a23dTIhtvLQ+OLQZHxZ2nGBIleuLfGCtshO1 R9UzjQPr3++2tuwVtBeHnmV1oyfTkB8= X-MC-Unique: 7Cg2W3nQPiSL_7zZ8lL63Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 3/3] qemuBlockStorageSourceCreateDetectSize: Propagate cluster size for 'qcow2' Date: Wed, 26 Aug 2020 16:56:20 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, yoonho@gmail.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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Propagate the cluster size from the original image as the user might have configured a custom cluster size for performance reasons. Propagate the cluster size of a qcow2 image to the new overlay or copy. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0113c64f0f..6e8fe545b4 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2789,6 +2789,11 @@ qemuBlockStorageSourceCreateDetectSize(virHashTableP= tr blockNamedNodeData, return -1; } + /* propagate cluster size if the images are compatible */ + if (templ->format =3D=3D VIR_STORAGE_FILE_QCOW2 && + src->format =3D=3D VIR_STORAGE_FILE_QCOW2) + src->clusterSize =3D entry->clusterSize; + if (src->format =3D=3D VIR_STORAGE_FILE_RAW) { src->physical =3D entry->capacity; } else { --=20 2.26.2