From nobody Mon Feb 9 00:55:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; 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 207.211.31.120 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=1598453811; cv=none; d=zohomail.com; s=zohoarc; b=g+Z+179i0CJCYYpAzp+xzSQd5UhB0xQyzR6SBu/NoRkFU+lN/wMoHOMglum9gYaBczo5iAdZL+CxWfMmxoPqoTdNKJGZDelgQ8ZGxkB5cBs6hSwWYmGUqrWVoscfXcEjVwC9JVQsxCy4fE9qZRjBVYbO9HN2K10ir3NaubUsxys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598453811; 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=iGarD6jEm07wMqDZviCZR2+xtLTMAeL9piIRqdnj0oo=; b=lonBnYad85vtPCfpDkUeg0L/1dvccKHDaPwMoyueZFw+u2UBttkmrL+dN4J+Mr1nRRxrHq9RA1YjwFCSA7i9P45qTRzHDSViAy1HvDsK9n5g90rR52DWgZ7evxIBbf2EzC8O1GAJSRjsZ75wmmkHIFWIw7k/bYB3HW42zbZtsKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159845381123530.405515125784632; Wed, 26 Aug 2020 07:56:51 -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-155-DoCCWTuzMNmoIvB1PcleVg-1; Wed, 26 Aug 2020 10:56:47 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB18B189E608; Wed, 26 Aug 2020 14:56:40 +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 957BD50EB6; Wed, 26 Aug 2020 14:56:40 +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 5AE77662D9; Wed, 26 Aug 2020 14:56:40 +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 07QEuWAo006337 for ; Wed, 26 Aug 2020 10:56:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCD0919744; Wed, 26 Aug 2020 14:56:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEA6719C78; Wed, 26 Aug 2020 14:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598453810; 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=iGarD6jEm07wMqDZviCZR2+xtLTMAeL9piIRqdnj0oo=; b=byqIzaTXhGdjWzmslwZy9M7189bT+wE/rXTMnf5L6iQW+umDZvyfqLnjYmK0yrV9eFtnNl M1jzdnr8q3AGMoZUMUUiOxC/qtm/KL7IDx31C3JCSDl0f69VBNvRoGmWcIX7amyb+khD55 MK20wiHnbxDXEV2hdBzvrErNqhYX2Oo= X-MC-Unique: DoCCWTuzMNmoIvB1PcleVg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 1/3] qemu: monitor: Detect image cluster size from 'query-named-block-nodes' Date: Wed, 26 Aug 2020 16:56:18 +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.11 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" Configuring the cluster size of an image may have performance implications. This patch allows us to detect cluster size for existing images so that we will be able to propagate it to new images which are based on existing images e.g. during snapshots/block-copy/etc. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index d20a15c202..369d63ce12 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -696,6 +696,9 @@ struct _qemuBlockNamedNodeData { qemuBlockNamedNodeDataBitmapPtr *bitmaps; size_t nbitmaps; + + /* the cluster size of the image is valid only when > 0 */ + unsigned long long clusterSize; }; virHashTablePtr diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9cdf6c0f7f..e6d2e7d4db 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2997,6 +2997,9 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos= G_GNUC_UNUSED, if (virJSONValueObjectGetNumberUlong(img, "actual-size", &ent->physica= l) < 0) ent->physical =3D ent->capacity; + /* try looking up the cluster size */ + ignore_value(virJSONValueObjectGetNumberUlong(img, "cluster-size", &en= t->clusterSize)); + if ((bitmaps =3D virJSONValueObjectGetArray(val, "dirty-bitmaps"))) qemuMonitorJSONBlockGetNamedNodeDataBitmaps(bitmaps, ent); --=20 2.26.2