From patchwork Wed May 27 12:45:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 11572947 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4565159A for ; Wed, 27 May 2020 12:54:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9076D20873 for ; Wed, 27 May 2020 12:54:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=yandex-team.ru header.i=@yandex-team.ru header.b="GT+rFY3/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9076D20873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=yandex-team.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jdvXi-0001Sb-An; Wed, 27 May 2020 12:52:22 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jdvQw-0000f6-1I for xen-devel@lists.xenproject.org; Wed, 27 May 2020 12:45:22 +0000 X-Inumbo-ID: ec23362a-a017-11ea-a740-12813bfff9fa Received: from forwardcorp1o.mail.yandex.net (unknown [95.108.205.193]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ec23362a-a017-11ea-a740-12813bfff9fa; Wed, 27 May 2020 12:45:20 +0000 (UTC) Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 2C5E72E1581; Wed, 27 May 2020 15:45:18 +0300 (MSK) Received: from iva4-7c3d9abce76c.qloud-c.yandex.net (iva4-7c3d9abce76c.qloud-c.yandex.net [2a02:6b8:c0c:4e8e:0:640:7c3d:9abc]) by mxbackcorp1o.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id yGuxnAsuRm-jBxmk9RU; Wed, 27 May 2020 15:45:18 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1590583518; bh=42hnJ6RHsswvNBcGuhOx1Vid5BV/7/IOuRuXw9PtENo=; h=Message-Id:Date:Subject:To:From:Cc; b=GT+rFY3/A/0GhjPSqnGNvn8/0KVp00ezEslGbKJi1h1CVFHRFaME8nksjJwjD6zVw raZBgRPM5mlp8y4/rx6hWXKRnNlkNTSuGd95/scuF9tESi9pzKpbstRV6qtHXXiAtn i85pJ9QEsSf4mIai+JIHe8xloikKTWVzzaQUhOKI= Authentication-Results: mxbackcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:8308::1:12]) by iva4-7c3d9abce76c.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id bzO5qPtczO-jBWOPpYZ; Wed, 27 May 2020 15:45:11 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Roman Kagan To: qemu-devel@nongnu.org Subject: [PATCH v6 0/5] block: enhance handling of size-related BlockConf properties Date: Wed, 27 May 2020 15:45:06 +0300 Message-Id: <20200527124511.986099-1-rvkagan@yandex-team.ru> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 27 May 2020 12:52:22 +0000 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Stefano Stabellini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Paul Durrant , Eric Blake , "Michael S. Tsirkin" , Laurent Vivier , Max Reitz , John Snow , Keith Busch , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" BlockConf includes several properties counted in bytes. Enhance their handling in a some aspects, specifically - accept common size suffixes (k, m) - perform consistency checks on the values - lift the upper limit on physical_block_size and logical_block_size Also fix the accessor for opt_io_size in virtio-blk to make it consistent with the size of the field. History: v5 -> v6: - fix forgotten xen-block and swim - add prop_size32 instead of going with 64bit v4 -> v5: - re-split the patches [Philippe] - fix/reword error messages [Philippe, Kevin] - do early return on failed consistency check [Philippe] - use QEMU_IS_ALIGNED instead of open coding [Philippe] - make all BlockConf size props support suffixes - expand the log for virtio-blk opt_io_size [Michael] v3 -> v4: - add patch to fix opt_io_size width in virtio-blk - add patch to perform consistency checks [Kevin] - check min_io_size against truncation [Kevin] v2 -> v3: - mention qcow2 cluster size limit in the log and comment [Eric] v1 -> v2: - cap the property at 2 MiB [Eric] - accept size suffixes Roman Kagan (5): virtio-blk: store opt_io_size with correct size block: consolidate blocksize properties consistency checks qdev-properties: blocksize: use same limits in code and description block: make size-related BlockConf properties accept size suffixes block: lift blocksize property limit to 2 MiB include/hw/block/block.h | 14 +- include/hw/qdev-properties.h | 5 +- hw/block/block.c | 41 ++- hw/block/fdc.c | 5 +- hw/block/nvme.c | 5 +- hw/block/swim.c | 5 +- hw/block/virtio-blk.c | 9 +- hw/block/xen-block.c | 6 +- hw/core/qdev-properties.c | 85 +++++- hw/ide/qdev.c | 5 +- hw/scsi/scsi-disk.c | 12 +- hw/usb/dev-storage.c | 5 +- tests/qemu-iotests/172.out | 532 +++++++++++++++++------------------ 13 files changed, 420 insertions(+), 309 deletions(-)