From nobody Mon Feb 9 03:30:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1690976893; cv=none; d=zohomail.com; s=zohoarc; b=BH6eRrMwnT9iks6SANsoSfvlU9dEkfH32UAt4rGuEYJ3R/dA2wfnCrNochkTh8TLL+U6XU/1ZX6w1oPiK8R8t4g4fiv8TsmzsaHOWMAGLvBvy0uvQ53Cv9OCrJ0p6VtOeyUE/MUAMAa1/iZ/GPWuvbAwPviuWZ4tmQrFWyVDsug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690976893; 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=A4VSOkAUCS4sgMeaGrCx6sN4jXBNee3PXwFj1Lj6mCU=; b=S3oNoYRQvJukMlKvZsdUXdE7QKz7e7uIbeVXFldUXOl0278+Fu8jxIV5Vq2hysNkxjJuj17KVzF4/CxC5AGu1LthIR/SkGZB9ZF/XgaPjDBFMp4wDFbfXbkuG4k4HBM+edpUt2isRP+P4J3ifRY/KIncQjRBuNHJo7lAk0UpCag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1690976893233957.0272458535401; Wed, 2 Aug 2023 04:48:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-s9T5oyZPMmCuAReKjHx41A-1; Wed, 02 Aug 2023 07:48:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D0D9B280461D; Wed, 2 Aug 2023 11:48:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4A1E1454143; Wed, 2 Aug 2023 11:48:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8D28A1946A49; Wed, 2 Aug 2023 11:48:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A8AB1947239 for ; Wed, 2 Aug 2023 11:48:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 25012C57965; Wed, 2 Aug 2023 11:48:04 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id C076FC57963 for ; Wed, 2 Aug 2023 11:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690976892; 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=A4VSOkAUCS4sgMeaGrCx6sN4jXBNee3PXwFj1Lj6mCU=; b=JLC0FtB7H2KoNYxin4riHgMwuvrMfj5hfh+PZkBZeKSHgiWWno1Y/itGdBEhDxlT54eRn+ 5qxFtyXh7OkLBkWPLOpoZ9Hh+F5jhv/jqyglB9N+exDml2T0H9IvRa7bqctOo33DN0HIm1 5Q/g5iB3Yq7j7wW6Pb1AiB5AAejnLeg= X-MC-Unique: s9T5oyZPMmCuAReKjHx41A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 3/5] conf: add support for max_unmap_size Date: Wed, 2 Aug 2023 13:47:16 +0200 Message-ID: <8f22e42ea31f9f6062e972144848e1b23b8e4d82.1690975692.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690976893952100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- docs/formatdomain.rst | 10 ++++++++++ src/conf/domain_conf.c | 12 +++++++++++- src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 3 ++- src/conf/schemas/domaincommon.rng | 5 +++++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 0d0812f08c..1fe93066bd 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2591,6 +2591,13 @@ paravirtualized driver is specified via the ``disk``= element. + + + + +
+ + @@ -3439,6 +3446,9 @@ paravirtualized driver is specified via the ``disk`` = element. The smallest amount of data that can be discarded in a single operat= ion. It impacts the unmap operations and it must be a multiple of a ``logical_block_size``. + ``max_unmap_size`` + The maximum size of an unmap operation that can be performed for scsi + disks. =20 Filesystems ~~~~~~~~~~~ diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 950c9049ba..59eb9fb0c0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8059,6 +8059,10 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, if (virXMLPropUInt(blockioNode, "discard_granularity", 10, VIR_XML= _PROP_NONE, &def->blockio.discard_granularity) < 0) return NULL; + + if (virXMLPropUInt(blockioNode, "max_unmap_size", 10, VIR_XML_PROP= _NONE, + &def->blockio.max_unmap_size) < 0) + return NULL; } =20 if ((driverNode =3D virXPathNode("./driver", ctxt))) { @@ -22040,7 +22044,8 @@ virDomainDiskBlockIoDefFormat(virBuffer *buf, { if (def->blockio.logical_block_size > 0 || def->blockio.physical_block_size > 0 || - def->blockio.discard_granularity > 0) { + def->blockio.discard_granularity > 0 || + def->blockio.max_unmap_size > 0) { virBufferAddLit(buf, "blockio.logical_block_size > 0) { virBufferAsprintf(buf, @@ -22057,6 +22062,11 @@ virDomainDiskBlockIoDefFormat(virBuffer *buf, " discard_granularity=3D'%u'", def->blockio.discard_granularity); } + if (def->blockio.max_unmap_size > 0) { + virBufferAsprintf(buf, + " max_unmap_size=3D'%u'", + def->blockio.max_unmap_size); + } virBufferAddLit(buf, "/>\n"); } } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1621876a21..26f5fdbd92 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -580,6 +580,7 @@ struct _virDomainDiskDef { unsigned int logical_block_size; unsigned int physical_block_size; unsigned int discard_granularity; + unsigned int max_unmap_size; } blockio; =20 virDomainBlockIoTuneInfo blkdeviotune; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 7e00b6451a..db2dd01985 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -467,7 +467,8 @@ virDomainDiskVhostUserValidate(const virDomainDiskDef *= disk) =20 if (disk->blockio.logical_block_size > 0 || disk->blockio.physical_block_size > 0 || - disk->blockio.discard_granularity > 0) { + disk->blockio.discard_granularity > 0 || + disk->blockio.max_unmap_size > 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("blockio is not supported with vhostuser disk")); return -1; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index ee9c408a21..31897342f4 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -2481,6 +2481,11 @@ + + + + +