From nobody Sun May 5 19:02:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151809858787198.6438142784159; Thu, 8 Feb 2018 06:03:07 -0800 (PST) Received: from localhost ([::1]:34982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejmn3-0002wO-S9 for importer@patchew.org; Thu, 08 Feb 2018 09:03:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejmG5-0006QY-KE for qemu-devel@nongnu.org; Thu, 08 Feb 2018 08:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejmG0-0005s9-Lu for qemu-devel@nongnu.org; Thu, 08 Feb 2018 08:29:01 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:34974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejmFz-0005rG-IS for qemu-devel@nongnu.org; Thu, 08 Feb 2018 08:28:56 -0500 Received: by mail-lf0-x242.google.com with SMTP id a204so6405783lfa.2 for ; Thu, 08 Feb 2018 05:28:55 -0800 (PST) Received: from sarna-pc.skytech.lan ([185.16.37.46]) by smtp.gmail.com with ESMTPSA id w143sm852994lff.52.2018.02.08.05.28.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Feb 2018 05:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skytechnology.pl; s=google; h=from:to:cc:subject:date:message-id; bh=LOlKJ38lLCYpsMgWLxYmiet516cErlQatgKX34/Xwqw=; b=GsGzFLZh4CanNCngDMzKFxR1g+CnyoQ5mzYduuYyuqvvKm7XObjtzVzEQYFOlKAEN0 wkjtH9uN+M7vSkKySMjrr2ggrhkuRKO+ECj4MoeJUEubvhLmxjJ0vVbfjqr3LbVir8Wl 5MZNF7roYNr8oztpShH81b3Tci78HsOl/N5F8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LOlKJ38lLCYpsMgWLxYmiet516cErlQatgKX34/Xwqw=; b=RNa0hnZtxptlk9Z5sM5po4rCBU07IJhL5vXKQW9gEIIjieLXJJZFE0czVgXl/K1qrh 7TMOgJZdOw/ydIUjWZEYQyeFb+zUcvD8Or0pOkY72N66cPZzEn7R3uNfkJNo91qxsxT6 N/Uhav2zwPucEOBOLaz8Azzrf3SNBShjKQcsg8xCatbUimlXq9mZE9l35Zi98Yqf3t24 NULw9Q/jMMN8ix0f12PNGt5vWKp/A2EevHJNAvwcriLS4OId0gyd/Dslc3dv0BfVSX1M VookqbEfaMJdiXnUuxmMATZyOjUtm8VCntdBWlthNWtNQPrZkC21vnNJGgiuGdJGWRcR 7JNg== X-Gm-Message-State: APf1xPC/JHa9p+CLksvtcuMT2UJ++U5gzfyqst+5jYZxur62IQRrbIb1 ntS/eEdno7yZexMlWoCO2i6EhE/J X-Google-Smtp-Source: AH8x224C+gWzP4z50BtR15/WrjE0/jROW47DQVmaB/zTTsI/ViddoseCLNkd4sqNCk5wJ1EtHMbPXg== X-Received: by 10.46.68.221 with SMTP id b90mr540454ljf.62.1518096533201; Thu, 08 Feb 2018 05:28:53 -0800 (PST) From: Piotr Sarna To: qemu-devel@nongnu.org Date: Thu, 8 Feb 2018 14:28:42 +0100 Message-Id: <1518096522-31141-1-git-send-email-sarna@skytechnology.pl> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 X-Mailman-Approved-At: Thu, 08 Feb 2018 08:55:33 -0500 Subject: [Qemu-devel] [PATCH] block: unify blocksize types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Piotr Sarna , famz@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" BlockSizes structure used in block size probing has uint32_t types for logical and physical sizes. These fields are wrongfully assigned to uint16_t in BlockConf, which results, among other errors, in assigning 0 instead of 65536 (which will be the case in at least future LizardFS block device driver among other things). This commit makes BlockConf's physical_block_size and logical_block_size fields uint32_t to avoid inconsistencies. Signed-off-by: Piotr Sarna --- include/hw/block/block.h | 4 ++-- include/hw/qdev-properties.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/block/block.h b/include/hw/block/block.h index 64b9298..c9e6e27 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -17,8 +17,8 @@ =20 typedef struct BlockConf { BlockBackend *blk; - uint16_t physical_block_size; - uint16_t logical_block_size; + uint32_t physical_block_size; + uint32_t logical_block_size; uint16_t min_io_size; uint32_t opt_io_size; int32_t bootindex; diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 1d61a35..c68d7bf 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -210,7 +210,7 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar; #define DEFINE_PROP_BIOS_CHS_TRANS(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_bios_chs_trans, int) #define DEFINE_PROP_BLOCKSIZE(_n, _s, _f) \ - DEFINE_PROP_UNSIGNED(_n, _s, _f, 0, qdev_prop_blocksize, uint16_t) + DEFINE_PROP_UNSIGNED(_n, _s, _f, 0, qdev_prop_blocksize, uint32_t) #define DEFINE_PROP_PCI_HOST_DEVADDR(_n, _s, _f) \ DEFINE_PROP(_n, _s, _f, qdev_prop_pci_host_devaddr, PCIHostDeviceAddre= ss) #define DEFINE_PROP_MEMORY_REGION(_n, _s, _f) \ --=20 2.7.4